From report at bugs.python.org Tue Mar 1 00:37:24 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 01 Mar 2016 05:37:24 +0000 Subject: [issue26462] Patch to enhance literal block language declaration In-Reply-To: <1456790330.71.0.936150839602.issue26462@psf.upfronthosting.co.za> Message-ID: <1456810644.24.0.138394498373.issue26462@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- nosy: +georg.brandl, serhiy.storchaka stage: -> patch review versions: +Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 00:48:57 2016 From: report at bugs.python.org (Martin Panter) Date: Tue, 01 Mar 2016 05:48:57 +0000 Subject: [issue26456] import _tkinter + TestForkInThread leaves zombie with stalled thread In-Reply-To: <1456727351.62.0.83247971741.issue26456@psf.upfronthosting.co.za> Message-ID: <1456811337.17.0.639226596249.issue26456@psf.upfronthosting.co.za> Martin Panter added the comment: Yes it looks like you might be right about those hanging buildbots. The occasional successes (e.g. ) seem to happen when test_thread runs before any of the TK, TCL, and Idle tests. The reason why this does not affect Python 3 is probably because the test only calls sys.exit() in Python 2; this code was added in r78527. In Python 3, the code was merged in revision 58c35495a934, but the code was apparently changed to call os._exit() at the same time. So one potential fix or workaround could be to change to os._exit() as in child-exit.patch. It seems Tcl_FindExecutable() creates a thread, and this thread survives fork(). (Perhaps it is re-created?) Python exiting does not cause this thread to be stopped. Playing with ?strace? it seems the threads that return from fork() in the parent and child both finish with _exit(0). However the ?main? thread in the parent finishes with exit_group(0), which is documented as terminating all threads. Calling os._exit() also seems to call exit_group(), which explains why that fixes the problem in the child. I can produce the problem in all versions of Python without using _tkinter, using the following code instead: import _thread, os, time def thread1(): pid = os.fork() if not pid: # In the child, the original main thread no longer exists. Start a # new thread that will stall for 60 s. _thread.start_new_thread(time.sleep, (60,)) _thread.start_new_thread(thread1, ()) time.sleep(2) # Give fork() a chance to run I?m not really sure, but maybe Python could improve its handling of this case, when fork() is called on a non-?main? thread and another thread is also running in the child process. ---------- keywords: +patch Added file: http://bugs.python.org/file42053/child-exit.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 01:00:34 2016 From: report at bugs.python.org (Georg Brandl) Date: Tue, 01 Mar 2016 06:00:34 +0000 Subject: [issue26462] Patch to enhance literal block language declaration In-Reply-To: <1456790330.71.0.936150839602.issue26462@psf.upfronthosting.co.za> Message-ID: <1456812034.1.0.0443399018473.issue26462@psf.upfronthosting.co.za> Georg Brandl added the comment: Thanks for the patch! Most "bash" blocks should be "console" (since the prompt is shown). "pycon" should not be needed, since it is detected automatically. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 01:19:58 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 01 Mar 2016 06:19:58 +0000 Subject: [issue26457] Error in ipaddress.address_exclude function In-Reply-To: <1456727384.52.0.87644034474.issue26457@psf.upfronthosting.co.za> Message-ID: <1456813198.52.0.655779946995.issue26457@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- nosy: +serhiy.storchaka stage: -> needs patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 01:37:00 2016 From: report at bugs.python.org (Terry J. Reedy) Date: Tue, 01 Mar 2016 06:37:00 +0000 Subject: [issue26404] socketserver context manager In-Reply-To: <1456088110.26.0.0505883466277.issue26404@psf.upfronthosting.co.za> Message-ID: <1456814220.25.0.614778272196.issue26404@psf.upfronthosting.co.za> Terry J. Reedy added the comment: I agree and consider this is an argument for adding the context manager methods and using them with 'with' in the examples. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 02:19:14 2016 From: report at bugs.python.org (Xiang Zhang) Date: Tue, 01 Mar 2016 07:19:14 +0000 Subject: [issue26457] Error in ipaddress.address_exclude function In-Reply-To: <1456727384.52.0.87644034474.issue26457@psf.upfronthosting.co.za> Message-ID: <1456816754.43.0.293897247238.issue26457@psf.upfronthosting.co.za> Xiang Zhang added the comment: I propose a patch simply add one to end so that the broadcast address network will appear in the result, which behaves the same as ipaddr.py. Corresponding tests are added. All tests are passed but I am afraid some logic may break. ---------- keywords: +patch Added file: http://bugs.python.org/file42054/address_exclude.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 03:21:13 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 01 Mar 2016 08:21:13 +0000 Subject: [issue26457] Error in ipaddress.address_exclude function In-Reply-To: <1456727384.52.0.87644034474.issue26457@psf.upfronthosting.co.za> Message-ID: <1456820473.85.0.959569550256.issue26457@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: LGTM. I have wrote similar patch but with different tests. ---------- assignee: -> serhiy.storchaka stage: needs patch -> commit review versions: +Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 03:26:32 2016 From: report at bugs.python.org (Roundup Robot) Date: Tue, 01 Mar 2016 08:26:32 +0000 Subject: [issue26457] Error in ipaddress.address_exclude function In-Reply-To: <1456727384.52.0.87644034474.issue26457@psf.upfronthosting.co.za> Message-ID: <20160301082629.18913.21221@psf.io> Roundup Robot added the comment: New changeset 6d6c0a7b71f5 by Serhiy Storchaka in branch '3.5': Issue #26457: Fixed the subnets() methods in IP network classes for the case https://hg.python.org/cpython/rev/6d6c0a7b71f5 New changeset c092148a1b55 by Serhiy Storchaka in branch 'default': Issue #26457: Fixed the subnets() methods in IP network classes for the case https://hg.python.org/cpython/rev/c092148a1b55 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 03:26:58 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 01 Mar 2016 08:26:58 +0000 Subject: [issue26457] Error in ipaddress.address_exclude function In-Reply-To: <1456727384.52.0.87644034474.issue26457@psf.upfronthosting.co.za> Message-ID: <1456820818.37.0.1266067644.issue26457@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- resolution: -> fixed stage: commit review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 03:34:20 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 01 Mar 2016 08:34:20 +0000 Subject: [issue23921] Standardize documentation whitespace, formatting In-Reply-To: <1428814739.03.0.523944029114.issue23921@psf.upfronthosting.co.za> Message-ID: <1456821259.99.0.68909645096.issue23921@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: James, could you please update your patch to address Martin's comments? In general the patch LGTM and I hope to commit it in short time. ---------- nosy: +georg.brandl versions: +Python 3.6 -Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 04:36:42 2016 From: report at bugs.python.org (STINNER Victor) Date: Tue, 01 Mar 2016 09:36:42 +0000 Subject: [issue26463] asyncio-related (?) segmentation fault In-Reply-To: <1456800654.16.0.873933997584.issue26463@psf.upfronthosting.co.za> Message-ID: <1456825002.99.0.964902599822.issue26463@psf.upfronthosting.co.za> STINNER Victor added the comment: Please try to get the Python stacktrace on the segfault using the faulthandler module: add faulthandler.enable() call at the beginning of your application. https://docs.python.org/dev/library/faulthandler.html I suspect a bug in your C code, not in asyncio. asyncio is written in pure Python. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 05:02:30 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 01 Mar 2016 10:02:30 +0000 Subject: [issue26436] Add the regex-dna benchmark In-Reply-To: <1456402657.17.0.694301948635.issue26436@psf.upfronthosting.co.za> Message-ID: <1456826550.21.0.5273202494.issue26436@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: I used the code from fasta and regex-dna tests almost without changes. I.e. one part create the data in standard FASTA format (with 60-character lines and headers), and other part parses this format. The code can be simple if generate and consume raw data. As for the quality of the code, tested code is pretty simple and enough pythonic. Yes, using replace() is more idiomatic and faster, but we are testing regular expressions. bytes.translate() doesn't work with dict, and str.translate() is slower than replace() or re.sub(). The code for generating test data is not the kind of the code that should be used in tutorials. It is highly optimized code that uses different optimization tricks that could be hard to understand without comments. But nothing unpythonic. It can be simplified if avoid formatting the data in standard FASTA format. > I would add another kind of question: is it stressing something useful that isn't already stressed by the two other regex benchmarks we already have? Yes, it is. The regex_v8 benchmark is 2x faster with regex than with re. But the regex_dna benchmark is 1.6x slower with regex than with re. Thus these tests are stressing different aspects of regular expressions. It may be worth also to test regular expressions with unicode strings. I expect some difference with latest Python and earlier 3.x and 2.7. The question is how to do this? Add a special option to switch between bytes and unicode (as --force_bytes in regex_effbot), or just run tests for bytes and unicode sequentially and add results? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 05:14:26 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 01 Mar 2016 10:14:26 +0000 Subject: [issue26167] Improve copy.copy speed for built-in types (list/set/dict) In-Reply-To: <1453313258.69.0.822432262864.issue26167@psf.upfronthosting.co.za> Message-ID: <1456827266.08.0.109058163161.issue26167@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: If there are no other comments, I'm going to commit the patch in short time. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 08:30:14 2016 From: report at bugs.python.org (Nicholas Chammas) Date: Tue, 01 Mar 2016 13:30:14 +0000 Subject: [issue26463] asyncio-related (?) segmentation fault In-Reply-To: <1456800654.16.0.873933997584.issue26463@psf.upfronthosting.co.za> Message-ID: <1456839014.43.0.17076482325.issue26463@psf.upfronthosting.co.za> Nicholas Chammas added the comment: Thanks for the tip. Enabling the fault handler reveals that the crash is happening from the Cryptography library. I'll move this issue there. Thank you. ---------- resolution: -> not a bug status: open -> closed Added file: http://bugs.python.org/file42055/faulthandler-stacktrace.txt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 08:51:44 2016 From: report at bugs.python.org (Ben Knight) Date: Tue, 01 Mar 2016 13:51:44 +0000 Subject: [issue26464] str.translate() unexpectedly duplicates untranslated characters Message-ID: <1456840304.03.0.420145350869.issue26464@psf.upfronthosting.co.za> New submission from Ben Knight: Python 3.5.1 x86-64, Windows 10 I created a translation map that translated some characters to None and others to strings and found that in some cases str.translate() will duplicate one of the untranslated characters in the returned string. How to reproduce: table = str.maketrans({'a': None, 'b': 'cd'}) 'axb'.translate(table) Expected result: 'xcd' Actual result: 'xxcd' Mapping 'a' to '' instead of None will produce the desired effect. ---------- messages: 261049 nosy: ben.knight priority: normal severity: normal status: open title: str.translate() unexpectedly duplicates untranslated characters type: behavior versions: Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 08:59:27 2016 From: report at bugs.python.org (Michael Felt) Date: Tue, 01 Mar 2016 13:59:27 +0000 Subject: [issue18987] distutils.utils.get_platform() for 32-bit Python on a 64-bit machine In-Reply-To: <1378731781.77.0.0136191125302.issue18987@psf.upfronthosting.co.za> Message-ID: <1456840767.29.0.155223972588.issue18987@psf.upfronthosting.co.za> Michael Felt added the comment: while reading to learn... FYI: AIX does not return even a hint of the underlying platform (assumption is probably 64-bit) - but the value of the interpreter is anyone's guess root at x064:[/data/prj/aixtools/python/python-2.7.10]python Python 2.7.10 (default, Mar 1 2016, 12:55:35) [C] on aix5 Type "help", "copyright", "credits" or "license" for more information. >>> import distutils.util >>> distutils.util.get_platform() 'aix-5.3' >>> import os >>> os.uname() ('AIX', 'x064', '3', '5', '00XXXXXXXXXX') Going through the rest of the preceding messages: a) platform.architecture() - seems accurate for AIX, is import so expensive that it is not preferred? >>> import platform >>> platform.architecture() ('32bit', '') b) sys.maxsize < 2**16 is a good hint, but it is possible to have a 64-bit int with only 32-bit pointers - based on assumption! >>> import os, sys >>> sys.maxsize 2147483647 >>> 2**32 4294967296L >>> 2**31 2147483648L > If your wording is correct, and get_platform() really is used to determine "the > python being used," then we could actually be improving things by fixing this. > Currently, get_platform() doesn't tell you the bitness of the *python* being > used, but the bitness of the *OS* being used (the two of which only differ on > 32-on-64). So, it seems get_platform() does not have a uniform result that could ever be parsed by internal or external modules. It is always dependent on something external to python (e.g., uname() output). IMHO: determining and adding the python bitness, as MacOS has done (i.e., I assume it is either (32-bit) or (64-bit) at the end) is a move forward - and I would be willing to submit a couple of somethings so that that value could be determined - leave it to a committer to decide what makes best sense. Of course, it is "sad" if it breaks existing things, but being non-uniform as it is worse (imho :smile:) ---------- nosy: +Michael.Felt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 09:09:39 2016 From: report at bugs.python.org (Sam Ferencik) Date: Tue, 01 Mar 2016 14:09:39 +0000 Subject: [issue18987] distutils.utils.get_platform() for 32-bit Python on a 64-bit machine In-Reply-To: <1378731781.77.0.0136191125302.issue18987@psf.upfronthosting.co.za> Message-ID: <1456841379.36.0.765019190594.issue18987@psf.upfronthosting.co.za> Sam Ferencik added the comment: Thanks for the analysis. I agree with you. If there's much push-back, maybe we could introduce an alternative interface, i.e. let get_platform() do its thing, deprecate it, and introduce something like get_interpreter_platform(). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 09:26:13 2016 From: report at bugs.python.org (Alex Gaynor) Date: Tue, 01 Mar 2016 14:26:13 +0000 Subject: [issue26465] Upgrade OpenSSL shipped with python installers Message-ID: <1456842373.05.0.727353806198.issue26465@psf.upfronthosting.co.za> New submission from Alex Gaynor: https://openssl.org/news/secadv/20160301.txt ---------- keywords: security_issue messages: 261052 nosy: alex, paul.moore, steve.dower, tim.golden, zach.ware priority: critical severity: normal status: open title: Upgrade OpenSSL shipped with python installers 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 Mar 1 10:08:22 2016 From: report at bugs.python.org (Michael Felt) Date: Tue, 01 Mar 2016 15:08:22 +0000 Subject: [issue26466] cannot build python 2.7.11 on AIX Message-ID: <1456844902.77.0.455974310535.issue26466@psf.upfronthosting.co.za> New submission from Michael Felt: Finally noticed the new release, unfortunately it fails to build. All proceeds normally until... tail .buildaix/make.out ar rc libpython2.7.a 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 Parser/myreadline.o Parser/tokenizer.o ar rc libpython2.7.a Objects/abstract.o Objects/boolobject.o Objects/bufferobject.o Objects/bytes_methods.o Objects/bytearrayobject.o Objects/capsule.o Objects/cellobject.o Objects/classobject.o Objects/cobject.o Objects/codeobject.o Objects/complexobject.o Objects/descrobject.o Objects/enumobject.o Objects/exceptions.o Objects/genobject.o Objects/fileobject.o Objects/floatobject.o Objects/frameobject.o Objects/funcobject.o Objects/intobject.o Objects/iterobject.o Objects/listobject.o Objects/longobject.o Objects/dictobject.o Objects/memoryobject.o Objects/methodobject.o Objects/moduleobject.o Objects/object.o Objects/obmalloc.o Objects/rangeobject.o Objects/setobject.o Objects/sliceobject.o Objects/stringobject.o Objects/structseq.o Objects/tupleobject.o Objects/typeobject.o Objects/weakrefobject.o Objects/unicodeobject.o Objects/unicodectype.o ar rc libpython2.7.a Python/_warnings.o Python/Python-ast.o Python/asdl.o Python/ast.o Python/bltinmodule.o Python/ceval.o Python/compile.o Python/codecs.o Python/errors.o Python/frozen.o Python/frozenmain.o Python/future.o Python/getargs.o Python/getcompiler.o Python/getcopyright.o Python/getplatform.o Python/getversion.o Python/graminit.o Python/import.o Python/importdl.o Python/marshal.o Python/modsupport.o Python/mystrtoul.o Python/mysnprintf.o Python/peephole.o Python/pyarena.o Python/pyctype.o Python/pyfpe.o Python/pymath.o Python/pystate.o Python/pythonrun.o Python/random.o Python/structmember.o Python/symtable.o Python/sysmodule.o Python/traceback.o Python/getopt.o Python/pystrcmp.o Python/pystrtod.o Python/dtoa.o Python/formatter_unicode.o Python/formatter_string.o Python/dynload_shlib.o Python/thread.o ar rc libpython2.7.a Modules/config.o Modules/getpath.o Modules/main.o Modules/gcmodule.o ar rc libpython2.7.a Modules/threadmodule.o Modules/signalmodule.o Modules/posixmodule.o Modules/errnomodule.o Modules/pwdmodule.o Modules/_sre.o Modules/_codecsmodule.o Modules/_weakref.o Modules/zipimport.o Modules/symtablemodule.o Modules/xxsubtype.o ranlib libpython2.7.a ./Modules/makexp_aix Modules/python.exp . libpython2.7.a; xlc -Wl,-bE:Modules/python.exp -lld -o python \ Modules/python.o \ libpython2.7.a -ldl -lpthread -lm Makefile:485: recipe for target 'python' failed more details... michael at x071:[/data/prj/aixtools/python/python-2.7.11]make ./Modules/makexp_aix Modules/python.exp . libpython2.7.a; xlc -Wl,-bE:Modules/python.exp -lld -o python \ Modules/python.o \ libpython2.7.a -ldl -lpthread -lm ld: 0711-596 SEVERE ERROR: Object libpython2.7.a[ceval.o] An RLD for section 2 (.data) refers to symbol 0, but the storage class of the symbol is not C_EXT or C_HIDEXT. ld: 0711-596 SEVERE ERROR: Object libpython2.7.a[ceval.o] An RLD for section 2 (.data) refers to symbol 0, but the storage class of the symbol is not C_EXT or C_HIDEXT. This is, best guess, an error for 125 symbols... michael at x071:[/data/prj/aixtools/python/python-2.7.11]nohup make | egrep "^ld" | wc -l Obviously, if the ceval.o member is removed it cannot complete - BUT - I hope it provides sufficient info that someone may know what I should try next. michael at x071:[/data/prj/aixtools/python/python-2.7.11]ar d libpython2.7.a ceval.o michael at x071:[/data/prj/aixtools/python/python-2.7.11]make V=1 ./Modules/makexp_aix Modules/python.exp . libpython2.7.a; xlc -Wl,-bE:Modules/python.exp -lld -o python \ Modules/python.o \ libpython2.7.a -ldl -lpthread -lm ld: 0711-317 ERROR: Undefined symbol: ._PyEval_SliceIndex ld: 0711-317 ERROR: Undefined symbol: .PyEval_SaveThread ld: 0711-317 ERROR: Undefined symbol: .PyEval_RestoreThread ld: 0711-317 ERROR: Undefined symbol: _PyEval_SliceIndex ld: 0711-317 ERROR: Undefined symbol: _Py_CheckRecursionLimit ld: 0711-317 ERROR: Undefined symbol: ._Py_CheckRecursiveCall ld: 0711-317 ERROR: Undefined symbol: .PyEval_GetFuncName ld: 0711-317 ERROR: Undefined symbol: .PyEval_GetFuncDesc ld: 0711-317 ERROR: Undefined symbol: .PyEval_CallObjectWithKeywords ld: 0711-317 ERROR: Undefined symbol: .PyEval_GetRestricted ld: 0711-317 ERROR: Undefined symbol: .PyEval_GetGlobals ld: 0711-317 ERROR: Undefined symbol: _Py_Ticker ld: 0711-317 ERROR: Undefined symbol: _Py_CheckInterval ld: 0711-317 ERROR: Undefined symbol: PyEval_GetCallStats ld: 0711-317 ERROR: Undefined symbol: .PyEval_ReleaseLock ld: 0711-317 ERROR: Undefined symbol: .PyEval_InitThreads ld: 0711-317 ERROR: Undefined symbol: .PyEval_AcquireThread ld: 0711-317 ERROR: Undefined symbol: .PyEval_EvalCode ld: 0711-317 ERROR: Undefined symbol: .PyEval_GetBuiltins ld: 0711-317 ERROR: Undefined symbol: ._PyEval_CallTracing ld: 0711-317 ERROR: Undefined symbol: .Py_GetRecursionLimit ld: 0711-317 ERROR: Undefined symbol: .Py_SetRecursionLimit ld: 0711-317 ERROR: Undefined symbol: .PyEval_SetProfile ld: 0711-317 ERROR: Undefined symbol: .PyEval_SetTrace ld: 0711-317 ERROR: Undefined symbol: .Py_FlushLine ld: 0711-317 ERROR: Undefined symbol: .Py_AddPendingCall ld: 0711-317 ERROR: Undefined symbol: .PyEval_ReInitThreads ld: 0711-317 ERROR: Undefined symbol: .PyEval_GetFrame ld: 0711-317 ERROR: Undefined symbol: .PyEval_EvalCodeEx ld: 0711-317 ERROR: Undefined symbol: .PyEval_GetLocals ld: 0711-317 ERROR: Undefined symbol: .PyEval_MergeCompilerFlags ld: 0711-317 ERROR: Undefined symbol: .PyEval_EvalFrameEx ld: 0711-317 ERROR: Undefined symbol: .Py_MakePendingCalls ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information. make: *** [python] Error 8 michael at x071:[/data/prj/aixtools/python/python-2.7.11]./Modules/makexp_aix Modules/ceval.exp . Python/ceval.o michael at x071:[/data/prj/aixtools/python/python-2.7.11]more Modules/ceval.exp #!. * * Generated automatically by makexp_aix (Tue Mar 1 14:52:11 UTC 2016) * * Base Directory: /data/prj/aixtools/python/python-2.7.11 * Input File(s) : Python/ceval.o * * NOTE: lists _all_ global symbols defined in the above file(s). * PyEval_AcquireLock PyEval_AcquireThread PyEval_CallObjectWithKeywords PyEval_EvalCode PyEval_EvalCodeEx PyEval_EvalFrame PyEval_EvalFrameEx PyEval_GetBuiltins PyEval_GetCallStats PyEval_GetFrame PyEval_GetFuncDesc PyEval_GetFuncName PyEval_GetGlobals PyEval_GetLocals PyEval_GetRestricted PyEval_InitThreads PyEval_MergeCompilerFlags PyEval_ReInitThreads PyEval_ReleaseLock PyEval_ReleaseThread PyEval_RestoreThread PyEval_SaveThread PyEval_SetProfile PyEval_SetTrace PyEval_ThreadsInitialized Py_AddPendingCall Py_FlushLine Py_GetRecursionLimit Py_MakePendingCalls Py_SetRecursionLimit _PyEval_CallTracing _PyEval_SliceIndex _Py_CheckInterval _Py_CheckRecursionLimit _Py_CheckRecursiveCall _Py_Ticker FYI: this may be related to an issue with the assembler not doing the right thing after the changes between. HOWEVER, besides an older AIX 5.3 system that might have had a bad 'as', I get the same error on AIX 6.1 TL5. >From the APAR description - mine is fixed: The broken assembler is distributed in all latest service packs of all - as of July 21st, 2011 - supported AIX versions: https://www-304.ibm.com/support/docview.wss?uid=isg1IZ98134 So, while a bug is always a possibility - this OLD one is not likely. michael at x071:[/data/prj/aixtools/python/python-2.7.11]oslevel -s 6100-09-04-1441 Instead, I am thinking that I will try being more specicif with the machine (processor) definition, e.g. power5 rather than common. Suggestions welcome! ---------- components: Build messages: 261053 nosy: Michael.Felt priority: normal severity: normal status: open title: cannot build python 2.7.11 on AIX versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 10:09:03 2016 From: report at bugs.python.org (STINNER Victor) Date: Tue, 01 Mar 2016 15:09:03 +0000 Subject: [issue26466] cannot build python 2.7.11 on AIX In-Reply-To: <1456844902.77.0.455974310535.issue26466@psf.upfronthosting.co.za> Message-ID: <1456844943.41.0.186585775404.issue26466@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- nosy: +haypo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 10:09:18 2016 From: report at bugs.python.org (STINNER Victor) Date: Tue, 01 Mar 2016 15:09:18 +0000 Subject: [issue26466] cannot build python 2.7.11 on AIX In-Reply-To: <1456844902.77.0.455974310535.issue26466@psf.upfronthosting.co.za> Message-ID: <1456844958.98.0.26101251864.issue26466@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- nosy: +David.Edelsohn _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 10:11:33 2016 From: report at bugs.python.org (David Edelsohn) Date: Tue, 01 Mar 2016 15:11:33 +0000 Subject: [issue26466] cannot build python 2.7.11 on AIX In-Reply-To: <1456844902.77.0.455974310535.issue26466@psf.upfronthosting.co.za> Message-ID: <1456845093.73.0.521918541729.issue26466@psf.upfronthosting.co.za> David Edelsohn added the comment: Don't use XLC. It may relate to using -Wl option, which is a GCC option. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 11:15:03 2016 From: report at bugs.python.org (Michael Felt) Date: Tue, 01 Mar 2016 16:15:03 +0000 Subject: [issue26466] cannot build python 2.7.11 on AIX In-Reply-To: <1456844902.77.0.455974310535.issue26466@psf.upfronthosting.co.za> Message-ID: <1456848903.42.0.929070142188.issue26466@psf.upfronthosting.co.za> Michael Felt added the comment: It worked fine using xlc with 2.7.10 (verified again today). The delta between ceval.c in 2.7.10 and 2.7.11 is large. make.out (excerpt) 2.7.10: rm -f libpython2.7.a ar rc libpython2.7.a Modules/getbuildinfo.o ar rc libpython2.7.a 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 Parser/myreadline.o Parser/tokenizer.o ar rc libpython2.7.a Objects/abstract.o Objects/boolobject.o Objects/bufferobject.o Objects/bytes_methods.o Objects/bytearrayobject.o Objects/capsule.o Objects/c ellobject.o Objects/classobject.o Objects/cobject.o Objects/codeobject.o Objects/complexobject.o Objects/descrobject.o Objects/enumobject.o Objects/exceptions.o Object s/genobject.o Objects/fileobject.o Objects/floatobject.o Objects/frameobject.o Objects/funcobject.o Objects/intobject.o Objects/iterobject.o Objects/listobject.o Objec ts/longobject.o Objects/dictobject.o Objects/memoryobject.o Objects/methodobject.o Objects/moduleobject.o Objects/object.o Objects/obmalloc.o Objects/rangeobject.o Obj ects/setobject.o Objects/sliceobject.o Objects/stringobject.o Objects/structseq.o Objects/tupleobject.o Objects/typeobject.o Objects/weakrefobject.o Objects/unicodeobje ct.o Objects/unicodectype.o ar rc libpython2.7.a Python/_warnings.o Python/Python-ast.o Python/asdl.o Python/ast.o Python/bltinmodule.o Python/ceval.o Python/compile.o Python/codecs.o Pyt hon/errors.o Python/frozen.o Python/frozenmain.o Python/future.o Python/getargs.o Python/getcompiler.o Python/getcopyright.o Python/getplatform.o Python/getversion.o Python/graminit.o Python/import.o Python/importdl.o Python/marshal.o Python/modsupport.o Python/mystrtoul.o Python/mysnprintf.o Python/peephole.o Python/pyarena.o Pyt hon/pyctype.o Python/pyfpe.o Python/pymath.o Python/pystate.o Python/pythonrun.o Python/random.o Python/structmember.o Python/symtable.o Python/sysmodule.o Python/tra ceback.o Python/getopt.o Python/pystrcmp.o Python/pystrtod.o Python/dtoa.o Python/formatter_unicode.o Python/formatter_string.o Python/dynload_shlib.o Python/threa d.o ar rc libpython2.7.a Modules/config.o Modules/getpath.o Modules/main.o Modules/gcmodule.o ar rc libpython2.7.a Modules/threadmodule.o Modules/signalmodule.o Modules/posixmodule.o Modules/errnomodule.o Modules/pwdmodule.o Modules/_sre.o Modules/_codecs module.o Modules/_weakref.o Modules/zipimport.o Modules/symtablemodule.o Modules/xxsubtype.o ranlib libpython2.7.a ./Modules/makexp_aix Modules/python.exp . libpython2.7.a; xlc -Wl,-bE:Modules/python.exp -lld -o python Modules/python.o libpython2.7.a -ldl -lpthread -lm ./python -E -S -m sysconfig --generate-posix-vars ; if test $? -ne 0 ; then echo "generate-posix-vars failed" ; rm -f ./pybuilddir.txt ; exit 1 ; fi running build tail make.out (2.7.11) rm -f libpython2.7.a ar rc libpython2.7.a Modules/getbuildinfo.o ar rc libpython2.7.a 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 Parser/myreadline.o Parser/tokenizer.o ar rc libpython2.7.a Objects/abstract.o Objects/boolobject.o Objects/bufferobject.o Objects/bytes_methods.o Objects/bytearrayobject.o Objects/capsule.o Objects/cellobject.o Ob jects/classobject.o Objects/cobject.o Objects/codeobject.o Objects/complexobject.o Objects/descrobject.o Objects/enumobject.o Objects/exceptions.o Objects/genobject.o Objects/ fileobject.o Objects/floatobject.o Objects/frameobject.o Objects/funcobject.o Objects/intobject.o Objects/iterobject.o Objects/listobject.o Objects/longobject.o Objects/dictob ject.o Objects/memoryobject.o Objects/methodobject.o Objects/moduleobject.o Objects/object.o Objects/obmalloc.o Objects/rangeobject.o Objects/setobject.o Objects/sliceobject.o Objects/stringobject.o Objects/structseq.o Objects/tupleobject.o Objects/typeobject.o Objects/weakrefobject.o Objects/unicodeobject.o Objects/unicodectype.o ar rc libpython2.7.a Python/_warnings.o Python/Python-ast.o Python/asdl.o Python/ast.o Python/bltinmodule.o Python/ceval.o Python/compile.o Python/codecs.o Python/errors.o Pyt hon/frozen.o Python/frozenmain.o Python/future.o Python/getargs.o Python/getcompiler.o Python/getcopyright.o Python/getplatform.o Python/getversion.o Python/graminit.o Python/ import.o Python/importdl.o Python/marshal.o Python/modsupport.o Python/mystrtoul.o Python/mysnprintf.o Python/peephole.o Python/pyarena.o Python/pyctype.o Python/pyfpe.o Pytho n/pymath.o Python/pystate.o Python/pythonrun.o Python/random.o Python/structmember.o Python/symtable.o Python/sysmodule.o Python/traceback.o Python/getopt.o Python/pystrcmp.o Python/pystrtod.o Python/dtoa.o Python/formatter_unicode.o Python/formatter_string.o Python/dynload_shlib.o Python/thread.o ar rc libpython2.7.a Modules/config.o Modules/getpath.o Modules/main.o Modules/gcmodule.o ar rc libpython2.7.a Modules/threadmodule.o Modules/signalmodule.o Modules/posixmodule.o Modules/errnomodule.o Modules/pwdmodule.o Modules/_sre.o Modules/_codecsmodule.o Modules/_weakref.o Modules/zipimport.o Modules/symtablemodule.o Modules/xxsubtype.o ranlib libpython2.7.a ./Modules/makexp_aix Modules/python.exp . libpython2.7.a; xlc -Wl,-bE:Modules/python.exp -lld -o python \ Modules/python.o \ libpython2.7.a -ldl -lpthread -lm If -Wl,something was a structural problem I would have quit xlc (and perhaps AIX) years ago. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 11:17:05 2016 From: report at bugs.python.org (glep) Date: Tue, 01 Mar 2016 16:17:05 +0000 Subject: [issue26445] setup.py sdist mishandles package_dir option In-Reply-To: <1456511193.21.0.2161734334.issue26445@psf.upfronthosting.co.za> Message-ID: <1456849025.2.0.230042441427.issue26445@psf.upfronthosting.co.za> glep added the comment: Actually I have come to realise that this is the intended behaviour for source distributions. And that it is simply not possible to pull in a package from outside the current top-level package when building a source distribution. ---------- resolution: -> not a bug status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 11:20:58 2016 From: report at bugs.python.org (Michael Felt) Date: Tue, 01 Mar 2016 16:20:58 +0000 Subject: [issue18987] distutils.utils.get_platform() for 32-bit Python on a 64-bit machine In-Reply-To: <1378731781.77.0.0136191125302.issue18987@psf.upfronthosting.co.za> Message-ID: <1456849258.93.0.939366311023.issue18987@psf.upfronthosting.co.za> Michael Felt added the comment: If you need assistance (re: AIX), just ask. However, I am guessing you have enough to move forward. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 11:22:36 2016 From: report at bugs.python.org (David Edelsohn) Date: Tue, 01 Mar 2016 16:22:36 +0000 Subject: [issue26466] cannot build python 2.7.11 on AIX In-Reply-To: <1456844902.77.0.455974310535.issue26466@psf.upfronthosting.co.za> Message-ID: <1456849356.11.0.503102829172.issue26466@psf.upfronthosting.co.za> David Edelsohn added the comment: Something is building libpython2.7.a incorrectly or the python.exp script is not functioning correctly. ld: 0711-596 SEVERE ERROR: Object libpython2.7.a[ceval.o] An RLD for section 2 (.data) refers to symbol 0, but the storage class of the symbol is not C_EXT or C_HIDEXT. ld: 0711-596 SEVERE ERROR: Object libpython2.7.a[ceval.o] An RLD for section 2 (.data) refers to symbol 0, but the storage class of the symbol is not C_EXT or C_HIDEXT. is different than the later undefined symbols error. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 11:26:28 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 01 Mar 2016 16:26:28 +0000 Subject: [issue26464] str.translate() unexpectedly duplicates untranslated characters In-Reply-To: <1456840304.03.0.420145350869.issue26464@psf.upfronthosting.co.za> Message-ID: <1456849588.7.0.145253942113.issue26464@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- assignee: -> serhiy.storchaka components: +Interpreter Core nosy: +serhiy.storchaka priority: normal -> high stage: -> needs patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 11:31:17 2016 From: report at bugs.python.org (Eryk Sun) Date: Tue, 01 Mar 2016 16:31:17 +0000 Subject: [issue26464] str.translate() unexpectedly duplicates characters In-Reply-To: <1456840304.03.0.420145350869.issue26464@psf.upfronthosting.co.za> Message-ID: <1456849877.91.0.984298337253.issue26464@psf.upfronthosting.co.za> Eryk Sun added the comment: It duplicates translated characters as well. For example: >>> table = str.maketrans('mnopqrb', 'rqponm\u0100', 'a') >>> 'aaaaaamnopqrb'.translate(table) 'rqponmrqponm?' 3.4 returns the correct result: >>> table = str.maketrans('mnopqrb', 'rqponm\u0100', 'a') >>> 'aaaaaamnopqrb'.translate(table) 'rqponm?' The problem is the new fast path for one-to-one ASCII mapping (unicode_fast_translate in Objects/unicodeobject.c) doesn't have a way to return the current input position in order to resume processing the translation. _PyUnicode_TranslateCharmap assumes it's the same as the current writer position, which is wrong when input characters have been deleted. ---------- nosy: +eryksun title: str.translate() unexpectedly duplicates untranslated characters -> str.translate() unexpectedly duplicates characters _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 11:31:35 2016 From: report at bugs.python.org (Eryk Sun) Date: Tue, 01 Mar 2016 16:31:35 +0000 Subject: [issue26464] str.translate() unexpectedly duplicates characters In-Reply-To: <1456840304.03.0.420145350869.issue26464@psf.upfronthosting.co.za> Message-ID: <1456849895.0.0.5157269744.issue26464@psf.upfronthosting.co.za> Changes by Eryk Sun : ---------- versions: +Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 11:36:44 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 01 Mar 2016 16:36:44 +0000 Subject: [issue26464] str.translate() unexpectedly duplicates characters In-Reply-To: <1456840304.03.0.420145350869.issue26464@psf.upfronthosting.co.za> Message-ID: <1456850204.96.0.380637310449.issue26464@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- nosy: +haypo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 12:22:32 2016 From: report at bugs.python.org (Ned Deily) Date: Tue, 01 Mar 2016 17:22:32 +0000 Subject: [issue26465] Upgrade OpenSSL shipped with python installers In-Reply-To: <1456842373.05.0.727353806198.issue26465@psf.upfronthosting.co.za> Message-ID: <1456852952.19.0.736570069256.issue26465@psf.upfronthosting.co.za> Changes by Ned Deily : ---------- nosy: +ned.deily _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 13:05:27 2016 From: report at bugs.python.org (Alessandro Cucci) Date: Tue, 01 Mar 2016 18:05:27 +0000 Subject: [issue19475] Add timespec optional flag to datetime isoformat() to choose the precision In-Reply-To: <1383325521.57.0.024650274045.issue19475@psf.upfronthosting.co.za> Message-ID: <1456855527.44.0.556755626709.issue19475@psf.upfronthosting.co.za> Alessandro Cucci added the comment: @belopolsky could you please review one of the latest two patches submitted? I think I've done all required. Now I'll wait from you if I have to do more. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 14:10:44 2016 From: report at bugs.python.org (Michael Felt) Date: Tue, 01 Mar 2016 19:10:44 +0000 Subject: [issue26466] cannot build python 2.7.11 on AIX In-Reply-To: <1456844902.77.0.455974310535.issue26466@psf.upfronthosting.co.za> Message-ID: <1456859444.59.0.130276345773.issue26466@psf.upfronthosting.co.za> Michael Felt added the comment: the basic process I have used repeatedly (for calling ./configure) to package python, and many other things has not changed. Today, I repackaged version 2.7.10 (the file listed in 2.7.10.0) just to test the process I was using with 2.7.11 I learned that 2.7.10 does not build with the src and build seperated, while 2.7.11 supports having the src in a different directory (e.g., ../src/python-2.7.11) root at x064:[/data/prj/aixtools/python]find p* old -name \*.I -ls 44641791 48748 -rw-r--r-- 1 root system 49917952 Mar 1 12:59 python-2.7.10/installp/ppc/aixtools.python.2.7.10.0.aix537.I 102500359 48758 -rw-r--r-- 1 199 1954 49927680 Nov 3 15:00 python-2.7.10.0/installp/ppc/aixtools.python.2.7.10.0.aix537.I 102307460 46487 -rw-r--r-- 1 199 1954 47602688 Oct 31 17:14 old/python-2.7.8.2/installp/ppc/aixtools.prj.python.2.7.8.2.aix537.I 44377168 44107 -rwxrwxr-- 1 199 1954 45165056 Sep 26 2013 old/Python-2.7.3/installp/ppc/aixtools.Python.2.7.3.0.I 44433716 46063 -rw-r--r-- 1 199 1954 47168000 Apr 24 2015 old/python-2.7.8.1/installp/ppc/aixtools.prj.python.2.7.8.1.aix619.I 102373018 46360 -rw-r--r-- 1 199 1954 47472128 Nov 3 12:51 old/python-2.7.8.0/installp/ppc/aixtools.python.2.7.8.0.aix537.I FYI: aix537.I means the program was linked on AIX 5.3 TL7: aix619.I means AIX 6.1 TL9 That is one of the changes mentioned (in 2013 I packaged without a visual reminder of the system used, read - lowest level it would install on properly - e.g., as with python 2.7.3) Hence, my best guess is that something in the way ceval.c is now holding back the linking. If there is someone interested in reading the result I can provide the output of /usr/vac/exe/dis Python/ceval.o (disassembly of ceval.o). Or maybe someone has a better way of getting more specific error message than An RLD for section 2 (.data) refers to symbol 0, but the storage class of the symbol is not C_EXT or C_HIDEXT. i.e., I do not see how to recognize "symbol 0" (unless something in the .c file is defining something as NULL over and over again and I am blind to that as well.) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 14:16:45 2016 From: report at bugs.python.org (David Edelsohn) Date: Tue, 01 Mar 2016 19:16:45 +0000 Subject: [issue26466] cannot build python 2.7.11 on AIX In-Reply-To: <1456844902.77.0.455974310535.issue26466@psf.upfronthosting.co.za> Message-ID: <1456859805.94.0.298227252424.issue26466@psf.upfronthosting.co.za> David Edelsohn added the comment: It's not symbol with value 0, it's symbol number 0. You can list the symbols with the AIX "dump -t" command. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 14:20:57 2016 From: report at bugs.python.org (Alexander Belopolsky) Date: Tue, 01 Mar 2016 19:20:57 +0000 Subject: [issue19475] Add timespec optional flag to datetime isoformat() to choose the precision In-Reply-To: <1383325521.57.0.024650274045.issue19475@psf.upfronthosting.co.za> Message-ID: <1456860057.72.0.4874934865.issue19475@psf.upfronthosting.co.za> Changes by Alexander Belopolsky : ---------- stage: needs patch -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 14:46:12 2016 From: report at bugs.python.org (Moritz Sichert) Date: Tue, 01 Mar 2016 19:46:12 +0000 Subject: [issue24295] Backport of #17086 causes regression in setup.py In-Reply-To: <1432723014.0.0.831198232873.issue24295@psf.upfronthosting.co.za> Message-ID: <1456861572.2.0.846802057339.issue24295@psf.upfronthosting.co.za> Moritz Sichert added the comment: This is still an issue in Python 2.7.11. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 14:47:19 2016 From: report at bugs.python.org (SilentGhost) Date: Tue, 01 Mar 2016 19:47:19 +0000 Subject: [issue26452] Wrong line number attributed to comprehension expressions In-Reply-To: <1456640149.75.0.85936592027.issue26452@psf.upfronthosting.co.za> Message-ID: <1456861639.58.0.8877209458.issue26452@psf.upfronthosting.co.za> Changes by SilentGhost : ---------- nosy: +haypo, serhiy.storchaka versions: -Python 3.2, Python 3.3, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 14:54:12 2016 From: report at bugs.python.org (STINNER Victor) Date: Tue, 01 Mar 2016 19:54:12 +0000 Subject: [issue26464] str.translate() unexpectedly duplicates characters In-Reply-To: <1456840304.03.0.420145350869.issue26464@psf.upfronthosting.co.za> Message-ID: <1456862052.29.0.954936715313.issue26464@psf.upfronthosting.co.za> STINNER Victor added the comment: Oh... I see. It's a bug introduced by the optimization for ASCII replacing one character with another ASCII character or deleting a character: unicode_fast_translate(). See change cca6b056236a of issue #21118. There is a confusion in the code between input and ouput position. "i = writer.pos;" is used in the caller to continue when unicode_fast_translate() was interrupted (because a translation use a non-ASCII character or a string longer than 1 character), but writer.pos is the position in the *output* string, not in the *input* string :-/ I see that I added unit tests on translate, but it lacks an unit testing fast translation, starting with ignore and then switching to regular translation. Attached patch should fix the issue. It adds unit tests. ---------- keywords: +patch Added file: http://bugs.python.org/file42056/unicode_fast_translate.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 14:55:30 2016 From: report at bugs.python.org (STINNER Victor) Date: Tue, 01 Mar 2016 19:55:30 +0000 Subject: [issue26464] str.translate() unexpectedly duplicates characters In-Reply-To: <1456840304.03.0.420145350869.issue26464@psf.upfronthosting.co.za> Message-ID: <1456862130.3.0.402764986299.issue26464@psf.upfronthosting.co.za> STINNER Victor added the comment: > See change cca6b056236a of issue #21118. The bug was introduced in Python v3.5.0a1. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 15:11:22 2016 From: report at bugs.python.org (Alexander Belopolsky) Date: Tue, 01 Mar 2016 20:11:22 +0000 Subject: [issue19475] Add timespec optional flag to datetime isoformat() to choose the precision In-Reply-To: <1383325521.57.0.024650274045.issue19475@psf.upfronthosting.co.za> Message-ID: <1456863082.54.0.200745038224.issue19475@psf.upfronthosting.co.za> Alexander Belopolsky added the comment: Guido, Did you consider MAL's msg202274? I am still in favor of truncation, but would like to make sure we are not missing something that MAL knows from experience. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 15:17:14 2016 From: report at bugs.python.org (Maciej Fijalkowski) Date: Tue, 01 Mar 2016 20:17:14 +0000 Subject: [issue17580] ctypes: ARM hardfloat argument corruption calling functions with many float arguments In-Reply-To: <1364651250.44.0.538707073215.issue17580@psf.upfronthosting.co.za> Message-ID: <1456863434.07.0.836526190713.issue17580@psf.upfronthosting.co.za> Maciej Fijalkowski added the comment: Apparently you can't have an opinion from ctypes experts. Can you please commit the upstream fix that has been committed 3 years ago or just stop vendoring random, old, broken version of ctypes if you can't maintain it enough to pull fixes from upstream? ---------- nosy: +fijall _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 15:22:38 2016 From: report at bugs.python.org (Alexander Belopolsky) Date: Tue, 01 Mar 2016 20:22:38 +0000 Subject: [issue19475] Add timespec optional flag to datetime isoformat() to choose the precision In-Reply-To: <1383325521.57.0.024650274045.issue19475@psf.upfronthosting.co.za> Message-ID: <1456863758.36.0.457375794446.issue19475@psf.upfronthosting.co.za> Alexander Belopolsky added the comment: Another argument for truncation is that this is what GNU date does: $ date --iso-8601=seconds --date="2016-03-01 15:00:00.999" 2016-03-01T15:00:00-0500 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 15:24:47 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 01 Mar 2016 20:24:47 +0000 Subject: [issue26464] str.translate() unexpectedly duplicates characters In-Reply-To: <1456840304.03.0.420145350869.issue26464@psf.upfronthosting.co.za> Message-ID: <1456863887.39.0.565402811813.issue26464@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: LGTM. ---------- assignee: serhiy.storchaka -> haypo stage: needs patch -> commit review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 15:31:27 2016 From: report at bugs.python.org (Roundup Robot) Date: Tue, 01 Mar 2016 20:31:27 +0000 Subject: [issue26464] str.translate() unexpectedly duplicates characters In-Reply-To: <1456840304.03.0.420145350869.issue26464@psf.upfronthosting.co.za> Message-ID: <20160301203114.89270.45670@psf.io> Roundup Robot added the comment: New changeset 27ba9ba5deb1 by Victor Stinner in branch '3.5': Fix str.translate() https://hg.python.org/cpython/rev/27ba9ba5deb1 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 15:33:24 2016 From: report at bugs.python.org (STINNER Victor) Date: Tue, 01 Mar 2016 20:33:24 +0000 Subject: [issue26464] str.translate() unexpectedly duplicates characters In-Reply-To: <1456840304.03.0.420145350869.issue26464@psf.upfronthosting.co.za> Message-ID: <1456864404.88.0.78755768954.issue26464@psf.upfronthosting.co.za> STINNER Victor added the comment: > LGTM. Thanks for the review. I pushed my fix. Sorry for the regression, I hate being responsible of a regression in a core feature :-/ I may even deserve a release, but Python doesn't have the habit of "release often" yet :-( ---------- nosy: +larry priority: high -> release blocker resolution: -> fixed status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 16:08:10 2016 From: report at bugs.python.org (Roundup Robot) Date: Tue, 01 Mar 2016 21:08:10 +0000 Subject: [issue26464] str.translate() unexpectedly duplicates characters In-Reply-To: <1456840304.03.0.420145350869.issue26464@psf.upfronthosting.co.za> Message-ID: <20160301210807.20953.85816@psf.io> Roundup Robot added the comment: New changeset 6643c5cc9797 by Victor Stinner in branch '3.5': Issue #26464: Fix unicode_fast_translate() again https://hg.python.org/cpython/rev/6643c5cc9797 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 16:13:33 2016 From: report at bugs.python.org (Guido van Rossum) Date: Tue, 01 Mar 2016 21:13:33 +0000 Subject: [issue19475] Add timespec optional flag to datetime isoformat() to choose the precision In-Reply-To: <1383325521.57.0.024650274045.issue19475@psf.upfronthosting.co.za> Message-ID: <1456866813.08.0.0845345890816.issue19475@psf.upfronthosting.co.za> Guido van Rossum added the comment: Given that we're talking about what to do when we're suppressing the usecs I don't think roundtripping matters. :-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 16:16:26 2016 From: report at bugs.python.org (STINNER Victor) Date: Tue, 01 Mar 2016 21:16:26 +0000 Subject: [issue19475] Add timespec optional flag to datetime isoformat() to choose the precision In-Reply-To: <1383325521.57.0.024650274045.issue19475@psf.upfronthosting.co.za> Message-ID: <1456866986.87.0.718964296588.issue19475@psf.upfronthosting.co.za> STINNER Victor added the comment: > Given that we're talking about what to do when we're suppressing the usecs I don't think roundtripping matters. :-) I changed many times how Python rounds nanoseconds in the private PyTime API, and I got a bug report because of that! => issue #23517. By the way, I wrote an article to explain the history the private PyTime API, especially changes on rounding ;-) https://haypo.github.io/pytime.html ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 16:23:45 2016 From: report at bugs.python.org (Daniel Shaulov) Date: Tue, 01 Mar 2016 21:23:45 +0000 Subject: [issue26271] freeze.py makefile uses the wrong flags variables In-Reply-To: <1454454135.77.0.499921177416.issue26271@psf.upfronthosting.co.za> Message-ID: <1456867425.58.0.633909566867.issue26271@psf.upfronthosting.co.za> Daniel Shaulov added the comment: Pinging after a month without review (as the devguide suggests). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 16:25:41 2016 From: report at bugs.python.org (Julien) Date: Tue, 01 Mar 2016 21:25:41 +0000 Subject: [issue26462] Patch to enhance literal block language declaration In-Reply-To: <1456790330.71.0.936150839602.issue26462@psf.upfronthosting.co.za> Message-ID: <1456867541.25.0.286278042811.issue26462@psf.upfronthosting.co.za> Julien added the comment: I revewed all my ".. code-block:: bash" and you're right (I was unaware of the existence of the "console" lexer). I changed them (reviewing them one by one) to ".. code-block:: shell-session", a synonym for ".. code-block:: console" (http://pygments.org/docs/lexers/?highlight=console#pygments.lexers.shell.BashSessionLexer) which I find, in a Python context, semantically more precise, and less ambigious, as one may read "console" as "the repl" (I assume most writers of the doc are aware of commonly used pygment lexers, it's still better for newcomers to be explicit and readable). For your other point, about pycon being automatically detected, I tried removeing them and it works, I was sure I was adding them only where the python3 parser was reporting an error (was fixing errors one by one). I keeped the explicit pycon lexer in the "Doc/extending/extending.rst" file which have a ".. highlightlang:: c". Here is the new patch, and thanks for this usefull review ! ---------- Added file: http://bugs.python.org/file42057/literal_blocks_languages.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 16:32:29 2016 From: report at bugs.python.org (Guido van Rossum) Date: Tue, 01 Mar 2016 21:32:29 +0000 Subject: [issue19475] Add timespec optional flag to datetime isoformat() to choose the precision In-Reply-To: <1383325521.57.0.024650274045.issue19475@psf.upfronthosting.co.za> Message-ID: <1456867949.35.0.567752334107.issue19475@psf.upfronthosting.co.za> Guido van Rossum added the comment: But what should we do in your opinion? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 16:35:47 2016 From: report at bugs.python.org (Alexander Belopolsky) Date: Tue, 01 Mar 2016 21:35:47 +0000 Subject: [issue19475] Add timespec optional flag to datetime isoformat() to choose the precision In-Reply-To: <1383325521.57.0.024650274045.issue19475@psf.upfronthosting.co.za> Message-ID: <1456868147.03.0.641670124104.issue19475@psf.upfronthosting.co.za> Alexander Belopolsky added the comment: I hope my prediction "I am afraid that the rounding issues may kill this proposal" (see msg202276) will not come true. I think the correct way to view "timespec" is a way to suppress/enforce printing of trailing digits. Users that choose printing less than full usec format should make sure that their datetime instances are properly rounded before printing. Unfortunately, I does not look like the datetime module makes rounding easy. The best I can think of is something like def round_datetime(dt, delta): dt0 = datetime.combine(dt.date(), time(0)) return dt0 + round((dt - dt0) / delta) * delta Maybe a datetime.round() method along these lines will be a worthwhile addition? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 16:38:45 2016 From: report at bugs.python.org (Zachary Ware) Date: Tue, 01 Mar 2016 21:38:45 +0000 Subject: [issue26462] Patch to enhance literal block language declaration In-Reply-To: <1456790330.71.0.936150839602.issue26462@psf.upfronthosting.co.za> Message-ID: <1456868325.85.0.860116862352.issue26462@psf.upfronthosting.co.za> Zachary Ware added the comment: Attaching regenerated patch to coax Rietveld into accepting it for easier review. ---------- nosy: +zach.ware Added file: http://bugs.python.org/file42058/issue26462_regen.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 16:47:08 2016 From: report at bugs.python.org (STINNER Victor) Date: Tue, 01 Mar 2016 21:47:08 +0000 Subject: [issue19475] Add timespec optional flag to datetime isoformat() to choose the precision In-Reply-To: <1383325521.57.0.024650274045.issue19475@psf.upfronthosting.co.za> Message-ID: <1456868828.04.0.881651006597.issue19475@psf.upfronthosting.co.za> STINNER Victor added the comment: > But what should we do in your opinion? Use ROUND_FLOOR rounding method. time.time(), datetime.datetime.now(), etc. round the current time using the ROUND_FLOOR rounding method. Only datetime.datetime.fromtimestamp() uses ROUND_HALF_EVEN, but it's more an exception than the rule: this function uses a float as input. To be consistent, we must use the same rounding method than other Python functions taking float as parameter, like round(), so use ROUND_HALF_EVEN. So I suggest to also use ROUND_FLOOR for .isoformat(). Hopefully, we don't have to discuss about the exact rounding method for negative numbers, since the minimum datetime object is datetime.datetime(1, 1, 1) which is "positive" ;-) You have a similar rounding question for file timestamps. Depending on the file system, you may have a resolution of 2 seconds (FAT), 1 second (ext3) or 1 nanosecond (ext4). But Linux syscalls accept subsecond resolution. The Linux kernel uses ROUND_FLOOR rounding method if I recall correctly. I guess that it's a requirement for makefiles. If you already experimented a system clock slew, you may understand me :-) > For full seconds, truncation will add an error of +/- 1 second, > whereas rounding only adds +/- 0.5 seconds. This is what convinced > me to use rounding instead of truncation. What is truncation? Is it the ROUND_FLOOR (towards -inf) rounding method? Like math.floor(float). Python int(float) uses ROUND_DOWN (towards zero) which is different than ROUND_FLOOR, but only different for negative numbers. int(-0.9) returns 0, whereas math.floor(-0.9) returns -1. I guess that "rounding" means ROUND_HALF_EVEN here? The funny "Round to nearest with ties going to nearest even integer" rounding method. Like round(float). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 16:48:07 2016 From: report at bugs.python.org (Guido van Rossum) Date: Tue, 01 Mar 2016 21:48:07 +0000 Subject: [issue19475] Add timespec optional flag to datetime isoformat() to choose the precision In-Reply-To: <1383325521.57.0.024650274045.issue19475@psf.upfronthosting.co.za> Message-ID: <1456868887.46.0.837942668339.issue19475@psf.upfronthosting.co.za> Guido van Rossum added the comment: Except for the case where you're closer than half a usec from the next value, IMO rounding makes no sense when suppressing digits. I most definitely would never want 9:59:59 to be rounded to 10:00 when suppressing seconds. If you really think there are use cases for that you could add a 'round=True' flag (as long as it defaults to False). That seems better than supporting rounding on datetime objects themselves. But I think you're just speculating. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 16:50:55 2016 From: report at bugs.python.org (Guido van Rossum) Date: Tue, 01 Mar 2016 21:50:55 +0000 Subject: [issue19475] Add timespec optional flag to datetime isoformat() to choose the precision In-Reply-To: <1383325521.57.0.024650274045.issue19475@psf.upfronthosting.co.za> Message-ID: <1456869055.41.0.574359296136.issue19475@psf.upfronthosting.co.za> Guido van Rossum added the comment: IIUC truncation traditionally means "towards zero" -- that's why we have separate "floor" and "ceiling" operations meaning "towards [negative] infinity". Fortunately we shouldn't have to deal with negative values here so floor and truncate mean the same thing. Agreed that isoformat() should also truncate. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 16:52:02 2016 From: report at bugs.python.org (STINNER Victor) Date: Tue, 01 Mar 2016 21:52:02 +0000 Subject: [issue19475] Add timespec optional flag to datetime isoformat() to choose the precision In-Reply-To: <1383325521.57.0.024650274045.issue19475@psf.upfronthosting.co.za> Message-ID: <1456869122.95.0.506643040615.issue19475@psf.upfronthosting.co.za> STINNER Victor added the comment: > Maybe a datetime.round() method along these lines will be a worthwhile addition? Sorry, what is the use case of this method? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 17:00:34 2016 From: report at bugs.python.org (Alexander Belopolsky) Date: Tue, 01 Mar 2016 22:00:34 +0000 Subject: [issue19475] Add timespec optional flag to datetime isoformat() to choose the precision In-Reply-To: <1383325521.57.0.024650274045.issue19475@psf.upfronthosting.co.za> Message-ID: <1456869634.93.0.572270754393.issue19475@psf.upfronthosting.co.za> Alexander Belopolsky added the comment: Personally, I don't rounding is that useful. My working assumption is that users will select say timespec='millisecond' only when they know that their time source produces datetime instances with millisecond precision and they don't want to kill more trees by printing redundant 0's. MAL's objection this this line of arguments was that some time sources have odd resolution (he reported MS SQL's use of 333 ms) and a user may want to have a perfect round-tripping when using a sub-usec timespec and such an odd time source or destination. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 17:06:38 2016 From: report at bugs.python.org (STINNER Victor) Date: Tue, 01 Mar 2016 22:06:38 +0000 Subject: [issue19475] Add timespec optional flag to datetime isoformat() to choose the precision In-Reply-To: <1383325521.57.0.024650274045.issue19475@psf.upfronthosting.co.za> Message-ID: <1456869998.38.0.176932964329.issue19475@psf.upfronthosting.co.za> STINNER Victor added the comment: > Personally, I don't rounding is that useful. Nice, it looks like I agree with you on using ROUNDING_FLOOR :-) I don't think that we should be prepared for theorical user requests, but rather focus on the concrete and well defined current existing user request: "Add timespec optional flag to datetime isoformat() to choose the precision". Let's wait until users request a datetime.round() method to understand better concrete issues. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 17:09:32 2016 From: report at bugs.python.org (Alexander Belopolsky) Date: Tue, 01 Mar 2016 22:09:32 +0000 Subject: [issue19475] Add timespec optional flag to datetime isoformat() to choose the precision In-Reply-To: <1383325521.57.0.024650274045.issue19475@psf.upfronthosting.co.za> Message-ID: <1456870172.45.0.92886308143.issue19475@psf.upfronthosting.co.za> Alexander Belopolsky added the comment: I feel odd trying to advocate a POV that I disagree with, so let me just quote MAL: """ In practice you often don't know the resolution of the timing source. Nowadays, the reverse of what you said is usually true: the source resolution is higher than the precision you use to print it. .. For full seconds, truncation will add an error of +/- 1 second, whereas rounding only adds +/- 0.5 seconds. This is what convinced me to use rounding instead of truncation. """ I somehow missed this argument when Marc-Andre made it, so I want to make sure that it is properly considered before we finalize this issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 17:15:37 2016 From: report at bugs.python.org (STINNER Victor) Date: Tue, 01 Mar 2016 22:15:37 +0000 Subject: [issue17580] ctypes: ARM hardfloat argument corruption calling functions with many float arguments In-Reply-To: <1364651250.44.0.538707073215.issue17580@psf.upfronthosting.co.za> Message-ID: <1456870537.93.0.8363661345.issue17580@psf.upfronthosting.co.za> STINNER Victor added the comment: To me, it doesn't make sense to maintain a downstream "fork" of libffi. I would prefer to "simply" upgrade to a more recent version of libffi in CPython. But I don't know why we have a downstream version. What was patched? Does anyone know anything about it? I understood that Linux packages configure with ./configure --with-system-libffi to reuse the system libffi.so. Who uses the downstream version? Windows? OS X? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 17:20:14 2016 From: report at bugs.python.org (STINNER Victor) Date: Tue, 01 Mar 2016 22:20:14 +0000 Subject: [issue17580] ctypes: ARM hardfloat argument corruption calling functions with many float arguments In-Reply-To: <1364651250.44.0.538707073215.issue17580@psf.upfronthosting.co.za> Message-ID: <1456870814.04.0.0667079883961.issue17580@psf.upfronthosting.co.za> STINNER Victor added the comment: David Schneider: "A patch for this issue has been accepted into libffi." fijal: "Can you please commit the upstream fix that has been committed 3 years ago (...)" Which patch? Attached tar archive doesn't look like a patch and I see no reference to a fix. Previous libffi upgrade: --- changeset: 92061:4331fa01398e branch: 2.7 parent: 92058:928135d0fa7d user: doko at ubuntu.com date: Sun Aug 10 11:15:28 2014 +0200 files: Misc/NEWS Modules/_ctypes/libffi.diff Modules/_ctypes/libffi/.gitignore Modules/_ctypes/libffi/.travis.yml Modules/_ctypes/libffi/ChangeLog Modules/_ctypes/libffi/Change description: - Issue #22176: Update the ctypes module's libffi to v3.1. This release adds support for the Linux AArch64 and POWERPC ELF ABIv2 little endian architectures. --- This upgrade was made in august 2014, this issue was reported in march 2013. The upgrade didn't add the mentioned fix? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 17:20:27 2016 From: report at bugs.python.org (STINNER Victor) Date: Tue, 01 Mar 2016 22:20:27 +0000 Subject: [issue17580] ctypes: ARM hardfloat argument corruption calling functions with many float arguments In-Reply-To: <1364651250.44.0.538707073215.issue17580@psf.upfronthosting.co.za> Message-ID: <1456870827.69.0.944106882568.issue17580@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- nosy: +doko _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 17:27:25 2016 From: report at bugs.python.org (Maciej Fijalkowski) Date: Tue, 01 Mar 2016 22:27:25 +0000 Subject: [issue17580] ctypes: ARM hardfloat argument corruption calling functions with many float arguments In-Reply-To: <1364651250.44.0.538707073215.issue17580@psf.upfronthosting.co.za> Message-ID: <1456871245.6.0.334037595681.issue17580@psf.upfronthosting.co.za> Maciej Fijalkowski added the comment: Then maybe it's fixed, I have no idea ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 17:27:44 2016 From: report at bugs.python.org (Maciej Fijalkowski) Date: Tue, 01 Mar 2016 22:27:44 +0000 Subject: [issue17580] ctypes: ARM hardfloat argument corruption calling functions with many float arguments In-Reply-To: <1364651250.44.0.538707073215.issue17580@psf.upfronthosting.co.za> Message-ID: <1456871264.16.0.301068952038.issue17580@psf.upfronthosting.co.za> Maciej Fijalkowski added the comment: The easiest way to check is to run the tests attached ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 17:50:40 2016 From: report at bugs.python.org (Brett Cannon) Date: Tue, 01 Mar 2016 22:50:40 +0000 Subject: [issue26446] Mention in the devguide that core dev stuff falls under the PSF CoC In-Reply-To: <1456514667.83.0.674412678031.issue26446@psf.upfronthosting.co.za> Message-ID: <1456872640.54.0.843264870946.issue26446@psf.upfronthosting.co.za> Brett Cannon added the comment: The discussion seems to have gone in the direction of putting all core-controlled stuff under the CoC. So the devguide will mention this is the policy. ---------- title: Mention in the devguide that core devs are expected to follow the PSF CoC -> Mention in the devguide that core dev stuff falls under the PSF CoC _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 17:51:46 2016 From: report at bugs.python.org (Brett Cannon) Date: Tue, 01 Mar 2016 22:51:46 +0000 Subject: [issue26467] Add async magic method support to unittest.mock.Mock Message-ID: <1456872706.59.0.97059255221.issue26467@psf.upfronthosting.co.za> New submission from Brett Cannon: Mock doesn't support stuff like __aexit__ which means you can't mock out something like an async context manager. ---------- components: Library (Lib) messages: 261092 nosy: brett.cannon, michael.foord priority: normal severity: normal stage: test needed status: open title: Add async magic method support to unittest.mock.Mock type: enhancement versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 19:12:20 2016 From: report at bugs.python.org (Alex Willmer) Date: Wed, 02 Mar 2016 00:12:20 +0000 Subject: [issue23670] Modifications to support iOS as a cross-compilation target In-Reply-To: <1426400747.11.0.0527548590348.issue23670@psf.upfronthosting.co.za> Message-ID: <1456877540.14.0.385197939408.issue23670@psf.upfronthosting.co.za> Alex Willmer added the comment: I've done my best to rebase Freakboy's patch onto 3.6-dev. The attached applies cleanly, but the testsuite goes into an infinite loop. It's a start at least. At a guess the problem is in Lib/test/libregrtest/ or Lib/test/regrtest.py where the patch changes sys.exit() calls to return statements. I took the liberty of filtering out whitespace & other cosmetic changes that were in 20151221.diff. ---------- nosy: +Alex.Willmer Added file: http://bugs.python.org/file42059/20160301-brokentests.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 19:22:30 2016 From: report at bugs.python.org (Alex Willmer) Date: Wed, 02 Mar 2016 00:22:30 +0000 Subject: [issue26443] cross building extensions picks up host headers In-Reply-To: <1456499973.95.0.823052816124.issue26443@psf.upfronthosting.co.za> Message-ID: <1456878150.39.0.890899181227.issue26443@psf.upfronthosting.co.za> Changes by Alex Willmer : ---------- nosy: +Alex.Willmer _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 19:25:13 2016 From: report at bugs.python.org (Alex Willmer) Date: Wed, 02 Mar 2016 00:25:13 +0000 Subject: =?utf-8?q?=5Bissue22625=5D_When_cross-compiling=2C_don=E2=80=99t_try_to_e?= =?utf-8?q?xecute_binaries?= In-Reply-To: <1413226219.68.0.732560661241.issue22625@psf.upfronthosting.co.za> Message-ID: <1456878313.37.0.242957122225.issue22625@psf.upfronthosting.co.za> Changes by Alex Willmer : ---------- nosy: +Alex.Willmer _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 19:25:42 2016 From: report at bugs.python.org (Alex Willmer) Date: Wed, 02 Mar 2016 00:25:42 +0000 Subject: [issue22699] cross-compilation of Python3.4 In-Reply-To: <1413992946.14.0.956103683321.issue22699@psf.upfronthosting.co.za> Message-ID: <1456878342.08.0.833160761511.issue22699@psf.upfronthosting.co.za> Changes by Alex Willmer : ---------- nosy: +Alex.Willmer _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 19:27:35 2016 From: report at bugs.python.org (Alex Willmer) Date: Wed, 02 Mar 2016 00:27:35 +0000 Subject: [issue22654] issue with PYTHON_FOR_BUILD In-Reply-To: <1413493795.91.0.752363282337.issue22654@psf.upfronthosting.co.za> Message-ID: <1456878455.9.0.647098085012.issue22654@psf.upfronthosting.co.za> Changes by Alex Willmer : ---------- nosy: +Alex.Willmer _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 19:33:17 2016 From: report at bugs.python.org (Alex Willmer) Date: Wed, 02 Mar 2016 00:33:17 +0000 Subject: [issue26443] cross building extensions picks up host headers In-Reply-To: <1456499973.95.0.823052816124.issue26443@psf.upfronthosting.co.za> Message-ID: <1456878797.75.0.765488050924.issue26443@psf.upfronthosting.co.za> Alex Willmer added the comment: This looks like a duplicate of #20211, and IMO the patch there is more correct. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 20:36:55 2016 From: report at bugs.python.org (Russell Keith-Magee) Date: Wed, 02 Mar 2016 01:36:55 +0000 Subject: [issue23670] Modifications to support iOS as a cross-compilation target In-Reply-To: <1426400747.11.0.0527548590348.issue23670@psf.upfronthosting.co.za> Message-ID: <1456882615.71.0.567009958144.issue23670@psf.upfronthosting.co.za> Russell Keith-Magee added the comment: Alex - The usual cause for that problem isn't regrtest (at least, not directly). The cause is one of the tests in the suite spawning a subprocess. Due to the way the test harness works, when the test suite forks/spawns a subprocess (e.g., to run a network server or a multiprocess worker), the fork causes the a second version of the test suite to start, rather than starting the server subprocess. I've attached a patch for 3.5.1. This includes a patch to work around Issue22625; the patch is definitely suboptimal, but it lets a build come to completion. What is really needed (as requested on python-dev) is some help working out how to fix Issue22625 properly. ---------- versions: +Python 3.5 Added file: http://bugs.python.org/file42060/20160217.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 01:11:22 2016 From: report at bugs.python.org (Berker Peksag) Date: Wed, 02 Mar 2016 06:11:22 +0000 Subject: [issue17580] ctypes: ARM hardfloat argument corruption calling functions with many float arguments In-Reply-To: <1364651250.44.0.538707073215.issue17580@psf.upfronthosting.co.za> Message-ID: <1456899082.6.0.155380329325.issue17580@psf.upfronthosting.co.za> Berker Peksag added the comment: > Which patch? Looks like the patch can be found at https://github.com/atgreen/libffi/pull/34/ and it has been released in libffi 3.1: https://github.com/atgreen/libffi/blob/17ffc3655a531c116e9eb9cc933e50bb1e5c47f8/ChangeLog.libffi-3.1#L481 (It's hard to share a specific commit since libffi's history is not linear.) The patch also has been merged into CPython's fork in 0fef0afb9d19 (Update the ctypes module's libffi to v3.1): * https://github.com/python/cpython/blob/master/Modules/_ctypes/libffi/src/arm/ffi.c#L43 * https://github.com/python/cpython/blob/master/Modules/_ctypes/libffi/src/arm/ffi.c#L128 I don't have an ARM system to run David's reproducer (thanks for your report and for the test script, by the way!), but I think we can safely assume that this has already been fixed. ---------- nosy: +berker.peksag resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 01:21:51 2016 From: report at bugs.python.org (Georg Brandl) Date: Wed, 02 Mar 2016 06:21:51 +0000 Subject: [issue26462] Patch to enhance literal block language declaration In-Reply-To: <1456790330.71.0.936150839602.issue26462@psf.upfronthosting.co.za> Message-ID: <1456899711.49.0.775220414171.issue26462@psf.upfronthosting.co.za> Georg Brandl added the comment: Looks good now! I left a few comments on Rietveld. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 02:04:32 2016 From: report at bugs.python.org (Georg Brandl) Date: Wed, 02 Mar 2016 07:04:32 +0000 Subject: [issue23921] Standardize documentation whitespace, formatting In-Reply-To: <1428814739.03.0.523944029114.issue23921@psf.upfronthosting.co.za> Message-ID: <1456902272.86.0.311419852047.issue23921@psf.upfronthosting.co.za> Georg Brandl added the comment: I had no idea we had so many cases of wonky indentation :) This looks good to me, apart from a few comments I left on rietveld. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 03:19:18 2016 From: report at bugs.python.org (Michael Felt) Date: Wed, 02 Mar 2016 08:19:18 +0000 Subject: [issue26466] cannot build python 2.7.11 on AIX In-Reply-To: <1456844902.77.0.455974310535.issue26466@psf.upfronthosting.co.za> Message-ID: <1456906758.82.0.589385979583.issue26466@psf.upfronthosting.co.za> Michael Felt added the comment: At first I thought it might be a 0x0001 rather than 0x0003 (as I have no idea what the additional info is AND that the lines starting with [0] are the Symbol 0 (zero) you indicate the message. Also thought it might have been the double listing of some symbols where both the 'm' and the 'a4' lines start with 0x00000000 (but see those for other .o files as well) And I verified that the .o file (outside the archive) also has '[705]' entries. Need more guidance. I get neither heads nor tails... So, dump -t libpython2.7.a snips: libpython2.7.a[getbuildinfo.o]: ***Symbol Table Information*** [Index] m Value Scn Aux Sclass Type Name [Index] a0 Fname [Index] a1 Tagndx Lnno Size Lnoptr Endndx [Index] a2 Tagndx Fsiz Lnoptr Endndx [Index] a3 Tagndx Lnno Size Dimensions [Index] a4 CSlen PARMhsh SNhash SMtype SMclass Stab SNstab [Index] a5 SECTlen #RELent #LINnums [0] m 0x00000000 -2 3 0x67 0x0003 .file [1] a0 ../src/python-2.7.11/Modules/getbuildinfo.c [2] a0 Tue Mar 1 18:47:41 2016 [3] a0 IBM XL C for AIX, Version 11.1.0.20 [4] m 0x00000000 1 1 0x03 0x0000 .text [5] a5 0x00000180 0x000b 0x0000 [6] m 0x00000180 2 1 0x03 0x0000 .data [7] a5 0x000000c4 0x000e 0x0000 [8] m 0x00000244 3 1 0x03 0x0000 .bss [9] a5 0x00000034 0x0000 0x0000 [10] m 0x00000000 1 1 0x6b 0x0000 **No Symbol** [11] a4 0x00000180 0 0 57 0 0 0 [12] m 0x00000000 1 1 0x02 0x0020 ._Py_hgversion [13] a4 0x0000000a 0 0 2 0 0 0 [14] m 0x00000020 1 1 0x02 0x0020 ._Py_hgidentifier [15] a4 0x0000000a 0 0 2 0 0 0 [16] m 0x00000040 1 1 0x02 0x0020 ._Py_svnversion [17] a4 0x0000000a 0 0 2 0 0 0 [18] m 0x00000060 1 1 0x02 0x0020 .Py_GetBuildInfo [19] a4 0x0000000a 0 0 2 0 0 0 [20] m 0x00000180 2 1 0x6b 0x0000 TOC [21] a4 0x00000000 0 0 17 15 0 0 [22] m 0x00000184 2 1 0x6b 0x0000 **No Symbol** [23] a4 0x00000004 0 0 17 3 0 0 [24] m 0x000001c8 2 1 0x6b 0x0000 **No Symbol** [25] a4 0x00000079 0 0 33 1 0 0 [26] m 0x00000244 3 1 0x6b 0x0000 _$STATIC_BSS [27] a4 0x00000034 0 0 35 5 0 0 [28] m 0x00000194 2 1 0x6b 0x0000 _$STATIC_BSS [29] a4 0x00000004 0 0 17 3 0 0 [30] m 0x00000198 2 1 0x02 0x0000 _Py_hgversion [31] a4 0x0000000c 0 0 17 10 0 0 [32] m 0x00000180 2 1 0x6b 0x0000 _Py_hgversion [33] a4 0x00000004 0 0 17 3 0 0 [34] m 0x000001a4 2 1 0x02 0x0000 _Py_hgidentifier [35] a4 0x0000000c 0 0 17 10 0 0 [36] m 0x00000188 2 1 0x6b 0x0000 _Py_hgidentifier [37] a4 0x00000004 0 0 17 3 0 0 [38] m 0x000001b0 2 1 0x02 0x0000 _Py_svnversion [39] a4 0x0000000c 0 0 17 10 0 0 [40] m 0x0000018c 2 1 0x6b 0x0000 _Py_svnversion [41] a4 0x00000004 0 0 17 3 0 0 [42] m 0x000001bc 2 1 0x02 0x0000 Py_GetBuildInfo [43] a4 0x0000000c 0 0 17 10 0 0 [44] m 0x00000190 2 1 0x6b 0x0000 Py_GetBuildInfo [45] a4 0x00000004 0 0 17 3 0 0 [46] m 0x00000000 0 1 0x02 0x0000 .PyOS_snprintf [47] a4 0x00000000 0 0 0 0 0 0 libpython2.7.a[acceler.o]: ***Symbol Table Information*** [Index] m Value Scn Aux Sclass Type Name [Index] a0 Fname [Index] a1 Tagndx Lnno Size Lnoptr Endndx [Index] a2 Tagndx Fsiz Lnoptr Endndx [Index] a3 Tagndx Lnno Size Dimensions [Index] a4 CSlen PARMhsh SNhash SMtype SMclass Stab SNstab [Index] a5 SECTlen #RELent #LINnums [0] m 0x00000000 -2 3 0x67 0x0001 .file [1] a0 ../src/python-2.7.11/Parser/acceler.c [2] a0 Tue Mar 1 15:58:27 2016 [3] a0 IBM XL C for AIX, Version 11.1.0.21 [4] m 0x00000000 1 1 0x03 0x0000 .text [5] a5 0x00000700 0x0011 0x0000 [6] m 0x00000700 2 1 0x03 0x0000 .data [7] a5 0x000000c8 0x0008 0x0000 [8] m 0x000007c8 3 1 0x03 0x0000 .bss [9] a5 0x00000000 0x0000 0x0000 [10] m 0x00000000 1 1 0x6b 0x0000 **No Symbol** [11] a4 0x00000700 0 0 57 0 0 0 [12] m 0x00000000 1 1 0x6b 0x0020 .fixstate [13] a4 0x0000000a 0 0 2 0 0 0 [14] m 0x000003c0 1 1 0x6b 0x0020 .fixdfa [15] a4 0x0000000a 0 0 2 0 0 0 [16] m 0x00000480 1 1 0x02 0x0020 .PyGrammar_RemoveAccelerators ... libpython2.7.a[ceval.o]: ***Symbol Table Information*** [Index] m Value Scn Aux Sclass Type Name [Index] a0 Fname [Index] a1 Tagndx Lnno Size Lnoptr Endndx [Index] a2 Tagndx Fsiz Lnoptr Endndx [Index] a3 Tagndx Lnno Size Dimensions [Index] a4 CSlen PARMhsh SNhash SMtype SMclass Stab SNstab [Index] a5 SECTlen #RELent #LINnums [0] m 0x00000000 -2 3 0x67 0x0001 .file [1] a0 ../src/python-2.7.11/Python/ceval.c [2] a0 Tue Mar 1 18:47:25 2016 [3] a0 IBM XL C for AIX, Version 11.1.0.20 [4] m 0x00000000 1 1 0x03 0x0000 .text [5] a5 0x0000f080 0x0314 0x0000 [6] m 0x0000f080 2 1 0x03 0x0000 .data [7] a5 0x00001768 0x02a0 0x0000 [8] m 0x000107e8 3 1 0x03 0x0000 .bss [9] a5 0x00000110 0x0000 0x0000 [10] m 0x00000000 1 1 0x6b 0x0000 **No Symbol** [11] a4 0x0000f080 0 0 57 0 0 0 [12] m 0x00000000 1 1 0x6b 0x0020 .err_args [13] a4 0x0000000a 0 0 2 0 0 0 [14] m 0x00000080 1 1 0x6b 0x0020 .unpack_iterable [15] a4 0x0000000a 0 0 2 0 0 0 [16] m 0x000003e0 1 1 0x6b 0x0020 .do_raise [17] a4 0x0000000a 0 0 2 0 0 0 [18] m 0x00000980 1 1 0x6b 0x0020 .special_lookup [19] a4 0x0000000a 0 0 2 0 0 0 [20] m 0x00000aa0 1 1 0x6b 0x0020 .kwd_as_string [21] a4 0x0000000a 0 0 2 0 0 0 [22] m 0x00000b00 1 1 0x6b 0x0020 .string_concatenate ... [133] a4 0x0000000a 0 0 2 0 0 0 [134] m 0x0000ee80 1 1 0x6b 0x0020 .kwd_as_string at AF71_5 [135] a4 0x0000000a 0 0 2 0 0 0 [136] m 0x0000eee0 1 1 0x6b 0x0020 ._PyEval_SliceIndex at AF72_31 [137] a4 0x0000000a 0 0 2 0 0 0 [138] m 0x0000f000 1 1 0x6b 0x0020 .format_exc_check_arg at AF73_7 [139] a4 0x0000000a 0 0 2 0 0 0 [140] m 0x0000f080 2 1 0x6b 0x0000 TOC [141] a4 0x00000000 0 0 17 15 0 0 [142] m 0x0000f084 2 1 0x6b 0x0000 **No Symbol** [143] a4 0x00000004 0 0 17 3 0 0 [144] m 0x0000fd4c 2 1 0x6b 0x0000 **No Symbol** [145] a4 0x00000a9c 0 0 33 1 0 0 [146] m 0x0000f340 2 1 0x6b 0x0000 _$STATIC [147] a4 0x00000a0c 0 0 33 5 0 0 [148] m 0x0000f0f0 2 1 0x6b 0x0000 _$STATIC [149] a4 0x00000004 0 0 17 3 0 0 [150] m 0x000107e8 3 1 0x6b 0x0000 _$STATIC_BSS [151] a4 0x00000110 0 0 35 5 0 0 [152] m 0x0000f140 2 1 0x6b 0x0000 _$STATIC_BSS [153] a4 0x00000004 0 0 17 3 0 0 [154] m 0x00000000 0 1 0x02 0x0000 PyExc_TypeError [155] a4 0x00000000 0 0 0 4 0 0 [156] m 0x0000f080 2 1 0x6b 0x0000 PyExc_TypeError [157] a4 0x00000004 0 0 17 3 0 0 [158] m 0x00000000 0 1 0x02 0x0000 PyExc_ValueError [159] a4 0x00000000 0 0 0 4 0 0 [160] m 0x0000f088 2 1 0x6b 0x0000 PyExc_ValueError [161] a4 0x00000004 0 0 17 3 0 0 [162] m 0x00000000 0 1 0x02 0x0000 _PyThreadState_Current [163] a4 0x00000000 0 0 0 4 0 0 [164] m 0x0000f08c 2 1 0x6b 0x0000 _PyThreadState_Current [165] a4 0x00000004 0 0 17 3 0 0 [166] m 0x00000000 0 1 0x02 0x0000 _Py_NoneStruct [167] a4 0x00000000 0 0 0 4 0 0 [168] m 0x0000f090 2 1 0x6b 0x0000 _Py_NoneStruct [169] a4 0x00000004 0 0 17 3 0 0 [170] m 0x00000000 0 1 0x02 0x0000 PyClass_Type [171] a4 0x00000000 0 0 0 4 0 0 [172] m 0x0000f094 2 1 0x6b 0x0000 PyClass_Type [173] a4 0x00000004 0 0 17 3 0 0 [174] m 0x00000000 0 1 0x02 0x0000 PyInstance_Type [175] a4 0x00000000 0 0 0 4 0 0 [176] m 0x0000f098 2 1 0x6b 0x0000 PyInstance_Type ... [238] m 0x00000000 0 1 0x02 0x0000 PyFunction_Type [239] a4 0x00000000 0 0 0 4 0 0 [240] m 0x0000f0d8 2 1 0x6b 0x0000 PyFunction_Type [241] a4 0x00000004 0 0 17 3 0 0 [242] m 0x0000f1a8 2 1 0x02 0x0000 _PyEval_CallTracing [243] a4 0x0000000c 0 0 17 10 0 0 [244] m 0x0000f0dc 2 1 0x6b 0x0000 _PyEval_CallTracing [245] a4 0x00000004 0 0 17 3 0 0 [246] m 0x0000f1b4 2 1 0x02 0x0000 PyEval_EvalCodeEx [247] a4 0x0000000c 0 0 17 10 0 0 [248] m 0x0000f0e0 2 1 0x6b 0x0000 PyEval_EvalCodeEx [249] a4 0x00000004 0 0 17 3 0 0 [250] m 0x0000f1c0 2 1 0x02 0x0000 PyEval_EvalCode [251] a4 0x0000000c 0 0 17 10 0 0 [252] m 0x0000f0e4 2 1 0x6b 0x0000 PyEval_EvalCode [253] a4 0x00000004 0 0 17 3 0 0 ... [406] m 0x0000f2e0 2 1 0x02 0x0000 PyEval_GetFrame [407] a4 0x0000000c 0 0 17 10 0 0 [408] m 0x0000f188 2 1 0x6b 0x0000 PyEval_GetFrame [409] a4 0x00000004 0 0 17 3 0 0 [410] m 0x00000000 0 1 0x02 0x0000 _PyThreadState_GetFrame [411] a4 0x00000000 0 0 0 4 0 0 [412] m 0x0000f18c 2 1 0x6b 0x0000 _PyThreadState_GetFrame [413] a4 0x00000004 0 0 17 3 0 0 [414] m 0x0000f2ec 2 1 0x02 0x0000 PyEval_GetLocals [415] a4 0x0000000c 0 0 17 10 0 0 [416] m 0x0000f190 2 1 0x6b 0x0000 PyEval_GetLocals [417] a4 0x00000004 0 0 17 3 0 0 [418] m 0x0000f2f8 2 1 0x02 0x0000 PyEval_GetGlobals [419] a4 0x0000000c 0 0 17 10 0 0 [420] m 0x0000f194 2 1 0x6b 0x0000 PyEval_GetGlobals [421] a4 0x00000004 0 0 17 3 0 0 [422] m 0x0000f304 2 1 0x02 0x0000 PyEval_GetBuiltins [423] a4 0x0000000c 0 0 17 10 0 0 [424] m 0x0000f198 2 1 0x6b 0x0000 PyEval_GetBuiltins [425] a4 0x00000004 0 0 17 3 0 0 [426] m 0x0000f310 2 1 0x02 0x0000 PyEval_SetTrace [427] a4 0x0000000c 0 0 17 10 0 0 [428] m 0x0000f19c 2 1 0x6b 0x0000 PyEval_SetTrace [429] a4 0x00000004 0 0 17 3 0 0 [430] m 0x0000f31c 2 1 0x02 0x0000 PyEval_SetProfile [431] a4 0x0000000c 0 0 17 10 0 0 [432] m 0x0000f1a0 2 1 0x6b 0x0000 PyEval_SetProfile [433] a4 0x00000004 0 0 17 3 0 0 [434] m 0x0000f328 2 1 0x02 0x0000 PyEval_CallObjectWithKeywords [435] a4 0x0000000c 0 0 17 10 0 0 [436] m 0x0000f1a4 2 1 0x6b 0x0000 PyEval_CallObjectWithKeywords [437] a4 0x00000004 0 0 17 3 0 0 [438] m 0x00000000 0 1 0x02 0x0000 .PyErr_Format [439] a4 0x00000000 0 0 0 0 0 0 [440] m 0x00000000 0 1 0x02 0x0000 .PyObject_GetIter [441] a4 0x00000000 0 0 0 0 0 0 [442] m 0x00000000 0 1 0x02 0x0000 .PyIter_Next [443] a4 0x00000000 0 0 0 0 0 0 [444] m 0x00000000 0 1 0x02 0x0000 .PyErr_Occurred [445] a4 0x00000000 0 0 0 0 0 0 [446] m 0x00000000 0 1 0x02 0x0000 .PyErr_SetString [447] a4 0x00000000 0 0 0 0 0 0 ... [696] m 0x00000000 0 1 0x02 0x0000 .PyNumber_Divide [697] a4 0x00000000 0 0 0 0 0 0 [698] m 0x00000000 0 1 0x02 0x0000 .PyErr_SetNone [699] a4 0x00000000 0 0 0 0 0 0 [700] m 0x00000000 0 1 0x02 0x0000 .PyTraceBack_Here [701] a4 0x00000000 0 0 0 0 0 0 [702] m 0x00000000 0 1 0x02 0x0000 ._PyUnicodeUCS2_AsDefaultEncodedString [703] a4 0x00000000 0 0 0 0 0 0 [704] m 0x00000000 0 1 0x02 0x0000 .PyNumber_AsSsize_t [705] a4 0x00000000 0 0 0 0 0 0 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 04:22:00 2016 From: report at bugs.python.org (=?utf-8?q?Vojt=C4=9Bch_Pachol?=) Date: Wed, 02 Mar 2016 09:22:00 +0000 Subject: [issue26468] shutil.copy2 raises OSError if filesystem doesn't support chmod Message-ID: <1456910519.95.0.44073308632.issue26468@psf.upfronthosting.co.za> New submission from Vojt?ch Pachol: `copy2` checks if `os` nodule has `chmod` and then it uses it without thinking. On filesystems that doesn't support `chmod` it ends with OSError: [Errno 95] Operation not supported: which is not acceptable since documentation says "copy2() never returns failure". ---------- components: Library (Lib) messages: 261100 nosy: Vojt?ch Pachol priority: normal severity: normal status: open title: shutil.copy2 raises OSError if filesystem doesn't support chmod versions: Python 2.7, Python 3.4, Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 04:40:40 2016 From: report at bugs.python.org (Michael Jacob) Date: Wed, 02 Mar 2016 09:40:40 +0000 Subject: [issue26469] Bug in ConfigParser when setting new values in extended interpolation Message-ID: <1456911640.56.0.456152786125.issue26469@psf.upfronthosting.co.za> New submission from Michael Jacob: There seems to be a bug in configparser when setting new values in extended interpolation: python --version Python 3.5.1 from configparser import ConfigParser, ExtendedInterpolation c=ConfigParser(interpolation=ExtendedInterpolation) c.add_section('test') c.set('test', 'key', 'value') Traceback (most recent call last): File "", line 1, in File "/usr/lib/python3.5/configparser.py", line 1190, in set super().set(section, option, value) File "/usr/lib/python3.5/configparser.py", line 891, in set value) TypeError: before_set() missing 1 required positional argument: 'value' It works ithout extended interpolation, though. ---------- components: Library (Lib) messages: 261101 nosy: Michael Jacob priority: normal severity: normal status: open title: Bug in ConfigParser when setting new values in extended interpolation type: crash versions: Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 04:53:47 2016 From: report at bugs.python.org (Michael Jacob) Date: Wed, 02 Mar 2016 09:53:47 +0000 Subject: [issue26469] Bug in ConfigParser when setting new values in extended interpolation In-Reply-To: <1456911640.56.0.456152786125.issue26469@psf.upfronthosting.co.za> Message-ID: <1456912427.94.0.111474248678.issue26469@psf.upfronthosting.co.za> Michael Jacob added the comment: My bad. ConfigParser expects an interpolation object, not a class. Instead of c=ConfigParser(interpolation=ExtendedInterpolation) you need to create it with: c=ConfigParser(interpolation=ExtendedInterpolation()) Sorry about that. ---------- resolution: -> not a bug status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 05:18:22 2016 From: report at bugs.python.org (Michael Felt) Date: Wed, 02 Mar 2016 10:18:22 +0000 Subject: [issue26466] cannot build python 2.7.11 on AIX In-Reply-To: <1456844902.77.0.455974310535.issue26466@psf.upfronthosting.co.za> Message-ID: <1456913902.05.0.124196289151.issue26466@psf.upfronthosting.co.za> Michael Felt added the comment: Patched to fp22: vacpp.11.1.0.22.aix53TL7-71.sept2015.ptf.tar.Z after reinstalling system! to be sure no garbage left around. Only updates are openSSL/SSH packages; no RPM's installed. Same error message(s). Tried compiling ceval.o with -O0 (capt. O, zero) - same messages Tried linking with .o files only (no archive) - effectively, same message. root at x064:[/data/prj/aixtools/python-2.7.11]xlc -o python Modules/python.o Python/*.o ld: 0711-596 SEVERE ERROR: Object Python/ceval.o An RLD for section 2 (.data) refers to symbol 0, but the storage class of the symbol is not C_EXT or C_HIDEXT. ld: 0711-596 SEVERE ERROR: Object Python/ceval.o An RLD for section 2 (.data) refers to symbol 0, but the storage class of the symbol is not C_EXT or C_HIDEXT. Maybe xlc does not know how to code the differences snip: diff -u ./python-2.7.10/Python/ceval.c ./python-2.7.11/Python/ceval.c | head -50 michael at x071:[/data/prj/aixtools/src]ython-2.7.11/Python/ceval.c | head -50 < --- ./python-2.7.10/Python/ceval.c 2015-05-23 16:09:24 +0000 +++ ./python-2.7.11/Python/ceval.c 2015-12-05 19:47:19 +0000 @@ -615,7 +615,7 @@ to guarantee that _Py_CheckRecursiveCall() is regularly called. Without USE_STACKCHECK, there is no need for this. */ int -_Py_CheckRecursiveCall(char *where) +_Py_CheckRecursiveCall(const char *where) { PyThreadState *tstate = PyThreadState_GET(); @@ -688,6 +688,100 @@ PyObject * PyEval_EvalFrameEx(PyFrameObject *f, int throwflag) { +#ifdef DYNAMIC_EXECUTION_PROFILE + #undef USE_COMPUTED_GOTOS +#endif +#ifdef HAVE_COMPUTED_GOTOS + #ifndef USE_COMPUTED_GOTOS + #define USE_COMPUTED_GOTOS 1 + #endif +#else + #if defined(USE_COMPUTED_GOTOS) && USE_COMPUTED_GOTOS + #error "Computed gotos are not supported on this compiler." + #endif + #undef USE_COMPUTED_GOTOS + #define USE_COMPUTED_GOTOS 0 +#endif +#if USE_COMPUTED_GOTOS +/* Import the static jump table */ +#include "opcode_targets.h" + + /* This macro is used when several opcodes defer to the same implementation + (e.g. SETUP_LOOP, SETUP_FINALLY) */ +#define TARGET_WITH_IMPL(op, impl) \ + TARGET_##op: \ + opcode = op; \ + oparg = NEXTARG(); \ + case op: \ + goto impl; \ + +#define TARGET_WITH_IMPL_NOARG(op, impl) \ + TARGET_##op: \ + opcode = op; \ + case op: \ + goto impl; \ + +#define TARGET_NOARG(op) \ + TARGET_##op: \ In "character" a big change from 2.7.8 to 2.7.10 michael at x071:[/data/prj/aixtools/python]diff -u ./old/Python-2.7.8/Python/ceval> --- ./old/Python-2.7.8/Python/ceval.c 2014-06-30 02:05:46 +0000 +++ ./old/Python-2.7.10/Python/ceval.c 2015-05-23 16:09:24 +0000 @@ -66,9 +66,11 @@ even in 64-bit mode, we need to use "a" and "d" for the lower and upper 32-bit pieces of the result. */ -#define READ_TIMESTAMP(val) \ - __asm__ __volatile__("rdtsc" : \ - "=a" (((int*)&(val))[0]), "=d" (((int*)&(val))[1])); +#define READ_TIMESTAMP(val) do { \ + unsigned int h, l; \ + __asm__ __volatile__("rdtsc" : "=a" (l), "=d" (h)); \ + (val) = ((uint64)l) | (((uint64)h) << 32); \ + } while(0) #else @@ -355,12 +357,6 @@ if (interpreter_lock) { int err = errno; PyThread_acquire_lock(interpreter_lock, 1); - /* _Py_Finalizing is protected by the GIL */ - if (_Py_Finalizing && tstate != _Py_Finalizing) { - PyThread_release_lock(interpreter_lock); - PyThread_exit_thread(); - assert(0); /* unreachable */ - } errno = err; } #endif @@ -1025,12 +1021,6 @@ PyThread_acquire_lock(interpreter_lock, 1); - /* Check if we should make a quick exit. */ - if (_Py_Finalizing && _Py_Finalizing != tstate) { - PyThread_release_lock(interpreter_lock); - PyThread_exit_thread(); - } - if (PyThreadState_Swap(tstate) != NULL) Py_FatalError("ceval: orphan tstate"); @@ -1957,9 +1947,13 @@ if (err == 0) continue; break; } + t = PyObject_Repr(w); + if (t == NULL) + break; PyErr_Format(PyExc_SystemError, "no locals found when storing %s", - PyObject_REPR(w)); + PyString_AS_STRING(t)); + Py_DECREF(t); break; case DELETE_NAME: @@ -1971,9 +1965,13 @@ w); break; } + t = PyObject_Repr(w); + if (t == NULL) + break; PyErr_Format(PyExc_SystemError, "no locals when deleting %s", - PyObject_REPR(w)); + PyString_AS_STRING(w)); + Py_DECREF(t); break; PREDICTED_WITH_ARG(UNPACK_SEQUENCE); @@ -2046,10 +2044,14 @@ case LOAD_NAME: w = GETITEM(names, oparg); if ((v = f->f_locals) == NULL) { + why = WHY_EXCEPTION; + t = PyObject_Repr(w); + if (t == NULL) + break; PyErr_Format(PyExc_SystemError, "no locals when loading %s", - PyObject_REPR(w)); - why = WHY_EXCEPTION; + PyString_AS_STRING(w)); + Py_DECREF(t); break; } if (PyDict_CheckExact(v)) { michael at x071:[/data/prj/aixtools/python] So, until someone can help figure out which symbol is being referenced, yet seems to lack a correct attribute "but the storage class of the symbol is not C_EXT or C_HIDEXT." I am lost. Thank you for your consideration. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 05:28:42 2016 From: report at bugs.python.org (Berker Peksag) Date: Wed, 02 Mar 2016 10:28:42 +0000 Subject: [issue22176] update internal libffi copy to 3.1, introducing AArch64 and POWER ELF ABIv2 In-Reply-To: <1407614032.19.0.619633143282.issue22176@psf.upfronthosting.co.za> Message-ID: <1456914522.3.0.475015937547.issue22176@psf.upfronthosting.co.za> Changes by Berker Peksag : ---------- resolution: -> fixed stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 05:33:05 2016 From: report at bugs.python.org (Berker Peksag) Date: Wed, 02 Mar 2016 10:33:05 +0000 Subject: [issue25660] tabs don't work correctly in python repl In-Reply-To: <1447876730.91.0.918964104484.issue25660@psf.upfronthosting.co.za> Message-ID: <1456914785.91.0.771072553371.issue25660@psf.upfronthosting.co.za> Changes by Berker Peksag : ---------- status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 05:41:46 2016 From: report at bugs.python.org (Berker Peksag) Date: Wed, 02 Mar 2016 10:41:46 +0000 Subject: [issue13492] ./configure --with-system-ffi=LIBFFI-PATH In-Reply-To: <1322472271.69.0.0807066602711.issue13492@psf.upfronthosting.co.za> Message-ID: <1456915306.94.0.902869829542.issue13492@psf.upfronthosting.co.za> Changes by Berker Peksag : ---------- resolution: -> out of date stage: needs patch -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From mal at egenix.com Wed Mar 2 05:43:05 2016 From: mal at egenix.com (M.-A. Lemburg) Date: Wed, 2 Mar 2016 11:43:05 +0100 Subject: [issue26466] cannot build python 2.7.11 on AIX In-Reply-To: <1456913902.05.0.124196289151.issue26466@psf.upfronthosting.co.za> References: <1456913902.05.0.124196289151.issue26466@psf.upfronthosting.co.za> Message-ID: <56D6C3B9.5020101@egenix.com> Does Python 2.7.10 build fine ? If so, then perhaps xlc doesn't like the computed gotos in ceval.c. You could try compiling with: ./configure ... --without-computed-gotos ... to check. -- Marc-Andre Lemburg eGenix.com From report at bugs.python.org Wed Mar 2 05:43:12 2016 From: report at bugs.python.org (Marc-Andre Lemburg) Date: Wed, 02 Mar 2016 10:43:12 +0000 Subject: [issue26466] cannot build python 2.7.11 on AIX In-Reply-To: <1456913902.05.0.124196289151.issue26466@psf.upfronthosting.co.za> Message-ID: <56D6C3B9.5020101@egenix.com> Marc-Andre Lemburg added the comment: Does Python 2.7.10 build fine ? If so, then perhaps xlc doesn't like the computed gotos in ceval.c. You could try compiling with: ./configure ... --without-computed-gotos ... to check. ---------- nosy: +lemburg _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 05:56:33 2016 From: report at bugs.python.org (Berker Peksag) Date: Wed, 02 Mar 2016 10:56:33 +0000 Subject: [issue17873] _ctypes/libffi missing bits for aarch64 support In-Reply-To: <1367276723.56.0.050997158172.issue17873@psf.upfronthosting.co.za> Message-ID: <1456916193.04.0.84667414096.issue17873@psf.upfronthosting.co.za> Berker Peksag added the comment: This has been fixed as part of updating libffi in issue 22176: https://github.com/python/cpython/blob/master/Modules/_ctypes/libffi/fficonfig.py.in#L20 Thanks for the report and for the patch, Andreas! ---------- nosy: +berker.peksag resolution: -> out of date stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 06:26:37 2016 From: report at bugs.python.org (Eric V. Smith) Date: Wed, 02 Mar 2016 11:26:37 +0000 Subject: [issue26468] shutil.copy2 raises OSError if filesystem doesn't support chmod In-Reply-To: <1456910519.95.0.44073308632.issue26468@psf.upfronthosting.co.za> Message-ID: <1456917997.4.0.103754023377.issue26468@psf.upfronthosting.co.za> Eric V. Smith added the comment: I agree that copy2 should not fail because chmod fails. Could you please provide the entire traceback message when it fails (on both 2.7 and 3.4 or 3.5)? And what OS are you running on, and what filesystem? It looks like the error happens because errno=95 (EOPNOTSUPP, probably) isn't in the list of errors that _copyxattr catches, while (ENOTSUP=134 on Linux) is. I think the documentation is also incorrect. Of course copy2 can fail: what about out of disk space? I think the documentation is trying to say that copy2 never fails because it can't preserve metadata. And the wording in the docs "copy2() never returns failure" is also odd, it should say "copy2() never raises an exception because it cannot preserve file metadata". ---------- assignee: -> docs at python components: +Documentation nosy: +docs at python, eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 06:47:15 2016 From: report at bugs.python.org (=?utf-8?q?Tam=C3=A1s_Bence_Gedai?=) Date: Wed, 02 Mar 2016 11:47:15 +0000 Subject: [issue21042] ctypes.util.find_library() should return full pathname instead of filename in linux In-Reply-To: <1395614835.79.0.900137034576.issue21042@psf.upfronthosting.co.za> Message-ID: <1456919235.72.0.0560756244683.issue21042@psf.upfronthosting.co.za> Tam?s Bence Gedai added the comment: Is there anything else that I can do for this issue? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 07:14:53 2016 From: report at bugs.python.org (Christian Heimes) Date: Wed, 02 Mar 2016 12:14:53 +0000 Subject: [issue26470] Make OpenSSL module compatible with OpenSSL 1.1.0 Message-ID: <1456920893.87.0.933592382559.issue26470@psf.upfronthosting.co.za> New submission from Christian Heimes: OpenSSL 1.1.0 is changing a lot of internals. Most structs are opaque, RC4 and SSLv2 are gone. I've a rough patch in my private repos. I'll submit the patch as soon as the code is compatible with OpenSSL 1.0.2, too. https://github.com/python/cpython/compare/master...tiran:feature/openssl110 ---------- assignee: christian.heimes messages: 261108 nosy: alex, christian.heimes, dstufft, giampaolo.rodola, janssen, pitrou priority: normal severity: normal stage: needs patch status: open title: Make OpenSSL module compatible with OpenSSL 1.1.0 type: security versions: Python 2.7, Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 07:16:38 2016 From: report at bugs.python.org (Alex Gaynor) Date: Wed, 02 Mar 2016 12:16:38 +0000 Subject: [issue26465] Upgrade OpenSSL shipped with python installers In-Reply-To: <1456842373.05.0.727353806198.issue26465@psf.upfronthosting.co.za> Message-ID: <1456920998.92.0.783610756482.issue26465@psf.upfronthosting.co.za> Changes by Alex Gaynor : ---------- nosy: +christian.heimes, dstufft, giampaolo.rodola, janssen, pitrou _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 07:24:40 2016 From: report at bugs.python.org (Christian Heimes) Date: Wed, 02 Mar 2016 12:24:40 +0000 Subject: [issue26471] load_verify_locations(cadata) should load AUX ASN.1 to supported trusted certs Message-ID: <1456921480.82.0.773236455463.issue26471@psf.upfronthosting.co.za> New submission from Christian Heimes: https://docs.python.org/2/library/ssl.html#ssl.SSLContext.load_verify_locations can load certs from a file, a directory or from memory. OpenSSL's loaders for cafile and capath load auxiliary data of trusted certs. The custom loader for cadata ignores AUX data because it uses PEM_read_bio_X509() instead of PEM_read_bio_X509_AUX(). With the recent fix of OpenSSL 1.0.2 https://github.com/openssl/openssl/commit/a3baa171053547488475709c7197592c66e427cf trusted certificates now work again. I propose to change cadata to load trust settings, too. ---------- assignee: christian.heimes components: Extension Modules messages: 261109 nosy: alex, christian.heimes, dstufft, giampaolo.rodola, janssen, pitrou priority: normal severity: normal stage: needs patch status: open title: load_verify_locations(cadata) should load AUX ASN.1 to supported trusted certs type: security versions: Python 2.7, Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 07:33:26 2016 From: report at bugs.python.org (=?utf-8?q?Vojt=C4=9Bch_Pachol?=) Date: Wed, 02 Mar 2016 12:33:26 +0000 Subject: [issue26468] shutil.copy2 raises OSError if filesystem doesn't support chmod In-Reply-To: <1456910519.95.0.44073308632.issue26468@psf.upfronthosting.co.za> Message-ID: <1456922006.43.0.235549868357.issue26468@psf.upfronthosting.co.za> Vojt?ch Pachol added the comment: Actually it is a remote fs mounted via samba. OS is Linux. Tracebacks with Python versions I have: $ python2.7 Python 2.7.11 (default, Jan 11 2016, 21:04:40) [GCC 5.3.1 20160101] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import shutil >>> shutil.copy2("src", "dst") Traceback (most recent call last): File "", line 1, in File "/usr/lib/python2.7/shutil.py", line 131, in copy2 copystat(src, dst) File "/usr/lib/python2.7/shutil.py", line 100, in copystat os.chmod(dst, mode) OSError: [Errno 95] Operation not supported: 'dst' >>> $ python3.4 Python 3.4.4 (default, Jan 5 2016, 15:35:18) [GCC 5.3.1 20160101] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import shutil >>> shutil.copy2("src", "dst") Traceback (most recent call last): File "", line 1, in File "/usr/lib/python3.4/shutil.py", line 246, in copy2 copystat(src, dst, follow_symlinks=follow_symlinks) File "/usr/lib/python3.4/shutil.py", line 191, in copystat lookup("chmod")(dst, mode, follow_symlinks=follow) OSError: [Errno 95] Operation not supported: 'dst' >>> $ python3.5 Python 3.5.1+ (default, Jan 13 2016, 15:09:18) [GCC 5.3.1 20160101] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import shutil >>> shutil.copy2("src", "dst") Traceback (most recent call last): File "", line 1, in File "/usr/lib/python3.5/shutil.py", line 252, in copy2 copystat(src, dst, follow_symlinks=follow_symlinks) File "/usr/lib/python3.5/shutil.py", line 197, in copystat lookup("chmod")(dst, mode, follow_symlinks=follow) OSError: [Errno 95] Operation not supported: 'dst' >>> ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 07:33:57 2016 From: report at bugs.python.org (Christian Heimes) Date: Wed, 02 Mar 2016 12:33:57 +0000 Subject: [issue26465] Upgrade OpenSSL shipped with python installers In-Reply-To: <1456842373.05.0.727353806198.issue26465@psf.upfronthosting.co.za> Message-ID: <1456922037.76.0.117063895042.issue26465@psf.upfronthosting.co.za> Christian Heimes added the comment: New security releases of Python are scheduled for the near future, most likelye mid to end of March. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 07:58:04 2016 From: report at bugs.python.org (Barun Parruck) Date: Wed, 02 Mar 2016 12:58:04 +0000 Subject: [issue26448] dis.findlabels ignores EXTENDED_ARG In-Reply-To: <1456545250.68.0.0525262950792.issue26448@psf.upfronthosting.co.za> Message-ID: <1456923484.62.0.268356644712.issue26448@psf.upfronthosting.co.za> Barun Parruck added the comment: So...firstly hi, and sorry for disappearing like that! You want tests for the dis.findlabels library? What sort of tests are you looking for? Similiarly sized bytecode streams like the ones we worked with, or did you have something else in mind? B ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 08:22:54 2016 From: report at bugs.python.org (Tibichte) Date: Wed, 02 Mar 2016 13:22:54 +0000 Subject: [issue26472] Infinite loop Message-ID: <1456924974.81.0.368543659162.issue26472@psf.upfronthosting.co.za> New submission from Tibichte: The code below runs indefinitely: with open(False) as f: for line in f: print(line) ---------- components: IO messages: 261113 nosy: DarkMagus priority: normal severity: normal status: open title: Infinite loop type: behavior versions: Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 08:29:14 2016 From: report at bugs.python.org (Christian Heimes) Date: Wed, 02 Mar 2016 13:29:14 +0000 Subject: [issue26472] Infinite loop In-Reply-To: <1456924974.81.0.368543659162.issue26472@psf.upfronthosting.co.za> Message-ID: <1456925354.63.0.917845423583.issue26472@psf.upfronthosting.co.za> Christian Heimes added the comment: In open(False) Fale is interpreted as int 0. The function call opens file descriptor 0 (stdin) and waits for incoming data. Try this code, enter some text and press enter to see what is going on: with open(False) as f: for line in f: print('stdin: ', line) ---------- nosy: +christian.heimes resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 09:33:16 2016 From: report at bugs.python.org (Zachary Ware) Date: Wed, 02 Mar 2016 14:33:16 +0000 Subject: [issue26470] Make OpenSSL module compatible with OpenSSL 1.1.0 In-Reply-To: <1456920893.87.0.933592382559.issue26470@psf.upfronthosting.co.za> Message-ID: <1456929196.89.0.0704182618221.issue26470@psf.upfronthosting.co.za> Changes by Zachary Ware : ---------- nosy: +zach.ware _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 10:49:47 2016 From: report at bugs.python.org (Roundup Robot) Date: Wed, 02 Mar 2016 15:49:47 +0000 Subject: [issue25647] Return of asyncio.coroutine from asyncio.coroutine doesn't work with enabled asyncio debug In-Reply-To: <1447761909.17.0.397190405372.issue25647@psf.upfronthosting.co.za> Message-ID: <20160302154940.116283.37999@psf.io> Roundup Robot added the comment: New changeset fd21f162e377 by Yury Selivanov in branch '3.5': asyncio: Fix @coroutine to recognize CoroWrapper (issue #25647) https://hg.python.org/cpython/rev/fd21f162e377 New changeset e3aee2f16937 by Yury Selivanov in branch 'default': Merge 3.5 (issue #25647) https://hg.python.org/cpython/rev/e3aee2f16937 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 10:51:17 2016 From: report at bugs.python.org (Yury Selivanov) Date: Wed, 02 Mar 2016 15:51:17 +0000 Subject: [issue25647] Return of asyncio.coroutine from asyncio.coroutine doesn't work with enabled asyncio debug In-Reply-To: <1447761909.17.0.397190405372.issue25647@psf.upfronthosting.co.za> Message-ID: <1456933877.73.0.994470353014.issue25647@psf.upfronthosting.co.za> Yury Selivanov added the comment: Vladimir, thanks for the patch! ---------- resolution: -> fixed stage: -> resolved status: open -> closed type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 11:04:11 2016 From: report at bugs.python.org (Roundup Robot) Date: Wed, 02 Mar 2016 16:04:11 +0000 Subject: [issue26221] awaiting asyncio.Future swallows StopIteration In-Reply-To: <1453915533.75.0.0706458699162.issue26221@psf.upfronthosting.co.za> Message-ID: <20160302160357.10728.42973@psf.io> Roundup Robot added the comment: New changeset ef5265bc07bb by Yury Selivanov in branch '3.5': asyncio: Prevent StopIteration from being thrown into a Future https://hg.python.org/cpython/rev/ef5265bc07bb New changeset 5e2f7e51af51 by Yury Selivanov in branch 'default': Merge 3.5 (issue #26221) https://hg.python.org/cpython/rev/5e2f7e51af51 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 11:04:43 2016 From: report at bugs.python.org (Yury Selivanov) Date: Wed, 02 Mar 2016 16:04:43 +0000 Subject: [issue26221] awaiting asyncio.Future swallows StopIteration In-Reply-To: <1453915533.75.0.0706458699162.issue26221@psf.upfronthosting.co.za> Message-ID: <1456934683.58.0.737624772478.issue26221@psf.upfronthosting.co.za> Yury Selivanov added the comment: Merged. ---------- resolution: -> fixed stage: -> resolved status: open -> closed type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 11:09:50 2016 From: report at bugs.python.org (Roundup Robot) Date: Wed, 02 Mar 2016 16:09:50 +0000 Subject: [issue26347] BoundArguments.apply_defaults doesn't handle empty arguments In-Reply-To: <1455247989.9.0.159596346531.issue26347@psf.upfronthosting.co.za> Message-ID: <20160302160945.10236.33163@psf.io> Roundup Robot added the comment: New changeset 94879997ea5f by Yury Selivanov in branch '3.5': inspect: Fix BoundArguments.apply_defaults to handle empty arguments https://hg.python.org/cpython/rev/94879997ea5f New changeset 779a0d51f7e2 by Yury Selivanov in branch 'default': Merge 3.5 (issue #26347) https://hg.python.org/cpython/rev/779a0d51f7e2 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 11:10:27 2016 From: report at bugs.python.org (Yury Selivanov) Date: Wed, 02 Mar 2016 16:10:27 +0000 Subject: [issue26347] BoundArguments.apply_defaults doesn't handle empty arguments In-Reply-To: <1455247989.9.0.159596346531.issue26347@psf.upfronthosting.co.za> Message-ID: <1456935027.21.0.982627989305.issue26347@psf.upfronthosting.co.za> Yury Selivanov added the comment: Merged. Thank you Frederick for your contribution! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 11:17:32 2016 From: report at bugs.python.org (Roundup Robot) Date: Wed, 02 Mar 2016 16:17:32 +0000 Subject: [issue26338] remove duplicate bind addresses in create_server In-Reply-To: <1455201454.94.0.572810493705.issue26338@psf.upfronthosting.co.za> Message-ID: <20160302161729.10708.94634@psf.io> Roundup Robot added the comment: New changeset bbc8cb86f05e by Yury Selivanov in branch '3.5': asyncio: Remove duplicate bind addresses in create_server. https://hg.python.org/cpython/rev/bbc8cb86f05e New changeset bdf2807aa8c4 by Yury Selivanov in branch 'default': Merge 3.5 (issue #26338) https://hg.python.org/cpython/rev/bdf2807aa8c4 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 11:17:58 2016 From: report at bugs.python.org (Yury Selivanov) Date: Wed, 02 Mar 2016 16:17:58 +0000 Subject: [issue26338] remove duplicate bind addresses in create_server In-Reply-To: <1455201454.94.0.572810493705.issue26338@psf.upfronthosting.co.za> Message-ID: <1456935478.88.0.605665625142.issue26338@psf.upfronthosting.co.za> Yury Selivanov added the comment: Committed. Thanks, Sebastien! ---------- resolution: -> fixed stage: -> resolved status: open -> closed type: -> behavior versions: +Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 11:21:48 2016 From: report at bugs.python.org (Michael Herold) Date: Wed, 02 Mar 2016 16:21:48 +0000 Subject: [issue26394] Have argparse provide ability to require a fallback value be present In-Reply-To: <1455985031.95.0.488150837583.issue26394@psf.upfronthosting.co.za> Message-ID: <1456935708.09.0.724634995581.issue26394@psf.upfronthosting.co.za> Michael Herold added the comment: I have prepared a working patch to sketch how this could be implemented. A small example (example.py) shows how this feature can be used to implement a fallback to environment variables. This patch allows Currying of positional arguments (i.e. you can give position 2 via fallback and provide position 1 via the command line). However, I think this might be too confusing and implicit. Please let me know whether I should prepare a proper patch. ---------- keywords: +patch Added file: http://bugs.python.org/file42061/argparse-wip-1.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 11:22:01 2016 From: report at bugs.python.org (Michael Herold) Date: Wed, 02 Mar 2016 16:22:01 +0000 Subject: [issue26394] Have argparse provide ability to require a fallback value be present In-Reply-To: <1455985031.95.0.488150837583.issue26394@psf.upfronthosting.co.za> Message-ID: <1456935721.86.0.492295732156.issue26394@psf.upfronthosting.co.za> Changes by Michael Herold : Added file: http://bugs.python.org/file42062/example.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 11:31:11 2016 From: report at bugs.python.org (Michael Felt) Date: Wed, 02 Mar 2016 16:31:11 +0000 Subject: [issue26466] cannot build python 2.7.11 on AIX In-Reply-To: <1456844902.77.0.455974310535.issue26466@psf.upfronthosting.co.za> Message-ID: <1456936271.25.0.889621091835.issue26466@psf.upfronthosting.co.za> Michael Felt added the comment: wonderful suggestion - it gets the build past that hurdle. My bad that I had not looked more carefully at configure --help output. But that brings back another 'issue' I had also seen when verifying 2.7.10. I shall look in the bug-list for a related issue (I seem to recall at least one) - and request that this one be closed. Thanks! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 11:31:43 2016 From: report at bugs.python.org (Roundup Robot) Date: Wed, 02 Mar 2016 16:31:43 +0000 Subject: [issue25888] awaiting on coroutine that is being awaited should be an error In-Reply-To: <1450302672.61.0.939075659371.issue25888@psf.upfronthosting.co.za> Message-ID: <20160302163110.67077.13644@psf.io> Roundup Robot added the comment: New changeset e16084e07761 by Yury Selivanov in branch '3.5': coroutines: Error when awaiting on coroutine that's being awaited https://hg.python.org/cpython/rev/e16084e07761 New changeset 2218ce5c592f by Yury Selivanov in branch 'default': Merge 3.5 (issue #25888) https://hg.python.org/cpython/rev/2218ce5c592f ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 11:33:32 2016 From: report at bugs.python.org (Yury Selivanov) Date: Wed, 02 Mar 2016 16:33:32 +0000 Subject: [issue25888] awaiting on coroutine that is being awaited should be an error In-Reply-To: <1450302672.61.0.939075659371.issue25888@psf.upfronthosting.co.za> Message-ID: <1456936412.98.0.495220257128.issue25888@psf.upfronthosting.co.za> Yury Selivanov added the comment: Committed. Thanks for the review, Martin! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 11:42:41 2016 From: report at bugs.python.org (Michael Felt) Date: Wed, 02 Mar 2016 16:42:41 +0000 Subject: [issue25825] AIX shared library extension modules installation broken In-Reply-To: <1449602974.51.0.754649695687.issue25825@psf.upfronthosting.co.za> Message-ID: <1456936961.85.0.366467785691.issue25825@psf.upfronthosting.co.za> Michael Felt added the comment: FYI: when build and src are the same directory, there is no error message. However, when src and build are in seperate directories (e.g., build = '.', src = '../src/python-2.7.11' the following message occurs MANY times: unable to execute '../src/python-2.7.11/Modules/ld_so_aix': No such file or directory during configure the file ./Modules/ld_so_aix is 'created' in the build area. root at x064:[/data/prj/aixtools/python-2.7.11]ls -l Modules/ld*aix* -rwxr-xr-x 1 root system 6205 Mar 02 16:24 Modules/ld_so_aix Just guessing, but a line such as: BLDSHARED="\$(srcdir)/Modules/ld_so_aix \$(CC) -bI:\$(srcdir)/Modules/python.exp" using $(srcdir) is not correct. Further, a find in $(srcdir) for ld_so_aix returns: root at x064:[/data/prj/aixtools/python-2.7.11]ls -dl ../src/py* drwxr-xr-x 17 199 1954 4096 May 23 2015 ../src/python-2.7.10 drwxr-xr-x 17 199 1954 4096 Dec 05 19:47 ../src/python-2.7.11 So, $(srcdir) seems to be wrong, by definition. For now, I am copying $(srcdir) to $(builddir) to work-around this. ---------- nosy: +Michael.Felt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 12:29:56 2016 From: report at bugs.python.org (Roundup Robot) Date: Wed, 02 Mar 2016 17:29:56 +0000 Subject: [issue26335] Make mmap.write return the number of bytes written like other write methods In-Reply-To: <1455144937.95.0.515520937166.issue26335@psf.upfronthosting.co.za> Message-ID: <20160302172946.89272.17371@psf.io> Roundup Robot added the comment: New changeset ba71aecec943 by Berker Peksag in branch 'default': Issue #26335: Make mmap.write() return the number of bytes written like https://hg.python.org/cpython/rev/ba71aecec943 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 12:31:09 2016 From: report at bugs.python.org (Berker Peksag) Date: Wed, 02 Mar 2016 17:31:09 +0000 Subject: [issue26335] Make mmap.write return the number of bytes written like other write methods In-Reply-To: <1455144937.95.0.515520937166.issue26335@psf.upfronthosting.co.za> Message-ID: <1456939869.6.0.460670456889.issue26335@psf.upfronthosting.co.za> Berker Peksag added the comment: Thanks for the patch, Jakub! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 12:40:35 2016 From: report at bugs.python.org (Roundup Robot) Date: Wed, 02 Mar 2016 17:40:35 +0000 Subject: [issue26246] Code output toggle button uses removed jQuery method In-Reply-To: <1454234717.37.0.159058452495.issue26246@psf.upfronthosting.co.za> Message-ID: <20160302174025.60696.76443@psf.io> Roundup Robot added the comment: New changeset 7444bdd400cd by Berker Peksag in branch '3.4': Issue #26246: Set initial value of the hidden attr when creating copy button. https://hg.python.org/cpython/rev/7444bdd400cd New changeset 256339c28d42 by Berker Peksag in branch '3.5': Issue #26246: Set initial value of the hidden attr when creating copy button. https://hg.python.org/cpython/rev/256339c28d42 New changeset 3e897eef0fac by Berker Peksag in branch 'default': Issue #26246: Set initial value of the hidden attr when creating copy button. https://hg.python.org/cpython/rev/3e897eef0fac ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 12:43:49 2016 From: report at bugs.python.org (Roundup Robot) Date: Wed, 02 Mar 2016 17:43:49 +0000 Subject: [issue26246] Code output toggle button uses removed jQuery method In-Reply-To: <1454234717.37.0.159058452495.issue26246@psf.upfronthosting.co.za> Message-ID: <20160302174344.89276.27013@psf.io> Roundup Robot added the comment: New changeset 305ae007899b by Berker Peksag in branch '2.7': Issue #26246: Set initial value of the hidden attr when creating copy button. https://hg.python.org/cpython/rev/305ae007899b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 12:44:20 2016 From: report at bugs.python.org (Berker Peksag) Date: Wed, 02 Mar 2016 17:44:20 +0000 Subject: [issue26246] Code output toggle button uses removed jQuery method In-Reply-To: <1454234717.37.0.159058452495.issue26246@psf.upfronthosting.co.za> Message-ID: <1456940660.35.0.673454125648.issue26246@psf.upfronthosting.co.za> Berker Peksag added the comment: Good catch, thanks! ---------- nosy: +berker.peksag _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 13:19:23 2016 From: report at bugs.python.org (Alessandro Cucci) Date: Wed, 02 Mar 2016 18:19:23 +0000 Subject: [issue19475] Add timespec optional flag to datetime isoformat() to choose the precision In-Reply-To: <1383325521.57.0.024650274045.issue19475@psf.upfronthosting.co.za> Message-ID: <1456942763.31.0.77779330764.issue19475@psf.upfronthosting.co.za> Alessandro Cucci added the comment: Meanwhile I made corrections after @belopolsky latest review ---------- Added file: http://bugs.python.org/file42063/issue19475_v17.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 13:24:42 2016 From: report at bugs.python.org (SilentGhost) Date: Wed, 02 Mar 2016 18:24:42 +0000 Subject: [issue19475] Add timespec optional flag to datetime isoformat() to choose the precision In-Reply-To: <1383325521.57.0.024650274045.issue19475@psf.upfronthosting.co.za> Message-ID: <1456943082.16.0.325267750434.issue19475@psf.upfronthosting.co.za> Changes by SilentGhost : ---------- nosy: -SilentGhost _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 13:25:08 2016 From: report at bugs.python.org (Slava) Date: Wed, 02 Mar 2016 18:25:08 +0000 Subject: [issue26473] Python 3.5 not run Message-ID: <1456943108.9.0.414596574581.issue26473@psf.upfronthosting.co.za> New submission from Slava: Python 3.5 not run on Windows Server 2003 (PE mode). Python 3.5 installer not work too. ---------- components: Windows files: Clipboard01.jpg messages: 261134 nosy: newillusion, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: Python 3.5 not run type: behavior versions: Python 3.5 Added file: http://bugs.python.org/file42064/Clipboard01.jpg _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 13:25:44 2016 From: report at bugs.python.org (Alexander Belopolsky) Date: Wed, 02 Mar 2016 18:25:44 +0000 Subject: [issue19475] Add timespec optional flag to datetime isoformat() to choose the precision In-Reply-To: <1383325521.57.0.024650274045.issue19475@psf.upfronthosting.co.za> Message-ID: <1456943144.11.0.629100854291.issue19475@psf.upfronthosting.co.za> Alexander Belopolsky added the comment: Alessandro, thank you very much for your work and perseverance. I will do my best to commit this next weekend. ---------- stage: patch review -> commit review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 13:27:18 2016 From: report at bugs.python.org (SilentGhost) Date: Wed, 02 Mar 2016 18:27:18 +0000 Subject: [issue26473] Python 3.5 not run In-Reply-To: <1456943108.9.0.414596574581.issue26473@psf.upfronthosting.co.za> Message-ID: <1456943238.33.0.872900520549.issue26473@psf.upfronthosting.co.za> SilentGhost added the comment: As the installer says and as mentioned in documentation a minimum supported versions is Windows Vista. ---------- nosy: +SilentGhost resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 13:41:41 2016 From: report at bugs.python.org (Steve Dower) Date: Wed, 02 Mar 2016 18:41:41 +0000 Subject: [issue26473] Python 3.5 not run In-Reply-To: <1456943108.9.0.414596574581.issue26473@psf.upfronthosting.co.za> Message-ID: <1456944101.17.0.966391797409.issue26473@psf.upfronthosting.co.za> Steve Dower added the comment: It's unfortunately not so clear from the "minimum Vista" statement that WS2K3 is excluded, but if you follow the official statement ("supported by Microsoft") then you'll see that WS2K3 is no longer covered. Vista and Windows Server 2008 are the minimum supported versions for 3.5. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 14:25:40 2016 From: report at bugs.python.org (Andrew Svetlov) Date: Wed, 02 Mar 2016 19:25:40 +0000 Subject: [issue25612] nested try..excepts don't work correctly for generators In-Reply-To: <1447361959.0.0.839122121456.issue25612@psf.upfronthosting.co.za> Message-ID: <1456946740.02.0.647343621244.issue25612@psf.upfronthosting.co.za> Changes by Andrew Svetlov : ---------- nosy: +asvetlov _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 15:22:34 2016 From: report at bugs.python.org (STINNER Victor) Date: Wed, 02 Mar 2016 20:22:34 +0000 Subject: [issue26448] dis.findlabels ignores EXTENDED_ARG In-Reply-To: <1456545250.68.0.0525262950792.issue26448@psf.upfronthosting.co.za> Message-ID: <1456950154.98.0.435764492672.issue26448@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- nosy: +haypo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 15:43:07 2016 From: report at bugs.python.org (Andrej Antonov) Date: Wed, 02 Mar 2016 20:43:07 +0000 Subject: [issue26460] datetime.strptime without a year fails on Feb 29 In-Reply-To: <1456768955.02.0.995801288981.issue26460@psf.upfronthosting.co.za> Message-ID: <1456951387.43.0.418566587173.issue26460@psf.upfronthosting.co.za> Changes by Andrej Antonov : ---------- nosy: +polymorphm _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 16:59:56 2016 From: report at bugs.python.org (John Snow) Date: Wed, 02 Mar 2016 21:59:56 +0000 Subject: [issue26474] Memory leak at malloc_closure.c Message-ID: <1456955996.67.0.137119059365.issue26474@psf.upfronthosting.co.za> New submission from John Snow: malloc_closere.c holds a static list of items: free_list. The items are being allocated in the more_core method using VirtualAlloc / mmap. However they never get released. Here is the allocation code: #ifdef MS_WIN32 item = (ITEM *)VirtualAlloc(NULL, count * sizeof(ITEM), MEM_COMMIT, PAGE_EXECUTE_READWRITE); if (item == NULL) return; #else item = (ITEM *)mmap(NULL, count * sizeof(ITEM), PROT_READ | PROT_WRITE | PROT_EXEC, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); if (item == (void *)MAP_FAILED) return; #endif ---------- components: ctypes messages: 261138 nosy: John_Snow priority: normal severity: normal status: open title: Memory leak at malloc_closure.c type: resource usage versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 17:09:45 2016 From: report at bugs.python.org (STINNER Victor) Date: Wed, 02 Mar 2016 22:09:45 +0000 Subject: [issue26474] ctypes: Memory leak at malloc_closure.c In-Reply-To: <1456955996.67.0.137119059365.issue26474@psf.upfronthosting.co.za> Message-ID: <1456956585.24.0.886398081207.issue26474@psf.upfronthosting.co.za> STINNER Victor added the comment: > malloc_closere.c We are talking about Modules/_ctypes/malloc_closure.c. > The items are being allocated in the more_core method using VirtualAlloc / mmap. However they never get released. The allocation is only done once. I'm not sure that it can be called a leak. Calling the function 1,000 times will not allocate more memory. ---------- nosy: +haypo title: Memory leak at malloc_closure.c -> ctypes: Memory leak at malloc_closure.c versions: +Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 17:48:45 2016 From: report at bugs.python.org (Michael Felt) Date: Wed, 02 Mar 2016 22:48:45 +0000 Subject: [issue26470] Make OpenSSL module compatible with OpenSSL 1.1.0 In-Reply-To: <1456920893.87.0.933592382559.issue26470@psf.upfronthosting.co.za> Message-ID: <1456958925.18.0.447963922875.issue26470@psf.upfronthosting.co.za> Michael Felt added the comment: Since you are looking, maybe look at whether it is also libreSSL compatible? ---------- nosy: +Michael.Felt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 18:06:14 2016 From: report at bugs.python.org (Skip Montanaro) Date: Wed, 02 Mar 2016 23:06:14 +0000 Subject: [issue23041] csv needs more quoting rules In-Reply-To: <1418402205.61.0.685044268577.issue23041@psf.upfronthosting.co.za> Message-ID: <1456959974.39.0.26101715028.issue23041@psf.upfronthosting.co.za> Skip Montanaro added the comment: Thanks for the update berker.peksag. I'm still not convinced that the csv module should be modified just so one user (sorry samwyse) can match the input format of someone's Java program. It seems a bit like trying to make the csv module type-sensitive. What happens when someone finds a csv file containing timestamps in a format other than the datetime.datetime object will produce by default? Why is None special as an object where bool(obj) is False? I think the better course here is to either: * subclass csv.DictWriter, use dictionaries as your element type, and have its writerow method do the application-specific work. * define a writerow() function which does something similar (essentially wrapping csv.writerow()). If someone else thinks this is something which belongs in Python's csv module, feel free to reopen and assign it to yourself. ---------- resolution: -> rejected _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 18:44:42 2016 From: report at bugs.python.org (Eric Fahlgren) Date: Wed, 02 Mar 2016 23:44:42 +0000 Subject: [issue26448] dis.findlabels ignores EXTENDED_ARG In-Reply-To: <1456545250.68.0.0525262950792.issue26448@psf.upfronthosting.co.za> Message-ID: <1456962282.39.0.985643971274.issue26448@psf.upfronthosting.co.za> Eric Fahlgren added the comment: Barun, take a look at the latest version of the testfindlabels.py, see what you think. If it works for you, maybe move the test function into Lib/test/test_dis.py as part of the standard dis module tests. Still need to look at the code that's being tested and find out what cases could cause problems and then augment the test to make sure it covers those. ---------- Added file: http://bugs.python.org/file42065/dis_with_code_scanner.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 19:02:26 2016 From: report at bugs.python.org (Jakub Stasiak) Date: Thu, 03 Mar 2016 00:02:26 +0000 Subject: [issue26335] Make mmap.write return the number of bytes written like other write methods In-Reply-To: <1455144937.95.0.515520937166.issue26335@psf.upfronthosting.co.za> Message-ID: <1456963346.6.0.877033146656.issue26335@psf.upfronthosting.co.za> Jakub Stasiak added the comment: Glad I could help, thanks for merging! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 19:06:51 2016 From: report at bugs.python.org (Claude Chouinard) Date: Thu, 03 Mar 2016 00:06:51 +0000 Subject: [issue25144] 3.5 Win install fails with "TARGETDIR" In-Reply-To: <1442424932.17.0.0389991499722.issue25144@psf.upfronthosting.co.za> Message-ID: <1456963611.55.0.891651542729.issue25144@psf.upfronthosting.co.za> Claude Chouinard added the comment: To solve the problem with the variable TARGETDIR not being initialized, I called the installation program from the command shell and added the target dir option. c:\Users\xxxx\Downloads>python-3.5.1-amd64.exe TargetDir=c:\Python35 I also us the custom installation option (using the Install Now might not work). You should see that the target dir is properly setup to what you have specified. Now it installed without a problem. ---------- nosy: +Claude _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 20:26:04 2016 From: report at bugs.python.org (Mark Mikofski) Date: Thu, 03 Mar 2016 01:26:04 +0000 Subject: [issue15795] Zipfile.extractall does not preserve file permissions In-Reply-To: <1346106964.12.0.723201722432.issue15795@psf.upfronthosting.co.za> Message-ID: <1456968364.57.0.566028310099.issue15795@psf.upfronthosting.co.za> Mark Mikofski added the comment: same problem in 2.7.5 on Oracle Linux 7.2 ---------- nosy: +bwanamarko _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 00:37:28 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 03 Mar 2016 05:37:28 +0000 Subject: [issue23041] csv needs more quoting rules In-Reply-To: <1418402205.61.0.685044268577.issue23041@psf.upfronthosting.co.za> Message-ID: <1456983448.38.0.23912792163.issue23041@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: The csv module is already type-sensitive (with QUOTE_NONNUMERIC). I agree, that we shouldn't modify the csv module just for one user and one program. If a standard CVS library in Java (or other popular laguages) differentiates between empty string and null value when read from CSV, it would be a serious argument to support this in Python. Quick search don't find this. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 02:09:55 2016 From: report at bugs.python.org (Berker Peksag) Date: Thu, 03 Mar 2016 07:09:55 +0000 Subject: [issue23041] csv needs more quoting rules In-Reply-To: <1418402205.61.0.685044268577.issue23041@psf.upfronthosting.co.za> Message-ID: <1456988995.16.0.821323537962.issue23041@psf.upfronthosting.co.za> Berker Peksag added the comment: I was thinking adding a more flexible API like: ... spamwriter = csv.writer(csvfile, quoting_callable=lambda field: field is not None) ... But that would require too much change in the csv module (or at least its implementation wouldn't be trivial). I agree that subclassing DictWriter is a much better way to achieve this. ---------- stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 03:19:16 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 03 Mar 2016 08:19:16 +0000 Subject: [issue26475] Misleading debugging output for verbose regular expressions Message-ID: <1456993156.69.0.718662373051.issue26475@psf.upfronthosting.co.za> New submission from Serhiy Storchaka: When the verbose mode is switched on by using the inline (?x) flag instead of re.VERBOSE argument, the debugging output is duplicated: once for non-verbose mode and then for verbose mode. >>> import re >>> re.compile(r' (?x)a', re.DEBUG) LITERAL 32 LITERAL 97 LITERAL 97 re.compile(' (?x)a', re.VERBOSE|re.DEBUG) Proposed patch makes the parser to produce only final output for verbose mode. >>> re.compile(r' (?x)a', re.DEBUG) LITERAL 97 re.compile(' (?x)a', re.VERBOSE|re.DEBUG) ---------- assignee: serhiy.storchaka components: Regular Expressions files: re_verbose_debug.patch keywords: patch messages: 261148 nosy: ezio.melotti, mrabarnett, serhiy.storchaka priority: normal severity: normal stage: patch review status: open title: Misleading debugging output for verbose regular expressions type: behavior versions: Python 2.7, Python 3.5, Python 3.6 Added file: http://bugs.python.org/file42066/re_verbose_debug.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 03:31:11 2016 From: report at bugs.python.org (Marc Schlaich) Date: Thu, 03 Mar 2016 08:31:11 +0000 Subject: [issue26434] multiprocessing cannot spawn grandchild from a Windows service In-Reply-To: <1456394207.49.0.123218861266.issue26434@psf.upfronthosting.co.za> Message-ID: <1456993871.07.0.873041240954.issue26434@psf.upfronthosting.co.za> Marc Schlaich added the comment: I can confirm that this patch is working. Maybe the test case can be modified to simulate a "pythonservice.exe" run (by patching sys.executable or something like that) so it can be run without admin privileges. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 03:46:28 2016 From: report at bugs.python.org (INADA Naoki) Date: Thu, 03 Mar 2016 08:46:28 +0000 Subject: [issue25702] Link Time Optimizations support for GCC and CLANG In-Reply-To: <1448269180.86.0.895879966461.issue25702@psf.upfronthosting.co.za> Message-ID: <1456994788.71.0.188676847174.issue25702@psf.upfronthosting.co.za> INADA Naoki added the comment: Can we use LTO without PGO? PGO increases build time few times. ---------- nosy: +naoki _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 03:50:55 2016 From: report at bugs.python.org (gigaplastik) Date: Thu, 03 Mar 2016 08:50:55 +0000 Subject: [issue25852] smtplib's SMTP.connect() should store the server name in ._host for .starttls() In-Reply-To: <1449961162.47.0.978986314472.issue25852@psf.upfronthosting.co.za> Message-ID: <1456995054.99.0.221422557222.issue25852@psf.upfronthosting.co.za> gigaplastik added the comment: Found the same issue independently, but I believe my version of the patch is a little more thoughtful. Since the host is allowed to be supplied in 'hostname:port' format the assignment to ._host should be made _after_ checking (and probably parsing) this format. The reason for this is that ._host is passed to ssl.SSLContext.wrap_socket method where it is used for SNI, defined in [1]. According to this RFC, "[c]urrently, the only server names supported are DNS hostnames; ... Literal IPv4 and IPv6 addresses are not permitted in [HostName]." Checking if hostname passed is really a DNS name and not an IP address is up to ssl library, but here, in .connect method, at least the port number should be stripped off. [1] https://tools.ietf.org/html/rfc4366.html ---------- nosy: +gigaplastik Added file: http://bugs.python.org/file42067/issue25852_v2.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 04:16:31 2016 From: report at bugs.python.org (Michael Felt) Date: Thu, 03 Mar 2016 09:16:31 +0000 Subject: [issue26466] cannot build python 2.7.11 on AIX In-Reply-To: <1456844902.77.0.455974310535.issue26466@psf.upfronthosting.co.za> Message-ID: <1456996591.05.0.19395368857.issue26466@psf.upfronthosting.co.za> Michael Felt added the comment: Would just like to add my heartfelt thanks for the simple hint And, perhaps something to add to the Docs After adding "--without-computed-gotos" I can complete a (default) configure, make, make (DESTDIR=xxx) install of * python-2.7.11 (was not needed for 2.7.10 and earlier 2.7 releases) * python-3.4.4 * python-3.5.1 That said, there may still be some minor issues yet to come - but the root cause of my recent failures (emphasis on my) are resolved. If not in the Dev-Guide paragraph for AIX - please add use --without-computed-gotos when using IBM xlc (aka vac) compiler. Again, THANKS! ---------- components: +Devguide nosy: +ezio.melotti, willingc versions: +Python 3.4, Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 04:16:51 2016 From: report at bugs.python.org (Michael Felt) Date: Thu, 03 Mar 2016 09:16:51 +0000 Subject: [issue26466] could not build python 2.7.11 on AIX In-Reply-To: <1456844902.77.0.455974310535.issue26466@psf.upfronthosting.co.za> Message-ID: <1456996611.25.0.627771806379.issue26466@psf.upfronthosting.co.za> Changes by Michael Felt : ---------- title: cannot build python 2.7.11 on AIX -> could not build python 2.7.11 on AIX _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 04:18:30 2016 From: report at bugs.python.org (Marc Schlaich) Date: Thu, 03 Mar 2016 09:18:30 +0000 Subject: [issue19450] Bug in sqlite in Windows binaries In-Reply-To: <1383131558.55.0.853606379194.issue19450@psf.upfronthosting.co.za> Message-ID: <1456996710.28.0.87632295221.issue19450@psf.upfronthosting.co.za> Marc Schlaich added the comment: This wasn't decided yet for 2.7 so I'm reopening it until a decision is made. I'm still +1 for an update to 3.8.3.1 on Windows so that this is on par with the version on OSX and the version in Python 3. ---------- resolution: fixed -> status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 04:48:43 2016 From: report at bugs.python.org (Alecsandru Patrascu) Date: Thu, 03 Mar 2016 09:48:43 +0000 Subject: [issue25702] Link Time Optimizations support for GCC and CLANG In-Reply-To: <1448269180.86.0.895879966461.issue25702@psf.upfronthosting.co.za> Message-ID: <1456998523.68.0.093857979882.issue25702@psf.upfronthosting.co.za> Alecsandru Patrascu added the comment: Yes, you can use LTO without PGO, but the proposed ways it's more efficient and makes more sense for CPython builds. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 05:15:10 2016 From: report at bugs.python.org (INADA Naoki) Date: Thu, 03 Mar 2016 10:15:10 +0000 Subject: [issue25702] Link Time Optimizations support for GCC and CLANG In-Reply-To: <1448269180.86.0.895879966461.issue25702@psf.upfronthosting.co.za> Message-ID: <1457000110.36.0.727468811511.issue25702@psf.upfronthosting.co.za> INADA Naoki added the comment: Sorry my poor English. I meant that "Does `./configure --with-lto && make` use LTO?". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 05:25:31 2016 From: report at bugs.python.org (Jeroen Demeyer) Date: Thu, 03 Mar 2016 10:25:31 +0000 Subject: [issue26476] Constness in _PyErr_BadInternalCall Message-ID: <1457000731.8.0.704951982949.issue26476@psf.upfronthosting.co.za> New submission from Jeroen Demeyer: PyErr_BadInternalCall() calls _PyErr_BadInternalCall(__FILE__, __LINE__). Since __FILE__ is a string constant, the first argument of _PyErr_BadInternalCall should be a "const char*" instead of a "char*". This is a follow-up to #4949. Most of the patch from #4949 was applied, but not the change to _PyErr_BadInternalCall on Python 2. ---------- components: Interpreter Core files: PyErr_BadInternalCall_const.patch keywords: patch messages: 261156 nosy: jdemeyer priority: normal severity: normal status: open title: Constness in _PyErr_BadInternalCall versions: Python 2.7 Added file: http://bugs.python.org/file42068/PyErr_BadInternalCall_const.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 05:25:47 2016 From: report at bugs.python.org (Jeroen Demeyer) Date: Thu, 03 Mar 2016 10:25:47 +0000 Subject: [issue4949] Constness in PyErr_NewException In-Reply-To: <1231956299.48.0.0179649567226.issue4949@psf.upfronthosting.co.za> Message-ID: <1457000747.02.0.0282203263569.issue4949@psf.upfronthosting.co.za> Jeroen Demeyer added the comment: Follow-up: #26476 ---------- nosy: +jdemeyer _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 06:09:03 2016 From: report at bugs.python.org (Alecsandru Patrascu) Date: Thu, 03 Mar 2016 11:09:03 +0000 Subject: [issue25702] Link Time Optimizations support for GCC and CLANG In-Reply-To: <1448269180.86.0.895879966461.issue25702@psf.upfronthosting.co.za> Message-ID: <1457003343.05.0.598085331265.issue25702@psf.upfronthosting.co.za> Alecsandru Patrascu added the comment: I understand now your question. LTO is not enabled when running just `make`, only in `make profile-opt` ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 06:10:10 2016 From: report at bugs.python.org (STINNER Victor) Date: Thu, 03 Mar 2016 11:10:10 +0000 Subject: [issue26466] could not build python 2.7.11 on AIX In-Reply-To: <1456844902.77.0.455974310535.issue26466@psf.upfronthosting.co.za> Message-ID: <1457003410.04.0.124731415494.issue26466@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- nosy: -haypo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 06:21:00 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 03 Mar 2016 11:21:00 +0000 Subject: [issue26476] Constness in _PyErr_BadInternalCall In-Reply-To: <1457000731.8.0.704951982949.issue26476@psf.upfronthosting.co.za> Message-ID: <1457004060.62.0.832800427764.issue26476@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Was already fixed in 84618b2064c1. It is questionable wherever it should be backported to 2.7. Most other "const" additions were applied only to the default branch (see issue25923, issue24436, issue1772673, issue9369, issue16369, issue12173, issue1419652 and many others). ---------- nosy: +nnorwitz, serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 06:25:37 2016 From: report at bugs.python.org (Jeroen Demeyer) Date: Thu, 03 Mar 2016 11:25:37 +0000 Subject: [issue26476] Constness in _PyErr_BadInternalCall In-Reply-To: <1457000731.8.0.704951982949.issue26476@psf.upfronthosting.co.za> Message-ID: <1457004337.74.0.0190894077257.issue26476@psf.upfronthosting.co.za> Jeroen Demeyer added the comment: > It is questionable wherever it should be backported to 2.7. It violates the C++ standard (for extension modules written in C++), so it's clearly a bug. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 06:59:02 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 03 Mar 2016 11:59:02 +0000 Subject: [issue26476] Constness in _PyErr_BadInternalCall In-Reply-To: <1457000731.8.0.704951982949.issue26476@psf.upfronthosting.co.za> Message-ID: <1457006342.35.0.0971068785955.issue26476@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: CPython is written on C and provides C API. Even if change the signature of one function, this will not help much, because a lot of other functions require "char *" instead of "const char *". There is small disadvantage of changing the signature in a bugfix release. This will lead to incompatibility of your extension with older bugfix releases. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 07:04:24 2016 From: report at bugs.python.org (Thomas Kluyver) Date: Thu, 03 Mar 2016 12:04:24 +0000 Subject: [issue26039] More flexibility in zipfile interface In-Reply-To: <1452179451.89.0.468945044395.issue26039@psf.upfronthosting.co.za> Message-ID: <1457006664.43.0.0725968423036.issue26039@psf.upfronthosting.co.za> Thomas Kluyver added the comment: Serhiy, have you had a chance to look at what the zf.open(mode='w') patch does with the lock? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 07:42:27 2016 From: report at bugs.python.org (Mathieu Dupuy) Date: Thu, 03 Mar 2016 12:42:27 +0000 Subject: [issue2202] urllib2 fails against IIS 6.0 (No support for MD5-sess auth) In-Reply-To: <1204223194.19.0.670418970441.issue2202@psf.upfronthosting.co.za> Message-ID: <1457008947.49.0.899641649392.issue2202@psf.upfronthosting.co.za> Mathieu Dupuy added the comment: I'm waiting for reviews. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 07:48:26 2016 From: report at bugs.python.org (Jeroen Demeyer) Date: Thu, 03 Mar 2016 12:48:26 +0000 Subject: [issue26476] Constness in _PyErr_BadInternalCall In-Reply-To: <1457000731.8.0.704951982949.issue26476@psf.upfronthosting.co.za> Message-ID: <1457009306.65.0.480203772844.issue26476@psf.upfronthosting.co.za> Jeroen Demeyer added the comment: > CPython is written on C and provides C API. If you look at the title of https://docs.python.org/2/extending/extending.html clearly C++ extensions are also supported. > Even if change the signature of one function, this will not help much, because a lot of other functions require "char *" instead of "const char *". I don't know which functions you mean, I only encountered this problem for PyErr_BadInternalCall(). I should also add that the problem cannot be avoided or worked around for PyErr_BadInternalCall() because it's a CPython header itself which does an illegal conversion of a string constant to char*. > This will lead to incompatibility of your extension with older bugfix releases. I don't see why there would be ABI incompatibility. My patch is only adding "const" in the call of a C function. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 08:44:21 2016 From: report at bugs.python.org (Marc Schlaich) Date: Thu, 03 Mar 2016 13:44:21 +0000 Subject: [issue26434] multiprocessing cannot spawn grandchild from a Windows service In-Reply-To: <1456394207.49.0.123218861266.issue26434@psf.upfronthosting.co.za> Message-ID: <1457012661.46.0.441074066385.issue26434@psf.upfronthosting.co.za> Marc Schlaich added the comment: We have some business privilege management solution running which might have corrupted the installation. As no one else is reporting this issue, this is my best guest for this phenomena and I'm going to close this issue. ---------- status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 08:45:05 2016 From: report at bugs.python.org (Marc Schlaich) Date: Thu, 03 Mar 2016 13:45:05 +0000 Subject: [issue26434] multiprocessing cannot spawn grandchild from a Windows service In-Reply-To: <1456394207.49.0.123218861266.issue26434@psf.upfronthosting.co.za> Message-ID: <1457012705.17.0.890559906555.issue26434@psf.upfronthosting.co.za> Marc Schlaich added the comment: Wrong bug... ---------- status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 08:45:39 2016 From: report at bugs.python.org (Marc Schlaich) Date: Thu, 03 Mar 2016 13:45:39 +0000 Subject: [issue25918] AssertionError in lib2to3 on 2.7.11 Windows In-Reply-To: <1450692127.84.0.492153161721.issue25918@psf.upfronthosting.co.za> Message-ID: <1457012739.01.0.962400471496.issue25918@psf.upfronthosting.co.za> Marc Schlaich added the comment: We have some business privilege management solution running which might have corrupted the installation. As no one else is reporting this issue, this is my best guest for this phenomena and I'm going to close this issue. ---------- status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 10:55:54 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 03 Mar 2016 15:55:54 +0000 Subject: [issue26039] More flexibility in zipfile interface In-Reply-To: <1452179451.89.0.468945044395.issue26039@psf.upfronthosting.co.za> Message-ID: <1457020554.27.0.303038223646.issue26039@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Sorry for the delay Thomas. This is complex and important to me issue and I want to be attentive to it. I think we should preserve long existing behavior even if it is not documented (documenting or deprecating it is other issue). Concurrent reading and wring with concurrent reading always (at least since adding ZipFile.open()) worked, but was never documented nor tested. Concurrent writing was added rather as a side effect of issue14099. If there is a benefit from getting rid of it, we can break it. For preserving current behavior ZipFile.open(mode='w') should acquire the lock and it should be released in _ZipWriteFile.close(). I have added other comments on Rietveld. The patch needs to be updated to resolve conflicts with committed zipinfo-from-file5.patch. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 11:11:42 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 03 Mar 2016 16:11:42 +0000 Subject: [issue26476] Constness in _PyErr_BadInternalCall In-Reply-To: <1457000731.8.0.704951982949.issue26476@psf.upfronthosting.co.za> Message-ID: <1457021502.91.0.553127142575.issue26476@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: OK, now I understand. Since _PyErr_BadInternalCall() is private function, we will not break any code. Since it is used only by the PyErr_BadInternalCall() macro and always called with string literal as an argument, C++ user can't use PyErr_BadInternalCall() (without a trick described below). Thus the patch fixes a bug. Thank you Jeroen. The workaround for unpatched Python 2.7 is to undefine the PyErr_BadInternalCall() macro. #undef PyErr_BadInternalCall There is the PyErr_BadInternalCall() function hidden by the macro. It provides less detailed error message, without file name and line number. ---------- assignee: -> serhiy.storchaka stage: -> commit review type: -> compile error _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 11:17:19 2016 From: report at bugs.python.org (Roundup Robot) Date: Thu, 03 Mar 2016 16:17:19 +0000 Subject: [issue26476] Constness in _PyErr_BadInternalCall In-Reply-To: <1457000731.8.0.704951982949.issue26476@psf.upfronthosting.co.za> Message-ID: <20160303161650.89262.44095@psf.io> Roundup Robot added the comment: New changeset 0e3526ab6a9b by Serhiy Storchaka in branch '2.7': Issue #26476: Fixed compilation error when use PyErr_BadInternalCall() in C++. https://hg.python.org/cpython/rev/0e3526ab6a9b ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 11:18:14 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 03 Mar 2016 16:18:14 +0000 Subject: [issue26476] Constness in _PyErr_BadInternalCall In-Reply-To: <1457000731.8.0.704951982949.issue26476@psf.upfronthosting.co.za> Message-ID: <1457021894.53.0.428698859818.issue26476@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- resolution: -> fixed stage: commit review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 12:11:21 2016 From: report at bugs.python.org (Brett Cannon) Date: Thu, 03 Mar 2016 17:11:21 +0000 Subject: [issue26474] ctypes: Memory leak at malloc_closure.c In-Reply-To: <1456955996.67.0.137119059365.issue26474@psf.upfronthosting.co.za> Message-ID: <1457025081.93.0.307491531309.issue26474@psf.upfronthosting.co.za> Brett Cannon added the comment: As Victor pointed out, it's a cache so it's not meant to free its initially allocated memory but to reuse it. Closing this as "not a bug". ---------- nosy: +brett.cannon resolution: -> not a bug status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 13:07:47 2016 From: report at bugs.python.org (Martijn Pieters) Date: Thu, 03 Mar 2016 18:07:47 +0000 Subject: [issue26477] typing forward references and module attributes Message-ID: <1457028467.36.0.208660584048.issue26477@psf.upfronthosting.co.za> New submission from Martijn Pieters: Forward references to a module can fail, if the module doesn't yet have the required object. The "forward references" section names circular dependencies as one use for forward references, but the following example fails: $ cat test/__init__.py from .a import A from .b import B $ cat test/a.py import typing from . import b class A: def foo(self: 'A', bar: typing.Union['b.B', None]): pass $ cat test/b.py import typing from . import a class B: def spam(self: 'B', eggs: typing.Union['a.A', None]): pass $ bin/python -c 'import test' Traceback (most recent call last): File "", line 1, in File "/Users/mjpieters/Development/venvs/stackoverflow-3.5/test/__init__.py", line 1, in from .a import A File "/Users/mjpieters/Development/venvs/stackoverflow-3.5/test/a.py", line 2, in from . import b File "/Users/mjpieters/Development/venvs/stackoverflow-3.5/test/b.py", line 4, in class B: File "/Users/mjpieters/Development/venvs/stackoverflow-3.5/test/b.py", line 5, in B def spam(self: 'B', eggs: typing.Union['a.A', None]): File "/Users/mjpieters/Development/Library/buildout.python/parts/opt/lib/python3.5/typing.py", line 537, in __getitem__ dict(self.__dict__), parameters, _root=True) File "/Users/mjpieters/Development/Library/buildout.python/parts/opt/lib/python3.5/typing.py", line 494, in __new__ for t2 in all_params - {t1} if not isinstance(t2, TypeVar)): File "/Users/mjpieters/Development/Library/buildout.python/parts/opt/lib/python3.5/typing.py", line 494, in for t2 in all_params - {t1} if not isinstance(t2, TypeVar)): File "/Users/mjpieters/Development/Library/buildout.python/parts/opt/lib/python3.5/typing.py", line 185, in __subclasscheck__ self._eval_type(globalns, localns) File "/Users/mjpieters/Development/Library/buildout.python/parts/opt/lib/python3.5/typing.py", line 172, in _eval_type eval(self.__forward_code__, globalns, localns), File "", line 1, in AttributeError: module 'test.a' has no attribute 'A' The forward reference test fails because only NameError exceptions are caught, not AttributeError exceptions. ---------- components: Library (Lib) messages: 261172 nosy: mjpieters priority: normal severity: normal status: open title: typing forward references and module attributes versions: Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 13:11:39 2016 From: report at bugs.python.org (Martijn Pieters) Date: Thu, 03 Mar 2016 18:11:39 +0000 Subject: [issue26477] typing forward references and module attributes In-Reply-To: <1457028467.36.0.208660584048.issue26477@psf.upfronthosting.co.za> Message-ID: <1457028699.66.0.294007627393.issue26477@psf.upfronthosting.co.za> Martijn Pieters added the comment: Sorry, that should have read "the forward references section of PEP 484". The section uses this example: # File models/a.py from models import b class A(Model): def foo(self, b: 'b.B'): ... # File models/b.py from models import a class B(Model): def bar(self, a: 'a.A'): ... # File main.py from models.a import A from models.b import B which doesn't fail because the forward references are not being tested until after all imports have completed; creating a Union however triggers a subclass test between the different types in the union. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 13:17:39 2016 From: report at bugs.python.org (Martijn Pieters) Date: Thu, 03 Mar 2016 18:17:39 +0000 Subject: [issue26477] typing forward references and module attributes In-Reply-To: <1457028467.36.0.208660584048.issue26477@psf.upfronthosting.co.za> Message-ID: <1457029059.35.0.118883999775.issue26477@psf.upfronthosting.co.za> Martijn Pieters added the comment: A temporary work-around is to use a function to raise a NameError exception when the module attribute doesn't exist yet: def _forward_A_reference(): try: return a.A except AttributeError: # not yet.. raise NameError('A') class B: def spam(self: 'B', eggs: typing.Union['_forward_A_reference()', None]): pass ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 13:24:18 2016 From: report at bugs.python.org (=?utf-8?q?Alex_Gr=C3=B6nholm?=) Date: Thu, 03 Mar 2016 18:24:18 +0000 Subject: [issue26477] typing forward references and module attributes In-Reply-To: <1457028467.36.0.208660584048.issue26477@psf.upfronthosting.co.za> Message-ID: <1457029458.32.0.509801227882.issue26477@psf.upfronthosting.co.za> Alex Gr?nholm added the comment: I wonder why they forward references are evaluated *at all* at this point. Seems senseless to me. This should be the job of the static type checker or the get_type_hints() function. ---------- nosy: +alex.gronholm _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 13:30:50 2016 From: report at bugs.python.org (Antti Haapala) Date: Thu, 03 Mar 2016 18:30:50 +0000 Subject: [issue26477] typing forward references and module attributes In-Reply-To: <1457028467.36.0.208660584048.issue26477@psf.upfronthosting.co.za> Message-ID: <1457029850.07.0.727345217528.issue26477@psf.upfronthosting.co.za> Antti Haapala added the comment: Indeed, the assumption is be that if a string is used, it is used there because the actual thing cannot be referenced by name at that point. Then trying to evaluate it at all would be an optimization in only those cases where it is used incorrectly / needlessly. ---------- nosy: +ztane _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 13:38:13 2016 From: report at bugs.python.org (Martijn Pieters) Date: Thu, 03 Mar 2016 18:38:13 +0000 Subject: [issue26477] typing forward references and module attributes In-Reply-To: <1457028467.36.0.208660584048.issue26477@psf.upfronthosting.co.za> Message-ID: <1457030293.4.0.045702233785.issue26477@psf.upfronthosting.co.za> Martijn Pieters added the comment: > I wonder why they forward references are evaluated *at all* at this point. The Union type tries to reduce the set of allowed types by removing any subclasses (so Union[int, bool] becomes Union[int] only). That's all fine, but it should not at that point fail if a forward reference is not available yet. Arguably, the except NameError there should be converted to a except Exception, since forward references are supposed to be *a valid Python expression [...] and it should evaluate without errors once the module has been fully loaded.* (from the PEP); anything goes, and thus any error goes until the module is loaded. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 16:30:02 2016 From: report at bugs.python.org (Zachary Ware) Date: Thu, 03 Mar 2016 21:30:02 +0000 Subject: [issue26456] import _tkinter + TestForkInThread leaves zombie with stalled thread In-Reply-To: <1456727351.62.0.83247971741.issue26456@psf.upfronthosting.co.za> Message-ID: <1457040602.1.0.446130962598.issue26456@psf.upfronthosting.co.za> Zachary Ware added the comment: I can confirm that child-exit.patch fixes the immediate issue, so I'm +1 on just committing it since it will make several buildbots useful again. Improving general handling of the situation can be done in a new issue. For the record, I agree that this seems to be a relatively recent phenomenon. I tried bisecting cpython to find a source for it (using `./python -m test.regrtest test_tcl test_thread`), but the bisect just came up with the first changeset that allows _tkinter to actually build. Perhaps Tcl_FindExecutable starting a thread is a new thing? ---------- assignee: -> martin.panter stage: -> commit review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 17:26:43 2016 From: report at bugs.python.org (Steve Dower) Date: Thu, 03 Mar 2016 22:26:43 +0000 Subject: [issue26268] Update python.org installers to use OpenSSL 1.0.2f In-Reply-To: <1454441057.55.0.0354413518189.issue26268@psf.upfronthosting.co.za> Message-ID: <1457044003.26.0.653772625652.issue26268@psf.upfronthosting.co.za> Steve Dower added the comment: Doesn't really matter, since we get to do it all again with #26465. ---------- resolution: fixed -> out of date stage: commit review -> resolved status: pending -> closed superseder: -> Upgrade OpenSSL shipped with python installers _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 18:20:42 2016 From: report at bugs.python.org (Josh Rosenberg) Date: Thu, 03 Mar 2016 23:20:42 +0000 Subject: [issue26478] dict views don't implement subtraction correctly Message-ID: <1457047242.91.0.370937418553.issue26478@psf.upfronthosting.co.za> New submission from Josh Rosenberg: Don't know when the problem was introduced, but dictviews_sub is doing: tmp = _PyObject_CallMethodId(result, &PyId_difference_update, "O", other); to implement subtraction (after creating result as a set of the keys in question). That's violating the CallMethod contract though (which states the format string should produce a tuple), and while it looks like CallMethod does fixups when the contract is violated, this creates some very odd behaviors. With a list, everything is fine: >>> d = {0: 'zero', 1: 'one', 2: 'two', 3: 'three'} >>> d.keys() - [0, 2] {1, 3} >>> d.keys() - (0, 2) TypeError: 'int' object is not iterable Basically, the fix up doesn't get applied when you subtract a tuple, so it's as if it's trying to call: result.difference_update(*(0, 2)) # Unpacking used to illustrate, effect is result.difference_update(0, 2) With the list, it's wrapping to make a one element tuple, so it behaves like: result.difference_update(*([0, 2],)) # Unpacking used to illustrate, effect is result.difference_update([0, 2]) For more details, see http://stackoverflow.com/q/35784258/364696 Fix should be to change call line to: tmp = _PyObject_CallMethodObjArgsId(result, &PyId_difference_update, other, NULL); (assuming _PyObject_CallMethodObjArgsId is a thing), or if it's not a thing, to fix the format string to force tuple wrapping: tmp = _PyObject_CallMethodId(result, &PyId_difference_update, "(O)", other); ---------- messages: 261180 nosy: josh.r priority: normal severity: normal status: open title: dict views don't implement subtraction correctly versions: Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 18:25:07 2016 From: report at bugs.python.org (Josh Rosenberg) Date: Thu, 03 Mar 2016 23:25:07 +0000 Subject: [issue26478] dict views don't implement subtraction correctly In-Reply-To: <1457047242.91.0.370937418553.issue26478@psf.upfronthosting.co.za> Message-ID: <1457047507.01.0.53475039996.issue26478@psf.upfronthosting.co.za> Changes by Josh Rosenberg : ---------- components: +Interpreter Core _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 20:32:42 2016 From: report at bugs.python.org (INADA Naoki) Date: Fri, 04 Mar 2016 01:32:42 +0000 Subject: [issue25702] Link Time Optimizations support for GCC and CLANG In-Reply-To: <1448269180.86.0.895879966461.issue25702@psf.upfronthosting.co.za> Message-ID: <1457055162.46.0.101182280758.issue25702@psf.upfronthosting.co.za> INADA Naoki added the comment: I've tried LTO without PGO in Debian Jessie. $ LTOFLAGS='-flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none' $ CFLAGS=$LTOFLAGS LDFLAGS=$LTOFLAGS ./configure --prefix=... $ make -j32 results is here (compared with neither LTO and PGO): Test minimum run-time average run-time this other diff this other diff ------------------------------------------------------------------------------- BuiltinFunctionCalls: 47ms 50ms -6.6% 48ms 51ms -6.0% BuiltinMethodLookup: 29ms 29ms -1.3% 29ms 29ms -0.1% CompareFloats: 32ms 33ms -2.8% 34ms 34ms -0.5% CompareFloatsIntegers: 67ms 70ms -3.9% 69ms 71ms -3.1% CompareIntegers: 48ms 46ms +5.1% 49ms 47ms +5.8% CompareInternedStrings: 30ms 31ms -1.9% 31ms 31ms -1.6% CompareLongs: 28ms 26ms +8.0% 29ms 27ms +8.5% CompareStrings: 26ms 26ms -0.9% 27ms 26ms +1.5% ComplexPythonFunctionCalls: 47ms 51ms -8.9% 48ms 52ms -7.8% ConcatStrings: 32ms 33ms -3.2% 33ms 34ms -2.2% CreateInstances: 51ms 52ms -2.5% 52ms 53ms -3.5% CreateNewInstances: 38ms 40ms -4.5% 39ms 41ms -4.4% CreateStringsWithConcat: 68ms 69ms -1.4% 70ms 71ms -0.4% DictCreation: 53ms 51ms +5.2% 55ms 52ms +6.7% DictWithFloatKeys: 41ms 42ms -2.2% 43ms 43ms -0.0% DictWithIntegerKeys: 34ms 34ms +0.1% 35ms 35ms +0.5% DictWithStringKeys: 31ms 32ms -1.3% 32ms 32ms -1.6% ForLoops: 26ms 30ms -12.1% 28ms 30ms -8.7% IfThenElse: 42ms 41ms +2.6% 43ms 41ms +5.0% ListSlicing: 40ms 40ms -0.8% 41ms 41ms -0.4% NestedForLoops: 42ms 42ms -0.3% 43ms 43ms +0.6% NestedListComprehensions: 42ms 47ms -11.9% 45ms 50ms -10.5% NormalClassAttribute: 89ms 96ms -7.9% 92ms 98ms -5.9% NormalInstanceAttribute: 47ms 45ms +4.8% 48ms 45ms +4.9% PythonFunctionCalls: 41ms 44ms -7.5% 41ms 45ms -7.4% PythonMethodCalls: 53ms 59ms -9.4% 55ms 60ms -8.5% Recursion: 69ms 73ms -5.1% 71ms 74ms -4.2% SecondImport: 36ms 41ms -12.0% 38ms 42ms -9.9% SecondPackageImport: 45ms 42ms +6.5% 46ms 43ms +7.0% SecondSubmoduleImport: 115ms 107ms +7.9% 117ms 108ms +7.9% SimpleComplexArithmetic: 27ms 29ms -6.5% 28ms 30ms -4.5% SimpleDictManipulation: 60ms 65ms -7.8% 61ms 66ms -7.0% SimpleFloatArithmetic: 33ms 30ms +7.4% 34ms 31ms +8.3% SimpleIntFloatArithmetic: 36ms 38ms -3.3% 37ms 38ms -4.0% SimpleIntegerArithmetic: 36ms 38ms -5.2% 37ms 38ms -4.1% SimpleListComprehensions: 36ms 37ms -3.2% 38ms 41ms -7.5% SimpleListManipulation: 34ms 34ms -1.3% 35ms 38ms -6.8% SimpleLongArithmetic: 26ms 26ms +0.3% 27ms 30ms -7.5% SmallLists: 45ms 47ms -4.1% 46ms 56ms -17.2% SmallTuples: 51ms 54ms -6.3% 53ms 62ms -14.8% SpecialClassAttribute: 92ms 97ms -5.0% 95ms 99ms -4.8% SpecialInstanceAttribute: 46ms 45ms +2.5% 48ms 46ms +3.9% StringMappings: 71ms 100ms -29.0% 73ms 101ms -27.8% StringPredicates: 49ms 59ms -17.8% 50ms 60ms -16.5% StringSlicing: 48ms 47ms +3.3% 79ms 47ms +66.2% TryExcept: 24ms 29ms -16.9% 25ms 30ms -15.8% TryFinally: 35ms 37ms -6.0% 36ms 38ms -4.6% TryRaiseExcept: 12ms 13ms -7.5% 13ms 14ms -7.2% TupleSlicing: 48ms 50ms -2.9% 49ms 51ms -2.7% WithFinally: 52ms 57ms -8.4% 53ms 58ms -8.2% WithRaiseExcept: 42ms 46ms -8.8% 43ms 47ms -9.1% ------------------------------------------------------------------------------- Totals: 2291ms 2398ms -4.5% 2390ms 2470ms -3.2% (this=lto.pybench, other=default.pybench) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 21:35:37 2016 From: report at bugs.python.org (Xiang Zhang) Date: Fri, 04 Mar 2016 02:35:37 +0000 Subject: [issue26478] dict views don't implement subtraction correctly In-Reply-To: <1457047242.91.0.370937418553.issue26478@psf.upfronthosting.co.za> Message-ID: <1457058937.76.0.3986121799.issue26478@psf.upfronthosting.co.za> Changes by Xiang Zhang <18518281186 at 126.com>: ---------- nosy: +xiang.zhang _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 4 01:11:05 2016 From: report at bugs.python.org (Roundup Robot) Date: Fri, 04 Mar 2016 06:11:05 +0000 Subject: [issue26478] dict views don't implement subtraction correctly In-Reply-To: <1457047242.91.0.370937418553.issue26478@psf.upfronthosting.co.za> Message-ID: <20160304061102.31083.30480@psf.io> Roundup Robot added the comment: New changeset 0cae6b6e3d7d by Benjamin Peterson in branch '3.4': properly use the ObjArgs variant of CallMethod in dictview binary operations (closes #26478) https://hg.python.org/cpython/rev/0cae6b6e3d7d New changeset a5bc5c9490f5 by Benjamin Peterson in branch '3.5': merge 3.4 (closes #26478) https://hg.python.org/cpython/rev/a5bc5c9490f5 New changeset 9532a8815a9c by Benjamin Peterson in branch 'default': merge 3.5 (closes #26478) https://hg.python.org/cpython/rev/9532a8815a9c ---------- nosy: +python-dev resolution: -> fixed stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 4 02:18:31 2016 From: report at bugs.python.org (Alecsandru Patrascu) Date: Fri, 04 Mar 2016 07:18:31 +0000 Subject: [issue25702] Link Time Optimizations support for GCC and CLANG In-Reply-To: <1448269180.86.0.895879966461.issue25702@psf.upfronthosting.co.za> Message-ID: <1457075911.33.0.0325673189975.issue25702@psf.upfronthosting.co.za> Alecsandru Patrascu added the comment: >From our experience, pybench only is not a representative benchmark. Instead, if you like to measure performance close to real workloads, you can run the Grand Unified Python Benchmark suite, that is more complete. Also, you need to take into consideration the hardware and software environment. For this, you can read the initial comment at this issue, section "Hardware and OS Configuration", to see the approach we have here at Intel. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 4 03:20:01 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 04 Mar 2016 08:20:01 +0000 Subject: [issue26456] import _tkinter + TestForkInThread leaves zombie with stalled thread In-Reply-To: <1456727351.62.0.83247971741.issue26456@psf.upfronthosting.co.za> Message-ID: <1457079601.28.0.800219583221.issue26456@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: But please add a reference to this issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 4 08:14:18 2016 From: report at bugs.python.org (Samuel Colvin) Date: Fri, 04 Mar 2016 13:14:18 +0000 Subject: [issue26479] Init documentation typo "may be return" > "may NOT be returned" Message-ID: <1457097258.8.0.064409213234.issue26479@psf.upfronthosting.co.za> New submission from Samuel Colvin: https://docs.python.org/3/reference/datamodel.html#object.__init__ "no non-None value may be returned by __init__();" should read "no non-None value may *not* be returned by __init__();" ---------- assignee: docs at python components: Documentation messages: 261185 nosy: Samuel Colvin, docs at python priority: normal severity: normal status: open title: Init documentation typo "may be return" > "may NOT be returned" versions: Python 3.4, Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 4 08:23:15 2016 From: report at bugs.python.org (Ronald Oussoren) Date: Fri, 04 Mar 2016 13:23:15 +0000 Subject: [issue26479] Init documentation typo "may be return" > "may NOT be returned" In-Reply-To: <1457097258.8.0.064409213234.issue26479@psf.upfronthosting.co.za> Message-ID: <1457097795.53.0.448274692542.issue26479@psf.upfronthosting.co.za> Ronald Oussoren added the comment: The text appears to be correct as it is. What is says is that __init__ must not return any value other than None and that is correct, you will get an exception when you return a value that is not None. >>> class C(): ... def __init__(self): return 42 ... >>> >>> C() Traceback (most recent call last): File "", line 1, in TypeError: __init__() should return None, not 'int' >>> The text is basically a language-lawyer way of stating that __init__ should return by either running of the end of the method, or by using a bare return statement. ---------- nosy: +ronaldoussoren _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 4 08:38:53 2016 From: report at bugs.python.org (Michael Felt) Date: Fri, 04 Mar 2016 13:38:53 +0000 Subject: [issue18987] distutils.utils.get_platform() for 32-bit Python on a 64-bit machine In-Reply-To: <1378731781.77.0.0136191125302.issue18987@psf.upfronthosting.co.za> Message-ID: <1457098733.74.0.480651291001.issue18987@psf.upfronthosting.co.za> Michael Felt added the comment: FYI: build as 64-bit (and shall only build as 64-bit from now I expect) and the output works as: ============================== aixtools.python:aixtools.python.man.en_US:2.7.11.0::I:C:::::N:man pages::::0:: aixtools.python:aixtools.python.rte:2.7.11.0::I:C:::::N:built 04-Mar-2016 1232 UTC::::0:: ============================== root at x064:[/data/prj/aixtools/python/python-2.7.11]./python Python 2.7.11 (default, Mar 4 2016, 12:29:39) [C] on aix5 Type "help", "copyright", "credits" or "license" for more information. >>> import sysconfig >>> sysconfig.is_python_build() True >>> import distutils.util >>> distutils.util.get_platform() 'aix-5.3' >>> import os >>> os.uname() ('AIX', 'x064', '3', '5', '00C291F54C00') >>> import platform >>> platform.architecture() ('64bit', '') >>> import os, sys >>> sys.maxsize 9223372036854775807 >>> 2**32 4294967296 >>> I was wondering if there is a PEP statement somewhere re: distutils.util.get_platform() semantics ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 4 09:33:15 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 04 Mar 2016 14:33:15 +0000 Subject: [issue17720] pickle.py's load_appends should call append() on objects other than lists In-Reply-To: <1365876289.91.0.454785839611.issue17720@psf.upfronthosting.co.za> Message-ID: <1457101995.19.0.181758970129.issue17720@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Why this patch was not applied to 2.7? What is the spec of APPENDS? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 4 10:34:47 2016 From: report at bugs.python.org (INADA Naoki) Date: Fri, 04 Mar 2016 15:34:47 +0000 Subject: [issue25702] Link Time Optimizations support for GCC and CLANG In-Reply-To: <1448269180.86.0.895879966461.issue25702@psf.upfronthosting.co.za> Message-ID: <1457105687.11.0.834780965004.issue25702@psf.upfronthosting.co.za> INADA Naoki added the comment: The machine is Google Compute Engine n1-highcpu-32 (Intel Ivy Bridge) Linux bench 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt20-1+deb8u3 (2016-01-17) x86_64 GNU/Linux cpuinfo: processor : 31 vendor_id : GenuineIntel cpu family : 6 model : 62 model name : Intel(R) Xeon(R) CPU @ 2.50GHz stepping : 4 microcode : 0x1 cpu MHz : 2500.000 cache size : 30720 KB command: $ python perf.py -r -b default ../Python-3.5.1/python-default ../Python-3.5.1/python-lto output: Report on Linux bench 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt20-1+deb8u3 (2016-01-17) x86_64 Total CPU cores: 32 ### 2to3 ### Min: 8.692000 -> 8.160000: 1.07x faster Avg: 8.816800 -> 8.253600: 1.07x faster Significant (t=8.07) Stddev: 0.12726 -> 0.09027: 1.4098x smaller ### chameleon_v2 ### Min: 6.756928 -> 6.414046: 1.05x faster Avg: 6.849192 -> 6.666536: 1.03x faster Significant (t=20.88) Stddev: 0.04413 -> 0.07555: 1.7120x larger ### fastpickle ### Min: 0.540906 -> 0.564253: 1.04x slower Avg: 0.549624 -> 0.579263: 1.05x slower Significant (t=-34.29) Stddev: 0.00427 -> 0.00752: 1.7622x larger ### nbody ### Min: 0.260169 -> 0.273837: 1.05x slower Avg: 0.267334 -> 0.280441: 1.05x slower Significant (t=-34.05) Stddev: 0.00257 -> 0.00286: 1.1125x larger ### regex_v8 ### Min: 0.047335 -> 0.044750: 1.06x faster Avg: 0.049424 -> 0.046788: 1.06x faster Significant (t=10.46) Stddev: 0.00174 -> 0.00182: 1.0469x larger The following not significant results are hidden, use -v to show them: django_v3, fastunpickle, json_dump_v2, json_load, tornado_http. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 4 11:02:07 2016 From: report at bugs.python.org (Alecsandru Patrascu) Date: Fri, 04 Mar 2016 16:02:07 +0000 Subject: [issue25702] Link Time Optimizations support for GCC and CLANG In-Reply-To: <1448269180.86.0.895879966461.issue25702@psf.upfronthosting.co.za> Message-ID: <1457107327.47.0.962951239503.issue25702@psf.upfronthosting.co.za> Alecsandru Patrascu added the comment: You are doing measurements on a virtual machine... For sure you are not the only user that has active workloads on the physical machine while you do benchmarks :) On the other hand, the path you are going with just LTO is nice for experiments, but for real-world usages is not feasible. Using it in conjunction with PGO is the way to have the best Python interpreter, and I strongly recommend for you to use the v04 versions of the patches. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 4 11:46:13 2016 From: report at bugs.python.org (yuriy_levchenko) Date: Fri, 04 Mar 2016 16:46:13 +0000 Subject: [issue26480] add a flag that will not give the set a sys.stdin Message-ID: <1457109973.75.0.047131092344.issue26480@psf.upfronthosting.co.za> New submission from yuriy_levchenko: i have Fatal Error "Py_Initialize: can't initialize sys standard streams" because fail to create fd = fileno(stdin); std = create_stdio(iomod, fd, 0, "", encoding, errors); I do not need to create this input|output if i comment this code, and setup __stdin__= None __stdout__= None __stderr__= None all workin fine ---------- messages: 261191 nosy: yuriy_levchenko priority: normal severity: normal status: open title: add a flag that will not give the set a sys.stdin versions: Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 4 11:46:28 2016 From: report at bugs.python.org (yuriy_levchenko) Date: Fri, 04 Mar 2016 16:46:28 +0000 Subject: [issue26480] add a flag that will not give the set a sys.stdin In-Reply-To: <1457109973.75.0.047131092344.issue26480@psf.upfronthosting.co.za> Message-ID: <1457109988.15.0.387356554162.issue26480@psf.upfronthosting.co.za> Changes by yuriy_levchenko : ---------- type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 4 11:55:06 2016 From: report at bugs.python.org (Brett Cannon) Date: Fri, 04 Mar 2016 16:55:06 +0000 Subject: [issue26480] add a flag that will not give the set a sys.stdin In-Reply-To: <1457109973.75.0.047131092344.issue26480@psf.upfronthosting.co.za> Message-ID: <1457110506.63.0.0399555934481.issue26480@psf.upfronthosting.co.za> Changes by Brett Cannon : ---------- type: behavior -> enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 4 12:09:32 2016 From: report at bugs.python.org (Stefan Seefeld) Date: Fri, 04 Mar 2016 17:09:32 +0000 Subject: [issue26481] unittest discovery process not working without .py source files Message-ID: <1457111372.53.0.54879325378.issue26481@psf.upfronthosting.co.za> New submission from Stefan Seefeld: The unittest test discovery right now only looks into sub-packages if they contain a `__init__.py` file. That's an unnecessary requirement, as packages are also importable if only `__init__.pyc` is present. ---------- components: Library (Lib) messages: 261192 nosy: stefan priority: normal severity: normal status: open title: unittest discovery process not working without .py source files _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 4 13:05:39 2016 From: report at bugs.python.org (wim glenn) Date: Fri, 04 Mar 2016 18:05:39 +0000 Subject: [issue26478] dict views don't implement subtraction correctly In-Reply-To: <1457047242.91.0.370937418553.issue26478@psf.upfronthosting.co.za> Message-ID: <1457114739.39.0.0179626942574.issue26478@psf.upfronthosting.co.za> wim glenn added the comment: Well that was patched quickly, impressive turnaround on this ---------- nosy: +wim.glenn _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 4 13:40:44 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 04 Mar 2016 18:40:44 +0000 Subject: [issue26482] Restore pickling recursive dequeues Message-ID: <1457116844.37.0.00274743770094.issue26482@psf.upfronthosting.co.za> New submission from Serhiy Storchaka: Pickling recursive dequeues was added in issue1062279. But then it was reverted in 73f49656420b (unknown issue number). Proposed patch restores pickling recursive dequeues. ---------- assignee: rhettinger components: Library (Lib) files: pickle_recursive_deque.patch keywords: patch messages: 261194 nosy: alexandre.vassalotti, pitrou, rhettinger, serhiy.storchaka priority: normal severity: normal stage: patch review status: open title: Restore pickling recursive dequeues type: enhancement versions: Python 3.6 Added file: http://bugs.python.org/file42069/pickle_recursive_deque.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 4 15:04:57 2016 From: report at bugs.python.org (Ethan Furman) Date: Fri, 04 Mar 2016 20:04:57 +0000 Subject: [issue26483] docs unclear on difference between isdigt() and isdecimal() Message-ID: <1457121897.81.0.495681677897.issue26483@psf.upfronthosting.co.za> New submission from Ethan Furman: The docs use different explanations for what constitutes a decimal verses a digit character; consequently I can't tell if they are the same or different, and if different what the differences are. ----------------------------------------------- https://docs.python.org/3/library/stdtypes.html?#str.isdecimal Return true if all characters in the string are decimal characters and there is at least one character, false otherwise. Decimal characters are those from general category ?Nd?. This category includes digit characters, and all characters that can be used to form decimal-radix numbers, e.g. U+0660, ARABIC-INDIC DIGIT ZERO. ----------------------------------------------- https://docs.python.org/3/library/stdtypes.html?#str.isdigit Return true if all characters in the string are digits and there is at least one character, false otherwise. Digits include decimal characters and digits that need special handling, such as the compatibility superscript digits. Formally, a digit is a character that has the property value Numeric_Type=Digit or Numeric_Type=Decimal. ---------- messages: 261195 nosy: ethan.furman priority: normal severity: normal status: open title: docs unclear on difference between isdigt() and isdecimal() versions: Python 3.4, Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 4 15:09:50 2016 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 04 Mar 2016 20:09:50 +0000 Subject: [issue26459] Windows build instructions are very inaccurate In-Reply-To: <1456756322.44.0.126364143286.issue26459@psf.upfronthosting.co.za> Message-ID: <1457122190.33.0.76494585893.issue26459@psf.upfronthosting.co.za> Terry J. Reedy added the comment: I built 2.7.11 on Win10 last Jan 16 with MCS v.1500 32 bit. I believe that is VS2008. Besides TortoiseHG, which I think is great, I downloaded SlikSVN minimal client only. I somewhat arbitrarily picked it from some svn list. http://www.sliksvn.com/en/download. A suggestion, with note that minimal client is enough, would not help. Tested install with 'svn help'. With that installed, pcbuild + appropriate args downloads all external dependencies needed. F7 in VS GUI builds Python binary, no Perl needed. The docs, including readme.TXT, are much better than 3 or 4 years ago. (At the time, there was an undocumented requirement, to run tkinter, to move/copy some tcl/tk files. Zack fixed the build script to make manual step unneeded.) Obviously still needs improvement. ---------- nosy: +terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 4 15:17:54 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 04 Mar 2016 20:17:54 +0000 Subject: [issue26483] docs unclear on difference between str.isdigit() and str.isdecimal() In-Reply-To: <1457121897.81.0.495681677897.issue26483@psf.upfronthosting.co.za> Message-ID: <1457122674.43.0.248967946905.issue26483@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- title: docs unclear on difference between isdigt() and isdecimal() -> docs unclear on difference between str.isdigit() and str.isdecimal() _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 4 15:19:34 2016 From: report at bugs.python.org (Ezio Melotti) Date: Fri, 04 Mar 2016 20:19:34 +0000 Subject: [issue26483] docs unclear on difference between str.isdigit() and str.isdecimal() In-Reply-To: <1457121897.81.0.495681677897.issue26483@psf.upfronthosting.co.za> Message-ID: <1457122774.23.0.06271891524.issue26483@psf.upfronthosting.co.za> Changes by Ezio Melotti : ---------- assignee: -> docs at python components: +Documentation, Unicode nosy: +docs at python, ezio.melotti, haypo stage: -> needs patch type: -> enhancement versions: +Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 4 15:20:12 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 04 Mar 2016 20:20:12 +0000 Subject: [issue26483] docs unclear on difference between str.isdigit() and str.isdecimal() In-Reply-To: <1457121897.81.0.495681677897.issue26483@psf.upfronthosting.co.za> Message-ID: <1457122811.99.0.255573038045.issue26483@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: >>> chars = ''.join(map(chr, range(sys.maxunicode+1))) >>> digits = ''.join(filter(str.isdigit, chars)) >>> digits '0123456789????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????' >>> decimals = ''.join(filter(str.isdecimal, chars)) >>> decimals '0123456789????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????' >>> ''.join(sorted(set(decimals) - set(digits))) '' >>> ''.join(sorted(set(digits) - set(decimals))) '????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????' ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 4 15:35:29 2016 From: report at bugs.python.org (Ethan Furman) Date: Fri, 04 Mar 2016 20:35:29 +0000 Subject: [issue26483] docs unclear on difference between str.isdigit() and str.isdecimal() In-Reply-To: <1457121897.81.0.495681677897.issue26483@psf.upfronthosting.co.za> Message-ID: <1457123729.15.0.825878866743.issue26483@psf.upfronthosting.co.za> Ethan Furman added the comment: I like those code snippets! Thanks, Serhiy! Just to make sure I have understood correctly: every decimal char is also a digit char, but some digit chars are not decimal chars. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 4 16:02:07 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 04 Mar 2016 21:02:07 +0000 Subject: [issue26483] docs unclear on difference between str.isdigit() and str.isdecimal() In-Reply-To: <1457121897.81.0.495681677897.issue26483@psf.upfronthosting.co.za> Message-ID: <1457125327.62.0.151321027442.issue26483@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Yes. For details you need to read The Unicode Standard. And every decimal character is accepted by the int() constructor, but non-decimal digits are not. >>> for d in decimals: x = int(d) ... >>> for d in set(digits) - set(decimals): ... try: ... int(d) ... except ValueError: ... pass ... else: ... raise AssertionError ... ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 4 16:47:58 2016 From: report at bugs.python.org (Antti Haapala) Date: Fri, 04 Mar 2016 21:47:58 +0000 Subject: [issue25973] Segmentation fault with nonlocal and two underscores In-Reply-To: <1451389204.03.0.825789428132.issue25973@psf.upfronthosting.co.za> Message-ID: <1457128078.7.0.750498071332.issue25973@psf.upfronthosting.co.za> Antti Haapala added the comment: So no fix for 3.4 for an obvious SIGSEGV? % python3 Python 3.4.3 (default, Mar 26 2015, 22:03:40) [GCC 4.9.2] on linux Type "help", "copyright", "credits" or "license" for more information. >>> class A: ... def f(self): ... nonlocal __x ... [4] 19173 segmentation fault (core dumped) python3 ---------- nosy: +ztane _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 4 16:59:16 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 04 Mar 2016 21:59:16 +0000 Subject: [issue25973] Segmentation fault with nonlocal and two underscores In-Reply-To: <1451389204.03.0.825789428132.issue25973@psf.upfronthosting.co.za> Message-ID: <1457128756.94.0.181761168293.issue25973@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Only security fixes are accepted for 3.4. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 4 17:32:34 2016 From: report at bugs.python.org (Jack O'Connor) Date: Fri, 04 Mar 2016 22:32:34 +0000 Subject: [issue24909] Windows: subprocess.Popen: race condition for leaking inheritable handles In-Reply-To: <1440175915.18.0.538138459653.issue24909@psf.upfronthosting.co.za> Message-ID: <1457130754.04.0.218112054243.issue24909@psf.upfronthosting.co.za> Changes by Jack O'Connor : ---------- nosy: +oconnor663 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 4 18:59:01 2016 From: report at bugs.python.org (Julien) Date: Fri, 04 Mar 2016 23:59:01 +0000 Subject: [issue26484] Broken table in /2.7/library/sets.html#set-objects Message-ID: <1457135941.69.0.584697860353.issue26484@psf.upfronthosting.co.za> New submission from Julien: Hi, Since: https://github.com/python/cpython/commit/5fdcdab5794d18adc4c66abdce8639440433ed24#diff-c191394dee92fb4800d40d9a8ba431ee the table is broken (...Doc/library/sets.rst:76: ERROR: Malformed table. ) so it is no longer displayed here: https://docs.python.org/2.7/library/sets.html#set-objects Bests ---------- assignee: docs at python components: Documentation messages: 261202 nosy: docs at python, gregory.p.smith, sizeof priority: normal severity: normal status: open title: Broken table in /2.7/library/sets.html#set-objects type: enhancement versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 4 19:11:28 2016 From: report at bugs.python.org (Brett Cannon) Date: Sat, 05 Mar 2016 00:11:28 +0000 Subject: [issue26446] Mention in the devguide that core dev stuff falls under the PSF CoC In-Reply-To: <1456514667.83.0.674412678031.issue26446@psf.upfronthosting.co.za> Message-ID: <1457136688.8.0.237595876442.issue26446@psf.upfronthosting.co.za> Brett Cannon added the comment: The PSF board passed a resolution in January 2014 that all web-related stuff falls under the CoC: https://www.python.org/psf/records/board/minutes/2014-01-06/#management-of-the-psfs-web-properties. I'm still pushing to get the CoC mentioned in the devguide but I've given up on pushing to explicitly state it for python-dev, bugs.python.org, or anywhere else. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 4 19:14:52 2016 From: report at bugs.python.org (Julien) Date: Sat, 05 Mar 2016 00:14:52 +0000 Subject: [issue26485] Missing newline, raising a warning, in /Doc/license.rst Message-ID: <1457136892.69.0.383889491062.issue26485@psf.upfronthosting.co.za> New submission from Julien: o/ While fixing sphinx-doc warnings, I found this missing newline. Yet the documentation is still correctly rendered. ---------- assignee: docs at python components: Documentation files: missing_newline_in_licence.rst messages: 261204 nosy: docs at python, sizeof priority: normal severity: normal status: open title: Missing newline, raising a warning, in /Doc/license.rst type: enhancement versions: Python 2.7 Added file: http://bugs.python.org/file42070/missing_newline_in_licence.rst _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 4 19:19:45 2016 From: report at bugs.python.org (Julien) Date: Sat, 05 Mar 2016 00:19:45 +0000 Subject: [issue25907] Documentation i18n: Added trans tags in sphinx templates In-Reply-To: <1450456235.45.0.408573494248.issue25907@psf.upfronthosting.co.za> Message-ID: <1457137185.6.0.559167146633.issue25907@psf.upfronthosting.co.za> Changes by Julien : ---------- status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 4 19:22:05 2016 From: report at bugs.python.org (INADA Naoki) Date: Sat, 05 Mar 2016 00:22:05 +0000 Subject: [issue25702] Link Time Optimizations support for GCC and CLANG In-Reply-To: <1448269180.86.0.895879966461.issue25702@psf.upfronthosting.co.za> Message-ID: <1457137325.61.0.875833896554.issue25702@psf.upfronthosting.co.za> INADA Naoki added the comment: > For sure you are not the only user that has active workloads on the physical machine while you do benchmarks :) I think largest machine type I chosen (32core) can avoid sharing physical machine with other users. > On the other hand, the path you are going with just LTO is nice for experiments, but for real-world usages is not feasible. Using it in conjunction with PGO is the way to have the best Python interpreter, and I strongly recommend for you to use the v04 versions of the patches. I agree PGO+LTE is the best. But I want "only LTO" because: 1) It is a pitfall that `./configure --with-lto && make` doesn't use LTO. 2) PGO makes build too slow. For casual usecase, I can wait LTO but not PGO. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 4 19:32:57 2016 From: report at bugs.python.org (Roundup Robot) Date: Sat, 05 Mar 2016 00:32:57 +0000 Subject: [issue26484] Broken table in /2.7/library/sets.html#set-objects In-Reply-To: <1457135941.69.0.584697860353.issue26484@psf.upfronthosting.co.za> Message-ID: <20160305003254.20953.21453@psf.io> Roundup Robot added the comment: New changeset f7a2f81a190c by Gregory P. Smith in branch '2.7': issue26484 - fix the broken table in the doc about len(). https://hg.python.org/cpython/rev/f7a2f81a190c ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 4 19:37:04 2016 From: report at bugs.python.org (Gregory P. Smith) Date: Sat, 05 Mar 2016 00:37:04 +0000 Subject: [issue26484] Broken table in /2.7/library/sets.html#set-objects In-Reply-To: <1457135941.69.0.584697860353.issue26484@psf.upfronthosting.co.za> Message-ID: <1457138224.8.0.90636866876.issue26484@psf.upfronthosting.co.za> Gregory P. Smith added the comment: thanks for reporting this! ---------- resolution: -> fixed status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 4 19:44:43 2016 From: report at bugs.python.org (Gregory P. Smith) Date: Sat, 05 Mar 2016 00:44:43 +0000 Subject: [issue25702] Link Time Optimizations support for GCC and CLANG In-Reply-To: <1448269180.86.0.895879966461.issue25702@psf.upfronthosting.co.za> Message-ID: <1457138683.87.0.590546697051.issue25702@psf.upfronthosting.co.za> Gregory P. Smith added the comment: Piping up from the peanut gallery here: If your use case is not doing release builds for production use, i.e. "casual use", don't bother with either PGO or LTO. It won't matter. Your final build that you Q&A ship should absolutely use those. (nobody's going to disagree with that :) While I would not reject changes that allow --with-lto to work in the absence of PGO, but I don't think it should be anyone's priority. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 4 21:23:34 2016 From: report at bugs.python.org (Berker Peksag) Date: Sat, 05 Mar 2016 02:23:34 +0000 Subject: [issue25907] Documentation i18n: Added trans tags in sphinx templates In-Reply-To: <1450456235.45.0.408573494248.issue25907@psf.upfronthosting.co.za> Message-ID: <1457144614.49.0.354348714709.issue25907@psf.upfronthosting.co.za> Changes by Berker Peksag : ---------- resolution: -> fixed stage: -> resolved _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 5 03:41:19 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 05 Mar 2016 08:41:19 +0000 Subject: [issue26486] Backport some tests to 2.7 Message-ID: <1457167279.6.0.631210847326.issue26486@psf.upfronthosting.co.za> New submission from Serhiy Storchaka: Proposed patch backports some tests that makes sense for 2.7 from 3.x. This adds more assurance that we will not break anything in 2.7 bug fix and didn't break the compatibility unintentionally. ---------- components: Tests files: pickletests_backport.patch keywords: patch messages: 261209 nosy: alexandre.vassalotti, pitrou, serhiy.storchaka priority: normal severity: normal stage: patch review status: open title: Backport some tests to 2.7 type: enhancement versions: Python 2.7 Added file: http://bugs.python.org/file42071/pickletests_backport.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 5 03:53:55 2016 From: report at bugs.python.org (Raymond Hettinger) Date: Sat, 05 Mar 2016 08:53:55 +0000 Subject: [issue26486] Backport some tests to 2.7 In-Reply-To: <1457167279.6.0.631210847326.issue26486@psf.upfronthosting.co.za> Message-ID: <1457168035.82.0.762986882868.issue26486@psf.upfronthosting.co.za> Raymond Hettinger added the comment: +1 These tests may well provide early detection of backport errors. ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 5 05:03:19 2016 From: report at bugs.python.org (Berker Peksag) Date: Sat, 05 Mar 2016 10:03:19 +0000 Subject: [issue20397] distutils --record option does not validate existence of byte-compiled files In-Reply-To: <1390746014.88.0.900467086198.issue20397@psf.upfronthosting.co.za> Message-ID: <1457172199.82.0.998066158712.issue20397@psf.upfronthosting.co.za> Changes by Berker Peksag : ---------- nosy: +berker.peksag versions: -Python 3.2, Python 3.3, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 5 06:55:04 2016 From: report at bugs.python.org (Roundup Robot) Date: Sat, 05 Mar 2016 11:55:04 +0000 Subject: [issue26485] Missing newline, raising a warning, in /Doc/license.rst In-Reply-To: <1457136892.69.0.383889491062.issue26485@psf.upfronthosting.co.za> Message-ID: <20160305115501.116279.77177@psf.io> Roundup Robot added the comment: New changeset f69b777b3b3e by Berker Peksag in branch '2.7': Issue #26485: Fix Sphinx warning in Doc/license.rst https://hg.python.org/cpython/rev/f69b777b3b3e ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 5 06:56:29 2016 From: report at bugs.python.org (Berker Peksag) Date: Sat, 05 Mar 2016 11:56:29 +0000 Subject: [issue26485] Missing newline, raising a warning, in /Doc/license.rst In-Reply-To: <1457136892.69.0.383889491062.issue26485@psf.upfronthosting.co.za> Message-ID: <1457178989.16.0.390811854067.issue26485@psf.upfronthosting.co.za> Berker Peksag added the comment: Thanks, Julien! For the record, here is the warning: Doc/license.rst:350: WARNING: Literal block ends without a blank line; unexpected unindent. ---------- nosy: +berker.peksag resolution: -> fixed stage: -> resolved status: open -> closed type: enhancement -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 5 07:06:07 2016 From: report at bugs.python.org (Roundup Robot) Date: Sat, 05 Mar 2016 12:06:07 +0000 Subject: [issue17940] extra code in argparse.py In-Reply-To: <1368052350.83.0.843381398629.issue17940@psf.upfronthosting.co.za> Message-ID: <20160305120541.9513.79080@psf.io> Roundup Robot added the comment: New changeset be3874cf87f3 by Berker Peksag in branch 'default': Issue #17940: Remove redundant code from _Section.format_help() https://hg.python.org/cpython/rev/be3874cf87f3 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 5 07:06:40 2016 From: report at bugs.python.org (Berker Peksag) Date: Sat, 05 Mar 2016 12:06:40 +0000 Subject: [issue17940] extra code in argparse.py In-Reply-To: <1368052350.83.0.843381398629.issue17940@psf.upfronthosting.co.za> Message-ID: <1457179600.44.0.934255896986.issue17940@psf.upfronthosting.co.za> Berker Peksag added the comment: Thanks! ---------- nosy: +berker.peksag resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.6 -Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 5 07:22:20 2016 From: report at bugs.python.org (Raymond Hettinger) Date: Sat, 05 Mar 2016 12:22:20 +0000 Subject: [issue26482] Restore pickling recursive dequeues In-Reply-To: <1457116844.37.0.00274743770094.issue26482@psf.upfronthosting.co.za> Message-ID: <1457180540.07.0.725131560058.issue26482@psf.upfronthosting.co.za> Raymond Hettinger added the comment: Go ahead. ---------- assignee: rhettinger -> serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 5 11:07:24 2016 From: report at bugs.python.org (Josh Lee) Date: Sat, 05 Mar 2016 16:07:24 +0000 Subject: [issue20215] socketserver can not listen IPv6 address In-Reply-To: <1389319382.42.0.481013787618.issue20215@psf.upfronthosting.co.za> Message-ID: <1457194044.4.0.0870158197539.issue20215@psf.upfronthosting.co.za> Changes by Josh Lee : ---------- nosy: +jleedev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 5 12:21:34 2016 From: report at bugs.python.org (Nick Coghlan) Date: Sat, 05 Mar 2016 17:21:34 +0000 Subject: [issue25973] Segmentation fault with nonlocal and two underscores In-Reply-To: <1451389204.03.0.825789428132.issue25973@psf.upfronthosting.co.za> Message-ID: <1457198494.06.0.616872028933.issue25973@psf.upfronthosting.co.za> Nick Coghlan added the comment: And as some additional background as to why segmentation faults provoked by Python code aren't currently considered a security bug: since CPython doesn't include a security sandbox, we're already relying entirely on the OS to provide process isolation. That OS level security boundary isn't affected by whether the code is running "normally", or in a modified state following a deliberately triggered segmentation fault. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 5 12:55:24 2016 From: report at bugs.python.org (Marc Abramowitz) Date: Sat, 05 Mar 2016 17:55:24 +0000 Subject: [issue6958] Add Python command line flags to configure logging In-Reply-To: <1253532197.53.0.626663388601.issue6958@psf.upfronthosting.co.za> Message-ID: <1457200524.89.0.329811753592.issue6958@psf.upfronthosting.co.za> Marc Abramowitz added the comment: I was just thinking that it would be nice if logging could be configured through environment variables. This would make it easier to have Python applications adhere to the Twelve-Factor methodology around application configuration: http://12factor.net/config Currently, applications need to handle this themselves, but I wonder if there's value in deciding on a best practice and providing for it at a lower level (the stdlib logging module). ---------- nosy: +Marc.Abramowitz _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 5 12:56:49 2016 From: report at bugs.python.org (Aviv Palivoda) Date: Sat, 05 Mar 2016 17:56:49 +0000 Subject: [issue14156] argparse.FileType for '-' doesn't work for a mode of 'rb' In-Reply-To: <1330513271.31.0.437438851478.issue14156@psf.upfronthosting.co.za> Message-ID: <1457200609.67.0.928709672313.issue14156@psf.upfronthosting.co.za> Aviv Palivoda added the comment: I fixed the tests to work with Steven patch. Also changed the patch to open sys.std{in,out} with closefd=False. I changed the 'io.StringIO' that we redirect the stdout, stderr to. Now the 'StdIOBuffer' return the real stdout,stderr when '-' is passed to FileType. This was already done in the 'stderr_to_parser_error' function previously after the call to 'parse_args'. ---------- nosy: +palaviv Added file: http://bugs.python.org/file42072/14156-2.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 5 13:08:45 2016 From: report at bugs.python.org (Marc Abramowitz) Date: Sat, 05 Mar 2016 18:08:45 +0000 Subject: [issue6958] Add Python command line flags to configure logging In-Reply-To: <1253532197.53.0.626663388601.issue6958@psf.upfronthosting.co.za> Message-ID: <1457201325.48.0.0286592334758.issue6958@psf.upfronthosting.co.za> Marc Abramowitz added the comment: I guess I should be more specific about the 12factor thing I just mentioned, because http://12factor.net/logs says: >>> A twelve-factor app never concerns itself with routing or storage of its output stream. It should not attempt to write to or manage logfiles. Instead, each running process writes its event stream, unbuffered, to stdout. During local development, the developer will view this stream in the foreground of their terminal to observe the app?s behavior. >>> The part that I want to be configurable is what the log levels are for various loggers. For example, in production, you probably want most or all of your loggers set to WARN or such. When running in development, ideally the developer can turn on more verbose logging without having to edit config files. e.g.: This is a Pyramid application, but environment variables of course could be used with any kind of application -- Django, etc. ``` LOGGER_ANWEB_LEVEL=debug pserve app.ini ``` ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 5 14:03:29 2016 From: report at bugs.python.org (hanz) Date: Sat, 05 Mar 2016 19:03:29 +0000 Subject: [issue26487] Machine value for fat PowerPC build Message-ID: <1457204609.38.0.708821287838.issue26487@psf.upfronthosting.co.za> New submission from hanz: Building on Mac OS X 10.5.8 (Power Mac G5) for ppc and ppc64 fails with File "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_python27/python27/work/Python-2.7.11/Lib/_osx_support.py", line 485, in get_platform_osx "Don't know machine value for archs=%r" % (archs,)) ValueError: Don't know machine value for archs=('ppc', 'ppc64') generate-posix-vars failed make: *** [pybuilddir.txt] Error 1 If I apply the attached patch, it builds and works fine. Would it be possible to include these changes in Python? ---------- components: Build, Distutils, Macintosh files: patch-plat-ppc-fat.diff keywords: patch messages: 261220 nosy: dstufft, eric.araujo, hanz, ned.deily, ronaldoussoren priority: normal severity: normal status: open title: Machine value for fat PowerPC build type: compile error versions: Python 2.7 Added file: http://bugs.python.org/file42073/patch-plat-ppc-fat.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 5 14:25:25 2016 From: report at bugs.python.org (Ned Deily) Date: Sat, 05 Mar 2016 19:25:25 +0000 Subject: [issue26487] Machine value for fat PowerPC build In-Reply-To: <1457204609.38.0.708821287838.issue26487@psf.upfronthosting.co.za> Message-ID: <1457205925.06.0.868267729201.issue26487@psf.upfronthosting.co.za> Ned Deily added the comment: Thanks for your suggestion. Unfortunately, at the time support for OS X universal builds was added, it was not anticipated that there would be a need for that particular combination of architectures, i.e. just PPC-32 and PPC-64, and, to the best of my knowledge, this is the first time this request has come up. The universal platform names defined in get_platform_osx have become an external standard and are used elsewhere in the Python ecosphere, in particular, in pip and in binary wheels. So adding a new universal platform name at this time for the combination of two long obsolete architectures is probably not a good idea. Options: either build separate single-architecture versions, or add "i386" to use the existing "fat3" definition, or continue to apply the patch yourself. ---------- resolution: -> wont fix stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 5 14:35:17 2016 From: report at bugs.python.org (Jonathan Goble) Date: Sat, 05 Mar 2016 19:35:17 +0000 Subject: [issue25652] collections.UserString.__rmod__() raises NameError In-Reply-To: <1447823769.89.0.495006915909.issue25652@psf.upfronthosting.co.za> Message-ID: <1457206517.55.0.534416805261.issue25652@psf.upfronthosting.co.za> Jonathan Goble added the comment: *ping* Can this be reviewed? It's a simple fix to a problem that happens consistently, and it would be nice to get it into the next bugfix release. ---------- versions: +Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 5 14:48:14 2016 From: report at bugs.python.org (Raymond Hettinger) Date: Sat, 05 Mar 2016 19:48:14 +0000 Subject: [issue25652] collections.UserString.__rmod__() raises NameError In-Reply-To: <1447823769.89.0.495006915909.issue25652@psf.upfronthosting.co.za> Message-ID: <1457207294.74.0.0283914782286.issue25652@psf.upfronthosting.co.za> Raymond Hettinger added the comment: I'll apply this shortly. ---------- stage: -> commit review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 5 16:03:21 2016 From: report at bugs.python.org (Brett Cannon) Date: Sat, 05 Mar 2016 21:03:21 +0000 Subject: [issue26271] freeze.py makefile uses the wrong flags variables In-Reply-To: <1454454135.77.0.499921177416.issue26271@psf.upfronthosting.co.za> Message-ID: <1457211801.6.0.674159142182.issue26271@psf.upfronthosting.co.za> Brett Cannon added the comment: Quick review suggests Daniel's patch does the right thing (based on Tools/freeze/test and looking at the generated Makefile which has PY_LDFLAGS defined). Don't have time to commit it right now, but I will in the near future. ---------- assignee: -> brett.cannon nosy: +brett.cannon stage: -> commit review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 5 16:54:26 2016 From: report at bugs.python.org (Aviv Palivoda) Date: Sat, 05 Mar 2016 21:54:26 +0000 Subject: [issue26488] hashlib command line interface Message-ID: <1457214866.19.0.989950954277.issue26488@psf.upfronthosting.co.za> New submission from Aviv Palivoda: I am suggesting to add a command line interface to the hashlib module. A simple example of the api I suggest is: $ python -m hashlib md5 /bin/sh $ d985d0ea551c1253c2305140c583d11f A patch is included. ---------- components: Library (Lib) files: hashlib-script-mod.patch keywords: patch messages: 261225 nosy: christian.heimes, gregory.p.smith, palaviv priority: normal severity: normal status: open title: hashlib command line interface type: enhancement versions: Python 3.6 Added file: http://bugs.python.org/file42074/hashlib-script-mod.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 5 17:00:40 2016 From: report at bugs.python.org (Guo Ci Teo) Date: Sat, 05 Mar 2016 22:00:40 +0000 Subject: [issue26489] dictionary unpacking operator in dict expression Message-ID: <1457215240.85.0.6201995069.issue26489@psf.upfronthosting.co.za> New submission from Guo Ci Teo: The attached patch enables the unparse.py tool to unparse dictionary unpacking operators (**) in a dict expression, for example, {**{'y': 2}, 'x': 1} , as described in PEP 0448. ---------- components: Demos and Tools files: unpack_in_dict.patch keywords: patch messages: 261226 nosy: guoci priority: normal severity: normal status: open title: dictionary unpacking operator in dict expression type: enhancement versions: Python 3.5, Python 3.6 Added file: http://bugs.python.org/file42075/unpack_in_dict.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 5 18:58:36 2016 From: report at bugs.python.org (Ben Finney) Date: Sat, 05 Mar 2016 23:58:36 +0000 Subject: =?utf-8?b?W2lzc3VlMjY0OTBdIExlYWRpbmcg4oCcMOKAnSBhbGxvd2VkLCBvbmx5IGZv?= =?utf-8?q?r_decimal_zero?= Message-ID: <1457222316.54.0.23701049885.issue26490@psf.upfronthosting.co.za> New submission from Ben Finney: The language reference carves out a special case for decimal zero literals: they may have leading ?0? digits. Non-zero decimal literals may not. This is apparently deliberate: Note that leading zeros in a non-zero decimal number are not allowed. This is for disambiguation with C-style octal literals, which Python used before version 3.0. reference/lexical_analysis.html#integer-literals But the expressed rationale (?for disambiguation with C-style octal literals?) does not explain making decimal zero special compared with non-zero. Is there a good reason for this inconsistency:: 0000 # valid syntax for zero literal 0003 # SyntaxError 0123 # SyntaxError To my reading, they should all cause SyntaxError. What is the rationale for the special case of the first one? ---------- components: Interpreter Core messages: 261227 nosy: bignose priority: normal severity: normal status: open title: Leading ?0? allowed, only for decimal zero 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 Sat Mar 5 21:11:12 2016 From: report at bugs.python.org (Martin Panter) Date: Sun, 06 Mar 2016 02:11:12 +0000 Subject: [issue21042] ctypes.util.find_library() should return full pathname instead of filename in linux In-Reply-To: <1395614835.79.0.900137034576.issue21042@psf.upfronthosting.co.za> Message-ID: <1457230272.1.0.164177154574.issue21042@psf.upfronthosting.co.za> Martin Panter added the comment: No I think this is ready Tam?s. I have been away, but it is on my list of things to catch up on. I won?t add any What?s New entry. ---------- stage: patch review -> commit review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 5 21:16:16 2016 From: report at bugs.python.org (Martin Panter) Date: Sun, 06 Mar 2016 02:16:16 +0000 Subject: [issue25825] AIX shared library extension modules installation broken In-Reply-To: <1449602974.51.0.754649695687.issue25825@psf.upfronthosting.co.za> Message-ID: <1457230576.06.0.431232978993.issue25825@psf.upfronthosting.co.za> Changes by Martin Panter : ---------- stage: -> needs patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 5 21:27:46 2016 From: report at bugs.python.org (Ned Deily) Date: Sun, 06 Mar 2016 02:27:46 +0000 Subject: [issue26481] unittest discovery process not working without .py source files In-Reply-To: <1457111372.53.0.54879325378.issue26481@psf.upfronthosting.co.za> Message-ID: <1457231266.02.0.00199005366883.issue26481@psf.upfronthosting.co.za> Changes by Ned Deily : ---------- nosy: +ezio.melotti, michael.foord, rbcollins _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 6 00:30:53 2016 From: report at bugs.python.org (Steven D'Aprano) Date: Sun, 06 Mar 2016 05:30:53 +0000 Subject: =?utf-8?b?W2lzc3VlMjY0OTBdIExlYWRpbmcg4oCcMOKAnSBhbGxvd2VkLCBvbmx5IGZv?= =?utf-8?q?r_decimal_zero?= In-Reply-To: <1457222316.54.0.23701049885.issue26490@psf.upfronthosting.co.za> Message-ID: <20160306053044.GS12028@ando.pearwood.info> Steven D'Aprano added the comment: This was raised and rejected here: http://bugs.python.org/issue24668 ---------- nosy: +steven.daprano _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 6 00:52:50 2016 From: report at bugs.python.org (Ethan Furman) Date: Sun, 06 Mar 2016 05:52:50 +0000 Subject: =?utf-8?b?W2lzc3VlMjY0OTBdIExlYWRpbmcg4oCcMOKAnSBhbGxvd2VkLCBvbmx5IGZv?= =?utf-8?q?r_decimal_zero?= In-Reply-To: <1457222316.54.0.23701049885.issue26490@psf.upfronthosting.co.za> Message-ID: <1457243570.52.0.780604770897.issue26490@psf.upfronthosting.co.za> Ethan Furman added the comment: Short answer: rationale unknown, but any number of zeroes is still unambiguously zero. Closing as duplicate. ---------- nosy: +ethan.furman resolution: -> duplicate stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 6 01:26:04 2016 From: report at bugs.python.org (Ben Finney) Date: Sun, 06 Mar 2016 06:26:04 +0000 Subject: =?utf-8?b?W2lzc3VlMjY0OTBdIExlYWRpbmcg4oCcMOKAnSBhbGxvd2VkLCBvbmx5IGZv?= =?utf-8?q?r_decimal_zero?= In-Reply-To: <1457222316.54.0.23701049885.issue26490@psf.upfronthosting.co.za> Message-ID: <1457245564.37.0.271824562956.issue26490@psf.upfronthosting.co.za> Ben Finney added the comment: > rationale unknown That's quite a pity. The inconsistency catches people out, and the docs do not make clear why an exception is made. > but any number of zeroes is still unambiguously zero. Of course. But the same is true for ?0003 is unambiguously three?, yet that's invalid syntax. I won't contest closing this report. But the above is not an explanation for the inconsistency. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 6 01:55:49 2016 From: report at bugs.python.org (Roundup Robot) Date: Sun, 06 Mar 2016 06:55:49 +0000 Subject: [issue26482] Restore pickling recursive dequeues In-Reply-To: <1457116844.37.0.00274743770094.issue26482@psf.upfronthosting.co.za> Message-ID: <20160306065545.116303.72923@psf.io> Roundup Robot added the comment: New changeset be993678d4f7 by Serhiy Storchaka in branch 'default': Issue #26482: Allowed pickling recursive dequeues. https://hg.python.org/cpython/rev/be993678d4f7 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 6 02:04:04 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 06 Mar 2016 07:04:04 +0000 Subject: [issue26482] Restore pickling recursive dequeues In-Reply-To: <1457116844.37.0.00274743770094.issue26482@psf.upfronthosting.co.za> Message-ID: <1457247844.95.0.934473406083.issue26482@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Thanks Raymond. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 6 02:06:15 2016 From: report at bugs.python.org (Roundup Robot) Date: Sun, 06 Mar 2016 07:06:15 +0000 Subject: [issue26486] Backport some tests to 2.7 In-Reply-To: <1457167279.6.0.631210847326.issue26486@psf.upfronthosting.co.za> Message-ID: <20160306070611.60682.31618@psf.io> Roundup Robot added the comment: New changeset ea5d01c7997e by Serhiy Storchaka in branch '2.7': Issue #26486: Backported some pickle tests from 3.x. https://hg.python.org/cpython/rev/ea5d01c7997e ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 6 02:08:32 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 06 Mar 2016 07:08:32 +0000 Subject: [issue25652] collections.UserString.__rmod__() raises NameError In-Reply-To: <1447823769.89.0.495006915909.issue25652@psf.upfronthosting.co.za> Message-ID: <1457248112.87.0.385359546622.issue25652@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Would be nice to add some tests. For example: 0 % collections.UserString(''). ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 6 02:10:06 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 06 Mar 2016 07:10:06 +0000 Subject: [issue26486] Backport some tests to 2.7 In-Reply-To: <1457167279.6.0.631210847326.issue26486@psf.upfronthosting.co.za> Message-ID: <1457248206.16.0.19721609649.issue26486@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- assignee: -> serhiy.storchaka resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 6 02:18:07 2016 From: report at bugs.python.org (Roundup Robot) Date: Sun, 06 Mar 2016 07:18:07 +0000 Subject: [issue26475] Misleading debugging output for verbose regular expressions In-Reply-To: <1456993156.69.0.718662373051.issue26475@psf.upfronthosting.co.za> Message-ID: <20160306071804.60706.6004@psf.io> Roundup Robot added the comment: New changeset 910d0256601f by Serhiy Storchaka in branch '3.5': Issue #26475: Fixed debugging output for regular expressions with the (?x) flag. https://hg.python.org/cpython/rev/910d0256601f New changeset b8928725e8cc by Serhiy Storchaka in branch '2.7': Issue #26475: Fixed debugging output for regular expressions with the (?x) flag. https://hg.python.org/cpython/rev/b8928725e8cc New changeset 37cdbe0a16a4 by Serhiy Storchaka in branch 'default': Issue #26475: Fixed debugging output for regular expressions with the (?x) flag. https://hg.python.org/cpython/rev/37cdbe0a16a4 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 6 02:18:28 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 06 Mar 2016 07:18:28 +0000 Subject: [issue26475] Misleading debugging output for verbose regular expressions In-Reply-To: <1456993156.69.0.718662373051.issue26475@psf.upfronthosting.co.za> Message-ID: <1457248708.46.0.739483891484.issue26475@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 6 02:20:55 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 06 Mar 2016 07:20:55 +0000 Subject: [issue25718] itertools.accumulate __reduce__/__setstate__ bug In-Reply-To: <1448352443.54.0.731172452763.issue25718@psf.upfronthosting.co.za> Message-ID: <1457248855.11.0.0296278563693.issue25718@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Raymond, could you please look at the patch? ---------- assignee: kristjan.jonsson -> rhettinger nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 6 02:22:00 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 06 Mar 2016 07:22:00 +0000 Subject: [issue23718] strptime() can produce invalid date with negative year day In-Reply-To: <1426851032.32.0.560407728917.issue23718@psf.upfronthosting.co.za> Message-ID: <1457248920.41.0.251092415999.issue23718@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- assignee: -> serhiy.storchaka stage: test needed -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 6 02:26:32 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 06 Mar 2016 07:26:32 +0000 Subject: [issue23718] strptime() can produce invalid date with negative year day In-Reply-To: <1426851032.32.0.560407728917.issue23718@psf.upfronthosting.co.za> Message-ID: <1457249192.73.0.765331109008.issue23718@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: LGTM. Alexander, what would you say? ---------- stage: patch review -> commit review versions: +Python 3.6 -Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 6 02:28:11 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 06 Mar 2016 07:28:11 +0000 Subject: [issue26015] Add new tests for pickling iterators of mutable sequences In-Reply-To: <1452005257.2.0.950563811675.issue26015@psf.upfronthosting.co.za> Message-ID: <1457249291.22.0.691065752025.issue26015@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- assignee: -> rhettinger nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 6 02:28:29 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 06 Mar 2016 07:28:29 +0000 Subject: [issue25776] More compact pickle of iterators etc In-Reply-To: <1449052155.68.0.447852149746.issue25776@psf.upfronthosting.co.za> Message-ID: <1457249309.06.0.106921725265.issue25776@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- assignee: -> rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 6 03:14:14 2016 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 06 Mar 2016 08:14:14 +0000 Subject: [issue25652] collections.UserString.__rmod__() raises NameError In-Reply-To: <1447823769.89.0.495006915909.issue25652@psf.upfronthosting.co.za> Message-ID: <1457252053.99.0.769448082282.issue25652@psf.upfronthosting.co.za> Raymond Hettinger added the comment: The UserString1 patch is incorrect as it leads to infinite recursion because the __rmod__ operation only gets called when the other argument doesn't have __mod__. One possible fix is to coerce the template to a regular str: def __rmod__(self, template): return self.__class__(str(template) % self) That would get the following test to pass: class S: 'strlike class without a __mod__' def __init__(self, value): self.value = value def __str__(self): return str(self.value) assert S('say %s') % UserString('hello') == 'say hello' That said, the goal of UserString is to parallel what a regular string would do. In this case, a TypeError is raised: >>> print(S('answer is %s') % 'hello') Traceback (most recent call last): ... TypeError: unsupported operand type(s) for %: 'S' and 'str' Serhiy, what do you think should be done, coerce to a str or remove the __rmod__ method entirely? ---------- assignee: rhettinger -> serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 6 04:36:34 2016 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 06 Mar 2016 09:36:34 +0000 Subject: [issue26167] Improve copy.copy speed for built-in types (list/set/dict) In-Reply-To: <1453313258.69.0.822432262864.issue26167@psf.upfronthosting.co.za> Message-ID: <1457256994.96.0.689865799504.issue26167@psf.upfronthosting.co.za> Raymond Hettinger added the comment: One suggestion: def _deepcopy_list(x, memo, deepcopy=deepcopy): y = [] memo[id(x)] = y y[:] = [deepcopy(a, memo) for a in x] return y This looks nicer and should run faster by taking advantage of the LIST_APPEND opcode. It should be noted that the core concept of the patch is all about the minimizing the calling overhead of the copying operation (the cost to call type(x) and the overhead in the type constructors for parsing the positional and keyword arguments). When it comes to actually copying the data in the containers, there underlying code to do the copying is the same for both the patched and unpatched version (that is why you see a speed-up for copying empty containers and almost no change for containers that have data in them). ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 6 05:04:37 2016 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 06 Mar 2016 10:04:37 +0000 Subject: [issue25776] More compact pickle of iterators etc In-Reply-To: <1449052155.68.0.447852149746.issue25776@psf.upfronthosting.co.za> Message-ID: <1457258677.16.0.0288616501834.issue25776@psf.upfronthosting.co.za> Raymond Hettinger added the comment: My first impression is that this isn't worth the extra special case code. The savings is very small (only a few bytes) and it isn't common to pickle these iterators. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 6 05:23:02 2016 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 06 Mar 2016 10:23:02 +0000 Subject: [issue26491] Defer DECREFs until enum object is in a consistent state for re-entrancy Message-ID: <1457259782.6.0.6533551123.issue26491@psf.upfronthosting.co.za> Changes by Raymond Hettinger : ---------- assignee: serhiy.storchaka components: Interpreter Core files: enumerate_defer_decref.diff keywords: patch nosy: rhettinger, serhiy.storchaka priority: normal severity: normal stage: patch review status: open title: Defer DECREFs until enum object is in a consistent state for re-entrancy type: behavior versions: Python 2.7, Python 3.5, Python 3.6 Added file: http://bugs.python.org/file42076/enumerate_defer_decref.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 6 05:36:57 2016 From: report at bugs.python.org (Berker Peksag) Date: Sun, 06 Mar 2016 10:36:57 +0000 Subject: =?utf-8?b?W2lzc3VlMjY0OTBdIExlYWRpbmcg4oCcMOKAnSBhbGxvd2VkLCBvbmx5IGZv?= =?utf-8?q?r_decimal_zero?= In-Reply-To: <1457222316.54.0.23701049885.issue26490@psf.upfronthosting.co.za> Message-ID: <1457260617.2.0.499259445997.issue26490@psf.upfronthosting.co.za> Changes by Berker Peksag : ---------- superseder: -> Deprecate 00000 as a synonym for 0 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 6 05:42:26 2016 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 06 Mar 2016 10:42:26 +0000 Subject: [issue25718] itertools.accumulate __reduce__/__setstate__ bug In-Reply-To: <1448352443.54.0.731172452763.issue25718@psf.upfronthosting.co.za> Message-ID: <1457260946.12.0.306629486427.issue25718@psf.upfronthosting.co.za> Raymond Hettinger added the comment: +1 ---------- assignee: rhettinger -> serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 6 05:46:35 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 06 Mar 2016 10:46:35 +0000 Subject: [issue26167] Improve copy.copy speed for built-in types (list/set/dict) In-Reply-To: <1453313258.69.0.822432262864.issue26167@psf.upfronthosting.co.za> Message-ID: <1457261195.42.0.0840067427889.issue26167@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: > This looks nicer and should run faster by taking advantage of the LIST_APPEND opcode. The difference is insignificantly (less than 1%) for large lists (list(range(10000))), but it is 3-4% slower for small lists (list(range(10))) and 20-25% slower for empty lists. On 2.7 your code always has advantage, but on 3.x seems it doesn't have any advantage (thanks to overhead of using a generator). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 6 06:20:19 2016 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 06 Mar 2016 11:20:19 +0000 Subject: [issue26015] Add new tests for pickling iterators of mutable sequences In-Reply-To: <1452005257.2.0.950563811675.issue26015@psf.upfronthosting.co.za> Message-ID: <1457263219.67.0.34481931246.issue26015@psf.upfronthosting.co.za> Raymond Hettinger added the comment: These tests look fine. I won't miss "orgit" ;-) In test_reversed_pickle, please add the blank line before each section like you did for the other tests. I agree that exhausted array iterator should change to match the others. Once an iterator is exhausted, it is required to remain exhausted even if the underlying data mutates. That rule should survive even after dumping and loading. ---------- assignee: rhettinger -> serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 6 06:24:13 2016 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 06 Mar 2016 11:24:13 +0000 Subject: [issue26167] Improve copy.copy speed for built-in types (list/set/dict) In-Reply-To: <1453313258.69.0.822432262864.issue26167@psf.upfronthosting.co.za> Message-ID: <1457263452.97.0.10693783811.issue26167@psf.upfronthosting.co.za> Raymond Hettinger added the comment: Then go ahead with the patch as is. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 6 06:45:26 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 06 Mar 2016 11:45:26 +0000 Subject: [issue26491] Defer DECREFs until enum object is in a consistent state for re-entrancy Message-ID: <1457264726.34.0.955181545994.issue26491@psf.upfronthosting.co.za> New submission from Serhiy Storchaka: I don't see possible bug here. The first item of the tuple is always int or None. It's decrefing don't trigger executing user code. The second item of the tuple is decrefed when the refcount of the tuple is 2 and we own all references. The code triggered by decrefing the old item can't use the tuple (since its refcount is not 1 now), nor free the new index or new item (since we take the ownership of them). I think this patch is not needed. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 6 07:02:59 2016 From: report at bugs.python.org (Roundup Robot) Date: Sun, 06 Mar 2016 12:02:59 +0000 Subject: [issue25718] itertools.accumulate __reduce__/__setstate__ bug In-Reply-To: <1448352443.54.0.731172452763.issue25718@psf.upfronthosting.co.za> Message-ID: <20160306120247.10714.79720@psf.io> Roundup Robot added the comment: New changeset f3c54cbac3de by Serhiy Storchaka in branch '3.5': Issue #25718: Fixed pickling and copying the accumulate() iterator with total is None. https://hg.python.org/cpython/rev/f3c54cbac3de New changeset 49c035b30e18 by Serhiy Storchaka in branch 'default': Issue #25718: Fixed pickling and copying the accumulate() iterator with total is None. https://hg.python.org/cpython/rev/49c035b30e18 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 6 07:12:26 2016 From: report at bugs.python.org (Roundup Robot) Date: Sun, 06 Mar 2016 12:12:26 +0000 Subject: [issue26015] Add new tests for pickling iterators of mutable sequences In-Reply-To: <1452005257.2.0.950563811675.issue26015@psf.upfronthosting.co.za> Message-ID: <20160306121223.29621.91602@psf.io> Roundup Robot added the comment: New changeset dfef42311c71 by Serhiy Storchaka in branch '3.5': Issue #26015: Added new tests for pickling iterators of mutable sequences. https://hg.python.org/cpython/rev/dfef42311c71 New changeset be96b2784f73 by Serhiy Storchaka in branch 'default': Issue #26015: Added new tests for pickling iterators of mutable sequences. https://hg.python.org/cpython/rev/be96b2784f73 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 6 07:34:10 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 06 Mar 2016 12:34:10 +0000 Subject: [issue26015] Add new tests for pickling iterators of mutable sequences In-Reply-To: <1452005257.2.0.950563811675.issue26015@psf.upfronthosting.co.za> Message-ID: <1457267650.45.0.358291087806.issue26015@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: In 2.7 iterators are not pickleable. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: -Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 6 07:34:39 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 06 Mar 2016 12:34:39 +0000 Subject: [issue25718] itertools.accumulate __reduce__/__setstate__ bug In-Reply-To: <1448352443.54.0.731172452763.issue25718@psf.upfronthosting.co.za> Message-ID: <1457267679.73.0.163046333222.issue25718@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: -Python 2.7, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 6 08:04:36 2016 From: report at bugs.python.org (Roundup Robot) Date: Sun, 06 Mar 2016 13:04:36 +0000 Subject: [issue26167] Improve copy.copy speed for built-in types (list/set/dict) In-Reply-To: <1453313258.69.0.822432262864.issue26167@psf.upfronthosting.co.za> Message-ID: <20160306130433.10258.85715@psf.io> Roundup Robot added the comment: New changeset 496878ac412d by Serhiy Storchaka in branch 'default': Issue #26167: Minimized overhead in copy.copy() and copy.deepcopy(). https://hg.python.org/cpython/rev/496878ac412d New changeset 52d7a308e3b4 by Serhiy Storchaka in branch '3.5': Issue #26167: Backported copy tests. https://hg.python.org/cpython/rev/52d7a308e3b4 New changeset 8554423dd392 by Serhiy Storchaka in branch '2.7': Issue #26167: Backported copy tests. https://hg.python.org/cpython/rev/8554423dd392 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 6 08:05:01 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 06 Mar 2016 13:05:01 +0000 Subject: [issue26167] Improve copy.copy speed for built-in types (list/set/dict) In-Reply-To: <1453313258.69.0.822432262864.issue26167@psf.upfronthosting.co.za> Message-ID: <1457269501.45.0.0977396761087.issue26167@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 6 09:10:09 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 06 Mar 2016 14:10:09 +0000 Subject: [issue25652] collections.UserString.__rmod__() raises NameError In-Reply-To: <1447823769.89.0.495006915909.issue25652@psf.upfronthosting.co.za> Message-ID: <1457273409.14.0.335788760038.issue25652@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: In normal case there is no infinite recursion in collections.UserString1, since UserString.__rmod__(S) falls back to S.__mod__(str) or str.__rmod__(S). >>> S('say %s') % UserString('hello') Traceback (most recent call last): File "", line 1, in File "/home/serhiy/py/cpython/Lib/collections/__init__.py", line 1156, in __rmod__ return self.__class__(format % self.data) TypeError: unsupported operand type(s) for %: 'S' and 'str' Infinite recursion is possible if we make recursive UserString (us.data = us), but in this case we will get infinite recursion in all operations. collections.UserString1 LGTM at the same degree as UserString.__le__ (it would be better to handle NotImplemented correctly). There is yet one consideration. In 2.x UserString simulates both 8-bit and Unicode strings. In 3.x UserString simulates both str and bytes (except decode(), bytes formatting, etc). I think it is worth once to make UserString to support bytes formatting. In this case it would be incorrect to coerce the template to a regular str. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 6 09:17:43 2016 From: report at bugs.python.org (Roundup Robot) Date: Sun, 06 Mar 2016 14:17:43 +0000 Subject: [issue2202] urllib2 fails against IIS 6.0 (No support for MD5-sess auth) In-Reply-To: <1204223194.19.0.670418970441.issue2202@psf.upfronthosting.co.za> Message-ID: <20160306141740.10738.95932@psf.io> Roundup Robot added the comment: New changeset 22eab50cb585 by Berker Peksag in branch '3.5': Issue #2202: Fix UnboundLocalError in AbstractDigestAuthHandler.get_algorithm_impls https://hg.python.org/cpython/rev/22eab50cb585 New changeset 046c75c9cd33 by Berker Peksag in branch 'default': Issue #2202: Fix UnboundLocalError in AbstractDigestAuthHandler.get_algorithm_impls https://hg.python.org/cpython/rev/046c75c9cd33 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 6 09:27:18 2016 From: report at bugs.python.org (Roundup Robot) Date: Sun, 06 Mar 2016 14:27:18 +0000 Subject: [issue2202] urllib2 fails against IIS 6.0 (No support for MD5-sess auth) In-Reply-To: <1204223194.19.0.670418970441.issue2202@psf.upfronthosting.co.za> Message-ID: <20160306142715.60700.6623@psf.io> Roundup Robot added the comment: New changeset d135799e952b by Berker Peksag in branch '2.7': Issue #2202: Fix UnboundLocalError in AbstractDigestAuthHandler.get_algorithm_impls https://hg.python.org/cpython/rev/d135799e952b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 6 09:31:42 2016 From: report at bugs.python.org (Berker Peksag) Date: Sun, 06 Mar 2016 14:31:42 +0000 Subject: [issue2202] urllib2 fails against IIS 6.0 (No support for MD5-sess auth) In-Reply-To: <1204223194.19.0.670418970441.issue2202@psf.upfronthosting.co.za> Message-ID: <1457274702.55.0.0491711367125.issue2202@psf.upfronthosting.co.za> Berker Peksag added the comment: Thanks, Mathieu! I went with a simpler approach to test the code. ---------- keywords: -needs review nosy: +berker.peksag resolution: -> fixed stage: patch review -> resolved status: open -> closed type: enhancement -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 6 09:50:41 2016 From: report at bugs.python.org (Roundup Robot) Date: Sun, 06 Mar 2016 14:50:41 +0000 Subject: [issue26489] dictionary unpacking operator in dict expression In-Reply-To: <1457215240.85.0.6201995069.issue26489@psf.upfronthosting.co.za> Message-ID: <20160306145037.116291.889@psf.io> Roundup Robot added the comment: New changeset a34428aff42d by Berker Peksag in branch '3.5': Issue #26489: Add dictionary unpacking support to Tools/parser/unparse.py https://hg.python.org/cpython/rev/a34428aff42d New changeset 1b212e366b66 by Berker Peksag in branch 'default': Issue #26489: Add dictionary unpacking support to Tools/parser/unparse.py https://hg.python.org/cpython/rev/1b212e366b66 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 6 09:55:02 2016 From: report at bugs.python.org (Berker Peksag) Date: Sun, 06 Mar 2016 14:55:02 +0000 Subject: [issue26489] dictionary unpacking operator in dict expression In-Reply-To: <1457215240.85.0.6201995069.issue26489@psf.upfronthosting.co.za> Message-ID: <1457276102.57.0.651569564858.issue26489@psf.upfronthosting.co.za> Berker Peksag added the comment: Thanks for the patch! Could you please sign the contributor's agreement at https://www.python.org/psf/contrib/contrib-form/ ? ---------- nosy: +berker.peksag resolution: -> fixed stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 6 09:57:37 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 06 Mar 2016 14:57:37 +0000 Subject: [issue25776] More compact pickle of iterators etc In-Reply-To: <1449052155.68.0.447852149746.issue25776@psf.upfronthosting.co.za> Message-ID: <1457276257.9.0.371160640509.issue25776@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: There is the extra special case code for bytes and bytearray iterators and reversed list iterator. The patch just extends the optimizations to other builtin iterators. In the example with itertools.islice() the overhead of pickling redundant data is 20%. If there are a lot of iterators, the overhead can be up to 90%. >>> import pickle, pickletools, itertools >>> len(pickletools.optimize(pickle.dumps([itertools.islice('abcdefgh', 4) for i in range(1000)], 4))) Unpatched: 23059 Patched: 12059 Of course this is degenerated case. But if the data contains a lot of initial iterators of the same sequence or of short sequences, or exhausted iterators, the benefit can be not small. Yet one benefit from the patch is that it speeds up copying and deepcopying initial and exhausted iterators. $ ./python -m timeit -s "from itertools import islice; from copy import copy; it = islice('abcdefgh', 4)" -- "copy(it)" Unpatched: 7.37 usec per loop Patched: 6.4 usec per loop $ ./python -m timeit -s "from itertools import islice; from copy import deepcopy; it = islice('abcdefgh', 4)" -- "deepcopy(it)" Unpatched: 41.7 usec per loop Patched: 32.6 usec per loop $ ./python -m timeit -s "from copy import copy; it = iter('abcdefgh')" -- "copy(it)" Unpatched: 10.4 usec per loop Patched: 9.67 usec per loop $ ./python -m timeit -s "from copy import deepcopy; it = iter('abcdefgh')" -- "deepcopy(it)" Unpatched: 21.1 usec per loop Patched: 18.3 usec per loop $ ./python -m timeit -s "from copy import copy; it = iter(list('abcdefgh'))" -- "copy(it)" Unpatched: 10.3 usec per loop Patched: 9.54 usec per loop $ ./python -m timeit -s "from copy import deepcopy; it = iter(list('abcdefgh'))" -- "deepcopy(it)" Unpatched: 39.7 usec per loop Patched: 36.8 usec per loop ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 6 09:59:09 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 06 Mar 2016 14:59:09 +0000 Subject: [issue25776] More compact pickle of iterators etc In-Reply-To: <1449052155.68.0.447852149746.issue25776@psf.upfronthosting.co.za> Message-ID: <1457276349.5.0.360369939774.issue25776@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: The patch is synchronized with current sources. Added mandatory braces. ---------- Added file: http://bugs.python.org/file42077/iterators_pickle_3.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 6 10:19:24 2016 From: report at bugs.python.org (Berker Peksag) Date: Sun, 06 Mar 2016 15:19:24 +0000 Subject: [issue21034] Python docs reference the Distribute package which has been deprecated in favor of Setuptools In-Reply-To: <1395564519.98.0.0028723182567.issue21034@psf.upfronthosting.co.za> Message-ID: <1457277564.2.0.810442473528.issue21034@psf.upfronthosting.co.za> Berker Peksag added the comment: I think it would be better to just remove the following part from the documentation: "Of course, you need to install them into the venv first: this could be done by running ez_setup.py with the venv activated, followed by running easy_install pip. Alternatively, you could download the source tarballs and run python setup.py install after unpacking, with the venv activated." Here is a patch. ---------- nosy: +berker.peksag, vinay.sajip versions: +Python 3.6 -Python 3.4 Added file: http://bugs.python.org/file42078/issue21034.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 6 11:04:40 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 06 Mar 2016 16:04:40 +0000 Subject: [issue26492] Exhausted array iterator should left exhausted Message-ID: <1457280280.79.0.892048425987.issue26492@psf.upfronthosting.co.za> New submission from Serhiy Storchaka: There is general rule that after raising StopIteration the iterator should always raise StopIteration even if new data is added to iterating sequence. Array iterators don't obey this rule. Proposed patch makes array iterator to left in exhausted state since it achieved. As a side (or may be primary) effect of this change, iterating sequence can be freed just after iterating is finished. Added tests for other iterators of resizable sequences. I don't know whether this patch should be applied to maintained releases or only to default branch. Note that array pickling tests broken by this patch were just added. They just expose current (presumably incorrect) behavior. ---------- assignee: rhettinger components: Extension Modules files: exhausted_array_iterator.patch keywords: patch messages: 261260 nosy: benjamin.peterson, larry, rhettinger, serhiy.storchaka priority: normal severity: normal stage: patch review status: open title: Exhausted array iterator should left exhausted type: behavior versions: Python 3.6 Added file: http://bugs.python.org/file42079/exhausted_array_iterator.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 6 11:24:54 2016 From: report at bugs.python.org (Marc Duponcheel) Date: Sun, 06 Mar 2016 16:24:54 +0000 Subject: [issue19142] Cross-compile fails trying to execute foreign pgen on build host In-Reply-To: <1380670898.69.0.308819053325.issue19142@psf.upfronthosting.co.za> Message-ID: <1457281494.92.0.319692605096.issue19142@psf.upfronthosting.co.za> Marc Duponcheel added the comment: one workaround is to build native in separate directory and to use the native build Parser/pgen and Programs/_freeze_importlib for cross compilation host build. ---------- nosy: +Marc Duponcheel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 6 11:29:59 2016 From: report at bugs.python.org (Berker Peksag) Date: Sun, 06 Mar 2016 16:29:59 +0000 Subject: [issue15948] Unchecked return value of I/O functions In-Reply-To: <1347722947.26.0.499070360065.issue15948@psf.upfronthosting.co.za> Message-ID: <1457281799.8.0.837367678032.issue15948@psf.upfronthosting.co.za> Changes by Berker Peksag : ---------- dependencies: +Missing sanity checks for various C library function calls... _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 6 11:56:29 2016 From: report at bugs.python.org (=?utf-8?b?UmHDumwgTsO6w7FleiBkZSBBcmVuYXM=?=) Date: Sun, 06 Mar 2016 16:56:29 +0000 Subject: [issue26493] Bad formatting in WinError 193 when using subprocess.check_call Message-ID: <1457283389.71.0.286389844503.issue26493@psf.upfronthosting.co.za> New submission from Ra?l N??ez de Arenas: Python 3.5.1 x64 @ Windows 10 x64 The error message in the traceback for OSError/WinError 193 has bad formatting and the offending file name is not printed. For example, this code: ---- import subprocess testfile = open('testfile.notexecutable', 'wb') testfile.close() subprocess.check_call(['testfile.notexecutable']) ---- produces this output: ---- Traceback (most recent call last): File "test.py", line 6, in subprocess.check_call(['testfile.notexecutable']) File "C:\Program Files\Python35\lib\subprocess.py", line 579, in check_call retcode = call(*popenargs, **kwargs) File "C:\Program Files\Python35\lib\subprocess.py", line 560, in call with Popen(*popenargs, **kwargs) as p: File "C:\Program Files\Python35\lib\subprocess.py", line 950, in __init__ restore_signals, start_new_session) File "C:\Program Files\Python35\lib\subprocess.py", line 1220, in _execute_child startupinfo) OSError: [WinError 193] %1 is not a valid Win32 application ---- Please note the "%1 is not a valid..." on the last line. Instead of the "%1" placeholder, the filename ("testfile.notexecutable") should appear instead. Thanks :) ---------- messages: 261262 nosy: Ra?l N??ez de Arenas priority: normal severity: normal status: open title: Bad formatting in WinError 193 when using subprocess.check_call versions: Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 6 13:26:05 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 06 Mar 2016 18:26:05 +0000 Subject: [issue26494] Double deallocation on iterator exhausting Message-ID: <1457288764.94.0.168287313304.issue26494@psf.upfronthosting.co.za> New submission from Serhiy Storchaka: Following example causes double deallocation of a sequence and crashing. class A(list): def __del__(self): next(it) it = iter(A()) next(it) The same is for subclass of tuple, str, bytes and bytearray. Proposed patch fixes this issue. ---------- components: Interpreter Core files: free_after_iterating.patch keywords: patch messages: 261263 nosy: rhettinger, serhiy.storchaka priority: normal severity: normal stage: patch review status: open title: Double deallocation on iterator exhausting type: crash versions: Python 2.7, Python 3.5, Python 3.6 Added file: http://bugs.python.org/file42080/free_after_iterating.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 6 13:47:20 2016 From: report at bugs.python.org (Antti Haapala) Date: Sun, 06 Mar 2016 18:47:20 +0000 Subject: [issue26495] super() does not work nested Message-ID: <1457290040.33.0.0538313246288.issue26495@psf.upfronthosting.co.za> New submission from Antti Haapala: super() without arguments is ---------- messages: 261264 nosy: ztane priority: normal severity: normal status: open title: super() does not work nested _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 6 13:53:27 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 06 Mar 2016 18:53:27 +0000 Subject: [issue26496] Exhausted dequeue iterator should free a reference to a deque Message-ID: <1457290407.19.0.35859236491.issue26496@psf.upfronthosting.co.za> New submission from Serhiy Storchaka: It is common that exhausted iterator frees a reference to iterating sequence. All builtin sequences (list, tuple, str, bytes, bytearray), set and dict support this. It would be nice if dequeue will support this too. ---------- components: Extension Modules messages: 261265 nosy: rhettinger, serhiy.storchaka priority: normal severity: normal stage: needs patch status: open title: Exhausted dequeue iterator should free a reference to a deque type: enhancement versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 6 13:57:29 2016 From: report at bugs.python.org (Antti Haapala) Date: Sun, 06 Mar 2016 18:57:29 +0000 Subject: [issue26495] super() does not work in nested functions, genexps, listcomps, and gives misleading exceptions In-Reply-To: <1457290040.33.0.0538313246288.issue26495@psf.upfronthosting.co.za> Message-ID: <1457290649.73.0.734693015263.issue26495@psf.upfronthosting.co.za> Antti Haapala added the comment: super() without arguments gives proper "super() without arguments" in functions, generator functions nested in methods, if *those* do not have arguments. But if you use super() in a nested function that takes an argument, or in a generator expression or a comprehension, you'd get Got exception: TypeError super(type, obj): obj must be an instance or subtype of type which is really annoying. Furthermore, if a nested function took another instance of type(self) as the first argument, then super() could refer unexpectedly to wrong instance: class Bar(Foo): def calculate(self, other_foos): def complicated_calculation(other): super().some_method(other) for item in other_foos: complicated_calculation(item) now the `super()` call would not have implied `self` of `calculate` as the first argument, but the `other` argument of the nested function, all without warnings. I believe it is a mistake that these nested functions can see `__class__` at all, since it would just mostly lead them misbehaving unexpectedly. ---------- components: +Interpreter Core title: super() does not work nested -> super() does not work in nested functions, genexps, listcomps, and gives misleading exceptions _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 6 14:58:45 2016 From: report at bugs.python.org (Eryk Sun) Date: Sun, 06 Mar 2016 19:58:45 +0000 Subject: [issue26493] Bad formatting in WinError 193 when using subprocess.check_call In-Reply-To: <1457283389.71.0.286389844503.issue26493@psf.upfronthosting.co.za> Message-ID: <1457294325.33.0.938747836746.issue26493@psf.upfronthosting.co.za> Eryk Sun added the comment: When Python creates an exception generically from a Windows error code, it calls WinAPI FormatMessage with the flag FORMAT_MESSAGE_IGNORE_INSERTS. The reason for this is explained in a blog post written by Raymond Chen[1]: "when you are not in control of the message, you had better pass the FORMAT_MESSAGE_IGNORE_INSERTS flag." [1]: https://blogs.msdn.microsoft.com/oldnewthing/20071128-00/?p=24353 Some extension modules in the code base get this wrong. For example, ctypes.FormatError() doesn't use FORMAT_MESSAGE_IGNORE_INSERTS, so it fails to get the system error message for ERROR_BAD_EXE_FORMAT (193) and just returns its default string "": >>> ctypes.FormatError(193) '' ---------- components: +Windows nosy: +eryksun, paul.moore, steve.dower, tim.golden, zach.ware type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 6 14:58:58 2016 From: report at bugs.python.org (Roundup Robot) Date: Sun, 06 Mar 2016 19:58:58 +0000 Subject: [issue19475] Add timespec optional flag to datetime isoformat() to choose the precision In-Reply-To: <1383325521.57.0.024650274045.issue19475@psf.upfronthosting.co.za> Message-ID: <20160306195854.89260.96786@psf.io> Roundup Robot added the comment: New changeset eb120f50df4a by Alexander Belopolsky in branch 'default': Closes #19475: Added timespec to the datetime.isoformat() method. https://hg.python.org/cpython/rev/eb120f50df4a ---------- nosy: +python-dev resolution: -> fixed stage: commit review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 6 15:04:59 2016 From: report at bugs.python.org (Dror Levin) Date: Sun, 06 Mar 2016 20:04:59 +0000 Subject: [issue16113] Add SHA-3 (Keccak) support In-Reply-To: <1349233804.79.0.00772371618682.issue16113@psf.upfronthosting.co.za> Message-ID: <1457294699.33.0.468135707946.issue16113@psf.upfronthosting.co.za> Changes by Dror Levin : ---------- nosy: +spatz _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 6 15:13:50 2016 From: report at bugs.python.org (Mark Lawrence) Date: Sun, 06 Mar 2016 20:13:50 +0000 Subject: [issue16113] Add SHA-3 (Keccak) support In-Reply-To: <1349233804.79.0.00772371618682.issue16113@psf.upfronthosting.co.za> Message-ID: <1457295230.6.0.546865505303.issue16113@psf.upfronthosting.co.za> Changes by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 6 15:23:25 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 06 Mar 2016 20:23:25 +0000 Subject: [issue26494] Double deallocation on iterator exhausting In-Reply-To: <1457288764.94.0.168287313304.issue26494@psf.upfronthosting.co.za> Message-ID: <1457295805.33.0.60408472603.issue26494@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Updated patch fixes also set, dict and os.scandir() iterator. May be sqlite3 cursor needs a fix, but it is too complicated. ---------- Added file: http://bugs.python.org/file42081/free_after_iterating_2.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 6 15:34:19 2016 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 06 Mar 2016 20:34:19 +0000 Subject: [issue25652] collections.UserString.__rmod__() raises NameError In-Reply-To: <1447823769.89.0.495006915909.issue25652@psf.upfronthosting.co.za> Message-ID: <1457296459.91.0.0182825940682.issue25652@psf.upfronthosting.co.za> Raymond Hettinger added the comment: Antoine, do you have any thoughts on this one? I'm inclined to remove __rmod__ entirely. That would match what str does and it avoids having to guess what the user meant when writing "A(s) % UserString(t)" when A does not have a __mod__ formatting method. ---------- nosy: +pitrou _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 6 15:40:53 2016 From: report at bugs.python.org (Antoine Pitrou) Date: Sun, 06 Mar 2016 20:40:53 +0000 Subject: [issue25652] collections.UserString.__rmod__() raises NameError In-Reply-To: <1447823769.89.0.495006915909.issue25652@psf.upfronthosting.co.za> Message-ID: <1457296853.34.0.606888089773.issue25652@psf.upfronthosting.co.za> Antoine Pitrou added the comment: I admit I don't understand what __rmod__ is meant to achieve here, and following str's behaviour sounds like a reasonable decision. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 6 15:48:11 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 06 Mar 2016 20:48:11 +0000 Subject: [issue25652] collections.UserString.__rmod__() raises NameError In-Reply-To: <1447823769.89.0.495006915909.issue25652@psf.upfronthosting.co.za> Message-ID: <1457297291.67.0.506243807567.issue25652@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: What about such example? >>> class F: ... def __init__(self, value): ... self.value = value ... def __mod__(self, other): ... if isinstance(other, str): ... return self.value % other ... return NotImplemented ... >>> from collections import UserString >>> F('say %s') % UserString('hello') 'say hello' ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 6 17:58:26 2016 From: report at bugs.python.org (Alessandro Molina) Date: Sun, 06 Mar 2016 22:58:26 +0000 Subject: [issue26497] Documentation - HOWTO Use Python in the web paragraph on TurboGears still mentions it's based on Pylons Message-ID: <1457305106.46.0.783108408481.issue26497@psf.upfronthosting.co.za> New submission from Alessandro Molina: https://docs.python.org/3.6/howto/webservers.html#turbogears still mentions "TurboGears 2 is based on the WSGI stack of another popular component-based web framework, Pylons." which is not true anymore since TurboGears 2.3.0. TurboGears switched to its own micro-framework core since version 2.3.0 as Pylons wasn't Python3 compatible. Also The TGBook is still mentioned even though it's 10 years old and not reliable anymore since TurboGears 1.0 ---------- assignee: docs at python components: Documentation messages: 261274 nosy: Alessandro Molina, docs at python priority: normal severity: normal status: open title: Documentation - HOWTO Use Python in the web paragraph on TurboGears still mentions it's based on Pylons versions: Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 6 18:21:06 2016 From: report at bugs.python.org (Martin Panter) Date: Sun, 06 Mar 2016 23:21:06 +0000 Subject: [issue26483] docs unclear on difference between str.isdigit() and str.isdecimal() In-Reply-To: <1457121897.81.0.495681677897.issue26483@psf.upfronthosting.co.za> Message-ID: <1457306466.94.0.072028074757.issue26483@psf.upfronthosting.co.za> Martin Panter added the comment: The documentation could certainly be clarified to say that all decimals, as determined by isdecimal(), are also digits as determined by isdigit(). IMO the current documentation is confusing or wrong to stay that decimals ?include digit characters?; it is actually the other way around. I think it could also be clearer about how ?general category ?Nd? ? and ?the property value Numeric_Type=Digit or Numeric_Type=Decimal? are related (if they are indeed related). ---------- nosy: +martin.panter _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 6 19:15:13 2016 From: report at bugs.python.org (Berker Peksag) Date: Mon, 07 Mar 2016 00:15:13 +0000 Subject: [issue26497] Documentation - HOWTO Use Python in the web paragraph on TurboGears still mentions it's based on Pylons In-Reply-To: <1457305106.46.0.783108408481.issue26497@psf.upfronthosting.co.za> Message-ID: <1457309713.14.0.987185681146.issue26497@psf.upfronthosting.co.za> Berker Peksag added the comment: Thanks for the report. Actually, the whole document is outdated. I think we can mark this as a duplicate of issue 24852. ---------- nosy: +berker.peksag resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> Python 3.5.0rc1 "HOWTO Use Python in the web" needs fix _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 6 19:20:14 2016 From: report at bugs.python.org (Berker Peksag) Date: Mon, 07 Mar 2016 00:20:14 +0000 Subject: [issue24852] Python 3.5.0rc1 "HOWTO Use Python in the web" needs fix In-Reply-To: <1439425233.4.0.643704057203.issue24852@psf.upfronthosting.co.za> Message-ID: <1457310014.75.0.945690384251.issue24852@psf.upfronthosting.co.za> Berker Peksag added the comment: See issue 26497 for another report about this. I will remove Doc/howto/webservers.rst. ---------- versions: -Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 00:30:41 2016 From: report at bugs.python.org (Larry) Date: Mon, 07 Mar 2016 05:30:41 +0000 Subject: [issue26498] _io.so flat namespace Message-ID: <1457328641.48.0.673687775956.issue26498@psf.upfronthosting.co.za> New submission from Larry: On OSX El Capitan, Python v2.7.10 and 2.7.11 (standard installer)... When importing urllib2 it crashes with a flat namespace error then loading _io.so. Shortest test case: "python -c 'import urllib2'" Traceback (most recent call last): File "", line 1, in File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 94, in import httplib File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 80, in import mimetools File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/mimetools.py", line 6, in import tempfile File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/tempfile.py", line 32, in import io as _io File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/io.py", line 51, in import _io ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_io.so, 2): Symbol not found: __PyCodecInfo_GetIncrementalDecoder Referenced from: /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_io.so Expected in: flat namespace in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_io.so This error occurs under both v2.7.10 and v2.7.11. When I regress to 2.7.9 and all is well. ---------- components: IO, Library (Lib) messages: 261278 nosy: bugbee priority: normal severity: normal status: open title: _io.so flat namespace type: crash versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 00:57:19 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 07 Mar 2016 05:57:19 +0000 Subject: [issue26483] docs unclear on difference between str.isdigit() and str.isdecimal() In-Reply-To: <1457121897.81.0.495681677897.issue26483@psf.upfronthosting.co.za> Message-ID: <1457330239.92.0.745338711267.issue26483@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: AFAIK ?general category ?Nd? ? is the same as ?the property value Numeric_Type=Decimal?. Yet one related predicate is str.isnumeric(). https://docs.python.org/3/library/stdtypes.html?#str.isnumeric Return true if all characters in the string are numeric characters, and there is at least one character, false otherwise. Numeric characters include digit characters, and all characters that have the Unicode numeric value property, e.g. U+2155, VULGAR FRACTION ONE FIFTH. Formally, numeric characters are those with the property value Numeric_Type=Digit, Numeric_Type=Decimal or Numeric_Type=Numeric. >>> numerics = ''.join(filter(str.isnumeric, chars)) >>> ''.join(sorted(set(digits) - set(numerics))) '' >>> ''.join(sorted(set(numerics) - set(digits))) '????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????' decimals is a subset of digits, and digits is a subset of numerics. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 01:22:17 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 07 Mar 2016 06:22:17 +0000 Subject: [issue26496] Exhausted deque iterator should free a reference to a deque In-Reply-To: <1457290407.19.0.35859236491.issue26496@psf.upfronthosting.co.za> Message-ID: <1457331737.8.0.721276108816.issue26496@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- title: Exhausted dequeue iterator should free a reference to a deque -> Exhausted deque iterator should free a reference to a deque _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 01:39:16 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 07 Mar 2016 06:39:16 +0000 Subject: [issue25246] Alternative algorithm for deque_remove() In-Reply-To: <1443343421.14.0.18683145075.issue25246@psf.upfronthosting.co.za> Message-ID: <1457332756.22.0.77619939931.issue25246@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: There is more optimal approach. Find not just an index in a deque, but a block and an index in a block. After that move left or right part of a deque one position right or left. __delitem__() could be 2 times faster, remove() could be faster too. Helpers proposed in issue17394 allow to do this easily. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 01:46:41 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 07 Mar 2016 06:46:41 +0000 Subject: [issue13298] Result type depends on order of operands for bytes and bytearray In-Reply-To: <1320020077.78.0.866789839878.issue13298@psf.upfronthosting.co.za> Message-ID: <1457333201.53.0.808465364484.issue13298@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: An issue with bytes.join() is already fixed (issue15958). ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 01:48:15 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 07 Mar 2016 06:48:15 +0000 Subject: [issue11477] Incorrect operand precedence when implementing sequences in C In-Reply-To: <1299965091.63.0.267715976543.issue11477@psf.upfronthosting.co.za> Message-ID: <1457333295.67.0.111117952354.issue11477@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 01:51:48 2016 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 07 Mar 2016 06:51:48 +0000 Subject: [issue26496] Exhausted deque iterator should free a reference to a deque In-Reply-To: <1457290407.19.0.35859236491.issue26496@psf.upfronthosting.co.za> Message-ID: <1457333508.13.0.497332207387.issue26496@psf.upfronthosting.co.za> Raymond Hettinger added the comment: I don't think this is even slightly important but will take a look to see if there is an easy way to incorporate it that doesn't mess-up previous efforts to fine-tune the iterator. ---------- assignee: -> rhettinger priority: normal -> low _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 02:21:28 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 07 Mar 2016 07:21:28 +0000 Subject: [issue26496] Exhausted deque iterator should free a reference to a deque In-Reply-To: <1457290407.19.0.35859236491.issue26496@psf.upfronthosting.co.za> Message-ID: <1457335288.12.0.797638248802.issue26496@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: This should be not very hard. It is just reminder to me, I'll write a patch after closing related issue26494 and issue26492. ---------- dependencies: +Double deallocation on iterator exhausting _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 02:26:02 2016 From: report at bugs.python.org (=?utf-8?b?UmHDumwgTsO6w7FleiBkZSBBcmVuYXM=?=) Date: Mon, 07 Mar 2016 07:26:02 +0000 Subject: [issue26493] Bad formatting in WinError 193 when using subprocess.check_call In-Reply-To: <1457283389.71.0.286389844503.issue26493@psf.upfronthosting.co.za> Message-ID: <1457335562.63.0.577894244394.issue26493@psf.upfronthosting.co.za> Ra?l N??ez de Arenas added the comment: Thanks for the information, Eryk, I've read the blog. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 03:04:21 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 07 Mar 2016 08:04:21 +0000 Subject: [issue17394] Add slicing support to collections.deque In-Reply-To: <1362972021.66.0.443403979058.issue17394@psf.upfronthosting.co.za> Message-ID: <1457337861.92.0.0576356507245.issue17394@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: The output now is a deque. ---------- Added file: http://bugs.python.org/file42082/deque_slices_3.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 04:19:27 2016 From: report at bugs.python.org (Nick Coghlan) Date: Mon, 07 Mar 2016 09:19:27 +0000 Subject: [issue21034] Python docs reference the Distribute package which has been deprecated in favor of Setuptools In-Reply-To: <1395564519.98.0.0028723182567.issue21034@psf.upfronthosting.co.za> Message-ID: <1457342366.99.0.65303432481.issue21034@psf.upfronthosting.co.za> Nick Coghlan added the comment: +1 from me for just removing the bootstrapping instructions from this note. (The original reference to Distribute has already been replaced with a reference to Setuptools at some point since Jurko filed this issue) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 05:10:53 2016 From: report at bugs.python.org (Peter) Date: Mon, 07 Mar 2016 10:10:53 +0000 Subject: [issue26499] http.client.IncompleteRead from HTTPResponse read after part reading file Message-ID: <1457345453.59.0.0327827539319.issue26499@psf.upfronthosting.co.za> New submission from Peter: This is a regression in Python 3.5 tested under Linux and Mac OS X, spotted from a failing test in Biopython https://github.com/biopython/biopython/issues/773 where we would parse a file from the internet. The trigger is partially reading the network handle line by line (e.g. until an end record marker is found), and then calling handle.read() to fetch any remaining data. Self contained examples below. Note that partially reading a file like this still works: $ python3.5 Python 3.5.0 (default, Sep 14 2015, 12:13:24) [GCC 4.2.1 Compatible Apple LLVM 6.1.0 (clang-602.0.53)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> >>> from urllib.request import urlopen >>> handle = urlopen("http://www.python.org") >>> chunk = handle.read(50) >>> rest = handle.read() >>> handle.close() However, the following variants read a few lines and then attempt to call handle.read() and fail. The URL is not important (as long as it has over four lines in these examples). Using readline, >>> from urllib.request import urlopen >>> handle = urlopen("http://www.python.org") >>> for i in range(4): ... line = handle.readline() ... >>> rest = handle.read() Traceback (most recent call last): File "", line 1, in File "/Users/xxx/lib/python3.5/http/client.py", line 446, in read s = self._safe_read(self.length) File "/Users/xxx/lib/python3.5/http/client.py", line 594, in _safe_read raise IncompleteRead(b''.join(s), amt) http.client.IncompleteRead: IncompleteRead(46698 bytes read, 259 more expected) Using line iteration via next, >>> from urllib.request import urlopen >>> handle = urlopen("http://www.python.org") >>> for i in range(4): ... line = next(handle) ... >>> rest = handle.read() Traceback (most recent call last): File "", line 1, in File "/Users/xxx/lib/python3.5/http/client.py", line 446, in read s = self._safe_read(self.length) File "/Users/xxx/lib/python3.5/http/client.py", line 594, in _safe_read raise IncompleteRead(b''.join(s), amt) http.client.IncompleteRead: IncompleteRead(46698 bytes read, 259 more expected) Using line iteration directly, >>> from urllib.request import urlopen >>> count = 0 >>> handle = urlopen("http://www.python.org") >>> for line in handle: ... count += 1 ... if count == 4: ... break ... >>> rest = handle.read() Traceback (most recent call last): File "", line 1, in File "/Users/xxx/lib/python3.5/http/client.py", line 446, in read s = self._safe_read(self.length) File "/Users/xxx/lib/python3.5/http/client.py", line 594, in _safe_read raise IncompleteRead(b''.join(s), amt) http.client.IncompleteRead: IncompleteRead(46698 bytes read, 259 more expected) These examples all worked on Python 3.3 and 3.4 so this is a regression. ---------- components: Library (Lib) messages: 261287 nosy: maubp priority: normal severity: normal status: open title: http.client.IncompleteRead from HTTPResponse read after part reading file type: behavior versions: Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 05:22:15 2016 From: report at bugs.python.org (Jaivish Kothari) Date: Mon, 07 Mar 2016 10:22:15 +0000 Subject: [issue26500] Document of star operator missing. It must be documented for better understanding. Message-ID: <1457346135.37.0.589425731268.issue26500@psf.upfronthosting.co.za> New submission from Jaivish Kothari: Star operator in python for unpacking could be documented for better understanding. ---------- assignee: docs at python components: Documentation messages: 261288 nosy: docs at python, janonymous priority: normal severity: normal status: open title: Document of star operator missing. It must be documented for better understanding. versions: Python 2.7, Python 3.3, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 05:26:20 2016 From: report at bugs.python.org (Paul Moore) Date: Mon, 07 Mar 2016 10:26:20 +0000 Subject: [issue26501] bytes splitlines() method returns strings without decoding Message-ID: <1457346380.72.0.879606385641.issue26501@psf.upfronthosting.co.za> New submission from Paul Moore: See the following test (in Python 3.5): >>> u'a\nb?'.encode('utf-8').splitlines() ['a', 'b\xc2\xa3'] I encode a string in UTF-8, then use the (bytes) splitlines function on it. The return value is a list of strings, containing encoded byte values. The bytes object isn't even documented as having a splitlines method - and if it does, then it should be returning a list of bytes objects. ---------- components: Interpreter Core messages: 261289 nosy: paul.moore priority: normal severity: normal status: open title: bytes splitlines() method returns strings without decoding versions: Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 05:32:41 2016 From: report at bugs.python.org (Berker Peksag) Date: Mon, 07 Mar 2016 10:32:41 +0000 Subject: [issue7370] BaseHTTPServer reinventing rfc822 date formatting In-Reply-To: <1258734165.92.0.303692639409.issue7370@psf.upfronthosting.co.za> Message-ID: <1457346761.68.0.766251720899.issue7370@psf.upfronthosting.co.za> Berker Peksag added the comment: There is an up-to-date patch for Python 3 in issue 747320. Closing this as a duplicate. ---------- nosy: +berker.peksag resolution: -> duplicate stage: test needed -> resolved status: open -> closed superseder: -> rfc2822 formatdate functionality duplication type: behavior -> enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 05:45:35 2016 From: report at bugs.python.org (Martin Panter) Date: Mon, 07 Mar 2016 10:45:35 +0000 Subject: [issue26500] Document of star operator missing. It must be documented for better understanding. In-Reply-To: <1457346135.37.0.589425731268.issue26500@psf.upfronthosting.co.za> Message-ID: <1457347535.74.0.338225852369.issue26500@psf.upfronthosting.co.za> Martin Panter added the comment: Previous report: Issue 19024. ---------- nosy: +martin.panter _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 05:49:22 2016 From: report at bugs.python.org (=?utf-8?b?0JzQsNGA0Log0JrQvtGA0LXQvdCx0LXRgNCz?=) Date: Mon, 07 Mar 2016 10:49:22 +0000 Subject: [issue26501] bytes splitlines() method returns strings without decoding In-Reply-To: <1457346380.72.0.879606385641.issue26501@psf.upfronthosting.co.za> Message-ID: <1457347762.13.0.263884404928.issue26501@psf.upfronthosting.co.za> ???? ????????? added the comment: No, I have checked, it returns list of `bytes` objects. ---------- nosy: +mmarkk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 05:50:05 2016 From: report at bugs.python.org (=?utf-8?b?0JzQsNGA0Log0JrQvtGA0LXQvdCx0LXRgNCz?=) Date: Mon, 07 Mar 2016 10:50:05 +0000 Subject: [issue26501] bytes splitlines() method returns strings without decoding In-Reply-To: <1457346380.72.0.879606385641.issue26501@psf.upfronthosting.co.za> Message-ID: <1457347805.48.0.496510629231.issue26501@psf.upfronthosting.co.za> ???? ????????? added the comment: $ python3.5 Python 3.5.0+ (default, Oct 11 2015, 09:05:38) [GCC 5.2.1 20151010] on linux Type "help", "copyright", "credits" or "license" for more information. >>> u'a\nb?'.encode('utf-8').splitlines() [b'a', b'b\xc2\xa3'] ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 05:54:24 2016 From: report at bugs.python.org (=?utf-8?b?0JzQsNGA0Log0JrQvtGA0LXQvdCx0LXRgNCz?=) Date: Mon, 07 Mar 2016 10:54:24 +0000 Subject: [issue15948] Unchecked return value of I/O functions In-Reply-To: <1347722947.26.0.499070360065.issue15948@psf.upfronthosting.co.za> Message-ID: <1457348064.78.0.91417666947.issue15948@psf.upfronthosting.co.za> ???? ????????? added the comment: In a common case, if (write(thread.fd, thread.header, thread.header_len) == -1) should be replaced with if (write(thread.fd, thread.header, thread.header_len) != thread.header_len) ---------- nosy: +mmarkk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 06:08:12 2016 From: report at bugs.python.org (Hristo Venev) Date: Mon, 07 Mar 2016 11:08:12 +0000 Subject: [issue22367] Please add F_OFD_SETLK, etc support to fcntl.lockf In-Reply-To: <1410207529.54.0.778133775349.issue22367@psf.upfronthosting.co.za> Message-ID: <1457348892.33.0.928110044614.issue22367@psf.upfronthosting.co.za> Hristo Venev added the comment: I'd like to use fd locks from python too. ---------- nosy: +h.venev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 06:15:48 2016 From: report at bugs.python.org (Petr Viktorin) Date: Mon, 07 Mar 2016 11:15:48 +0000 Subject: [issue26502] traceback.extract_tb breaks compatibility by returning FrameSummary Message-ID: <1457349348.27.0.253072992901.issue26502@psf.upfronthosting.co.za> New submission from Petr Viktorin: According to the docs [0], traceback.extract_tb should return 4-tuples (filename, line number, function name, text). [0] https://docs.python.org/3/library/traceback.html#traceback.extract_tb Instead, since Python 3.5, it returns FrameSummary objects, which are not tuples, nor tuple subclasses, nor even sequences. (This broke some code in the wild that called len() on FrameSummary.) Issue 25111 pointed out another tuple incompatibility, which was fixed. Should __len__ be added as well? Or the whole Sequence ABC? I can provide a patch when those questions are answered. ---------- assignee: docs at python components: Documentation, Library (Lib) messages: 261296 nosy: docs at python, encukou priority: normal severity: normal status: open title: traceback.extract_tb breaks compatibility by returning FrameSummary versions: Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 07:18:16 2016 From: report at bugs.python.org (Mohankumar) Date: Mon, 07 Mar 2016 12:18:16 +0000 Subject: [issue26503] argparse with required field , not having new line separator in -help dispaly Message-ID: <1457353096.4.0.167120061283.issue26503@psf.upfronthosting.co.za> New submission from Mohankumar: We are using Python argsparse library here to display below --help message . In --help option , new line option not handled correctly , Especially in "mandatory parameters" (required=True) better to place a new line before for better readability , Since it not having any separators like list brackets in "Non Mandatory parameters". For example In below help , there must be a new line before "--protocol" and " --action" for better readability Neutron firewall-rule-create [-h] [-f {html,json,json,shell,table,value,yaml,yaml}] [-c COLUMN] [--max-width ] [--noindent] [--prefix PREFIX] [--request-format {json,xml}] [--tenant-id TENANT_ID] [--name NAME] [--description DESCRIPTION] [--shared] [--source-ip-address SOURCE_IP_ADDRESS] [--destination-ip-address DESTINATION_IP_ADDRESS] [--source-port SOURCE_PORT] [--destination-port DESTINATION_PORT] [--enabled {True,False}] --protocol {tcp,udp,icmp,any} --action {allow,deny,reject} ---------- components: Library (Lib) messages: 261297 nosy: mohankumar priority: normal severity: normal status: open title: argparse with required field , not having new line separator in -help dispaly type: behavior versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 07:52:29 2016 From: report at bugs.python.org (Wolfgang Maier) Date: Mon, 07 Mar 2016 12:52:29 +0000 Subject: [issue26501] bytes splitlines() method returns strings without decoding In-Reply-To: <1457346380.72.0.879606385641.issue26501@psf.upfronthosting.co.za> Message-ID: <1457355149.9.0.846145986501.issue26501@psf.upfronthosting.co.za> Wolfgang Maier added the comment: works for me too on Windows: Python 3.5.1 (v3.5.1:37a07cee5969, Dec 6 2015, 01:38:48) [MSC v.1900 32 bit (Intel)] on win32 Type "copyright", "credits" or "license()" for more information. >>> u'a\nb?'.encode('utf-8').splitlines() [b'a', b'b\xc2\xa3'] ---------- nosy: +wolma _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 07:54:28 2016 From: report at bugs.python.org (Wolfgang Maier) Date: Mon, 07 Mar 2016 12:54:28 +0000 Subject: [issue26501] bytes splitlines() method returns strings without decoding In-Reply-To: <1457346380.72.0.879606385641.issue26501@psf.upfronthosting.co.za> Message-ID: <1457355268.69.0.541652127287.issue26501@psf.upfronthosting.co.za> Wolfgang Maier added the comment: oh and documentation is here: https://docs.python.org/3.5/library/stdtypes.html?highlight=bytes.splitlines#bytes.splitlines ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 08:25:09 2016 From: report at bugs.python.org (STINNER Victor) Date: Mon, 07 Mar 2016 13:25:09 +0000 Subject: [issue22367] Please add F_OFD_SETLK, etc support to fcntl.lockf In-Reply-To: <1410207529.54.0.778133775349.issue22367@psf.upfronthosting.co.za> Message-ID: <1457357109.51.0.915920825884.issue22367@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- nosy: +haypo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 08:46:25 2016 From: report at bugs.python.org (Roger Mosher) Date: Mon, 07 Mar 2016 13:46:25 +0000 Subject: [issue26504] tclErr: invalid command name "PyAggImagePhoto" Message-ID: <1457358385.73.0.791027295001.issue26504@psf.upfronthosting.co.za> New submission from Roger Mosher: when trying to show a FigureCanvasTkAgg the program crashes. Debugging eventually leads me to TkAgg.blit method where we find the following line: tk.call( "PyAggImagePhoto", photoimage, id(data), colormode, id(bbox_array)) which generates a TclError, namely that "PyAggImagePhoto" is an invalid command. I am using tkinter 8.6 Full details at: http://stackoverflow.com/questions/35829961/using-matplotlib-with-tkinter-tkagg ---------- components: Tkinter messages: 261300 nosy: r mosher priority: normal severity: normal status: open title: tclErr: invalid command name "PyAggImagePhoto" versions: Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 09:02:09 2016 From: report at bugs.python.org (Alex Willmer) Date: Mon, 07 Mar 2016 14:02:09 +0000 Subject: [issue26505] [PATCH] Spelling of ANY in the license of Modules/getaddrinfo.c Message-ID: <1457359329.6.0.772560988126.issue26505@psf.upfronthosting.co.za> New submission from Alex Willmer: The license of Modules/getaddrinfo.c misspells ANY as GAI_ANY. I'm assuming a sed invocation was the cause. The same file later uses GAI_ANY as a wildcard for socket type, protocol and port. It looks like this mistake was present when the code was first committed. ---------- files: getaddrinfo-license-ANY.patch keywords: patch messages: 261301 nosy: Alex.Willmer priority: normal severity: normal status: open title: [PATCH] Spelling of ANY in the license of Modules/getaddrinfo.c Added file: http://bugs.python.org/file42083/getaddrinfo-license-ANY.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 11:50:55 2016 From: report at bugs.python.org (Roundup Robot) Date: Mon, 07 Mar 2016 16:50:55 +0000 Subject: [issue21034] Python docs reference the Distribute package which has been deprecated in favor of Setuptools In-Reply-To: <1395564519.98.0.0028723182567.issue21034@psf.upfronthosting.co.za> Message-ID: <20160307165051.10248.24059@psf.io> Roundup Robot added the comment: New changeset 50f593ed1469 by Berker Peksag in branch '3.5': Issue #21034: Remove outdated paragraph from venv documentation https://hg.python.org/cpython/rev/50f593ed1469 New changeset ac95719f1803 by Berker Peksag in branch 'default': Issue #21034: Remove outdated paragraph from venv documentation https://hg.python.org/cpython/rev/ac95719f1803 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 11:52:11 2016 From: report at bugs.python.org (Berker Peksag) Date: Mon, 07 Mar 2016 16:52:11 +0000 Subject: [issue21034] Python docs reference the Distribute package which has been deprecated in favor of Setuptools In-Reply-To: <1395564519.98.0.0028723182567.issue21034@psf.upfronthosting.co.za> Message-ID: <1457369531.78.0.103147111953.issue21034@psf.upfronthosting.co.za> Berker Peksag added the comment: Thanks for the report, Jurko. > +1 from me for just removing the bootstrapping instructions from this note. Thanks, Nick. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 12:00:58 2016 From: report at bugs.python.org (Roundup Robot) Date: Mon, 07 Mar 2016 17:00:58 +0000 Subject: [issue24852] Python 3.5.0rc1 "HOWTO Use Python in the web" needs fix In-Reply-To: <1439425233.4.0.643704057203.issue24852@psf.upfronthosting.co.za> Message-ID: <20160307170051.10728.97160@psf.io> Roundup Robot added the comment: New changeset b8ee8f79a024 by Berker Peksag in branch '3.5': Issue #24852: Remove outdated "HOWTO Use Python in the web" document https://hg.python.org/cpython/rev/b8ee8f79a024 New changeset ee1d44f7d3e7 by Berker Peksag in branch 'default': Issue #24852: Remove outdated "HOWTO Use Python in the web" document https://hg.python.org/cpython/rev/ee1d44f7d3e7 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 12:01:28 2016 From: report at bugs.python.org (Ned Deily) Date: Mon, 07 Mar 2016 17:01:28 +0000 Subject: [issue26498] _io.so flat namespace In-Reply-To: <1457328641.48.0.673687775956.issue26498@psf.upfronthosting.co.za> Message-ID: <1457370088.76.0.952367873965.issue26498@psf.upfronthosting.co.za> Ned Deily added the comment: Sorry, I am unable to reproduce the problem. My guess is that somehow there is a version mismatch between the Python executable and the dynamic libraries. This *could* be caused by a number of things, like environment variable settings. Suggest trying to isolate the problem by checking the following in a bash shell: $ type python python is hashed (/usr/local/bin/python) $ which python /usr/local/bin/python $ ls -l $(which python) lrwxr-xr-x 1 root wheel 68 Jan 2 23:08 /usr/local/bin/python -> ../../../Library/Frameworks/Python.framework/Versions/2.7/bin/python $ python -c 'import sys;print(sys.version)' 2.7.11 (v2.7.11:6d1b6a68f775, Dec 5 2015, 12:54:16) [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] $ /usr/local/bin/python2.7 -c 'import urllib2' $ env | sort # look for LD_* and DYLD_* variables $ python -v -c 'import urllib2' ---------- nosy: +ned.deily _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 12:02:12 2016 From: report at bugs.python.org (Berker Peksag) Date: Mon, 07 Mar 2016 17:02:12 +0000 Subject: [issue24852] Python 3.5.0rc1 "HOWTO Use Python in the web" needs fix In-Reply-To: <1439425233.4.0.643704057203.issue24852@psf.upfronthosting.co.za> Message-ID: <1457370132.08.0.991183307263.issue24852@psf.upfronthosting.co.za> Changes by Berker Peksag : ---------- resolution: -> fixed stage: needs patch -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 12:13:11 2016 From: report at bugs.python.org (Ned Deily) Date: Mon, 07 Mar 2016 17:13:11 +0000 Subject: [issue26498] _io.so flat namespace In-Reply-To: <1457328641.48.0.673687775956.issue26498@psf.upfronthosting.co.za> Message-ID: <1457370791.34.0.763400850909.issue26498@psf.upfronthosting.co.za> Ned Deily added the comment: An even more likely scenario: the Python executable you are using is coming from an older virtualenv. If so, you need to update the virtualenv to include an up-to-date python executable. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 12:31:24 2016 From: report at bugs.python.org (Xiang Zhang) Date: Mon, 07 Mar 2016 17:31:24 +0000 Subject: [issue18156] Add an 'attr' attribute to AttributeError In-Reply-To: <1370619110.26.0.980030189702.issue18156@psf.upfronthosting.co.za> Message-ID: <1457371884.84.0.0242859005628.issue18156@psf.upfronthosting.co.za> Xiang Zhang added the comment: I'd like to ping this channel. I post a question on https://groups.google.com/forum/#!topic/comp.lang.python/y8yDAAJJ9Sc to ask if it is possible to directly get the attribute from AttributeError, which leads me here. ---------- nosy: +xiang.zhang _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 12:37:59 2016 From: report at bugs.python.org (Steven.Painter) Date: Mon, 07 Mar 2016 17:37:59 +0000 Subject: [issue26470] Make OpenSSL module compatible with OpenSSL 1.1.0 In-Reply-To: <1456920893.87.0.933592382559.issue26470@psf.upfronthosting.co.za> Message-ID: <1457372279.52.0.545179891355.issue26470@psf.upfronthosting.co.za> Changes by Steven.Painter : ---------- nosy: +smpeepers _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 12:47:03 2016 From: report at bugs.python.org (STINNER Victor) Date: Mon, 07 Mar 2016 17:47:03 +0000 Subject: [issue26506] hex() documentation: mention "%x" % int Message-ID: <1457372823.56.0.270827849914.issue26506@psf.upfronthosting.co.za> New submission from STINNER Victor: I regulary see Python code using hex(value)[2:], whereas "%x" % value does the same thing. We should mention "%x" % value in the hex() doc. Maybe also mention "%#X" % value to format in upper case? ---------- assignee: docs at python components: Documentation messages: 261308 nosy: docs at python, haypo priority: normal severity: normal status: open title: hex() documentation: mention "%x" % int versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 12:49:15 2016 From: report at bugs.python.org (SilentGhost) Date: Mon, 07 Mar 2016 17:49:15 +0000 Subject: [issue26499] http.client.IncompleteRead from HTTPResponse read after part reading file In-Reply-To: <1457345453.59.0.0327827539319.issue26499@psf.upfronthosting.co.za> Message-ID: <1457372955.08.0.307878121944.issue26499@psf.upfronthosting.co.za> SilentGhost added the comment: As far as I'm able to track it, it was a refactoring in issue 19009 that is responsible for this regression (rev 49017c391564). I'm adding Kristj?n, so that he'd have a look at the attached fix and test. ---------- keywords: +3.5regression, patch nosy: +SilentGhost, kristjan.jonsson, serhiy.storchaka stage: -> patch review versions: +Python 3.6 Added file: http://bugs.python.org/file42084/issue26499.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 12:55:03 2016 From: report at bugs.python.org (Hristo Venev) Date: Mon, 07 Mar 2016 17:55:03 +0000 Subject: [issue22367] Please add F_OFD_SETLK, etc support to fcntl.lockf In-Reply-To: <1410207529.54.0.778133775349.issue22367@psf.upfronthosting.co.za> Message-ID: <1457373303.0.0.769245822323.issue22367@psf.upfronthosting.co.za> Hristo Venev added the comment: This implements the open_file_descriptor argument and fixes a bug with converting to int when off_t is 64-bit but long is 32-bit. ---------- keywords: +patch Added file: http://bugs.python.org/file42085/0001-fcntl-support-F_OFD_.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 12:56:55 2016 From: report at bugs.python.org (Zachary Ware) Date: Mon, 07 Mar 2016 17:56:55 +0000 Subject: [issue26501] bytes splitlines() method returns strings without decoding In-Reply-To: <1457346380.72.0.879606385641.issue26501@psf.upfronthosting.co.za> Message-ID: <1457373415.85.0.729877609445.issue26501@psf.upfronthosting.co.za> Zachary Ware added the comment: Paul, I think you were in a Python 2 session: $ python Python 2.7.10 (v2.7.10:15c95b7d81dc, May 23 2015, 09:33:12) [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> u'a\nb?'.encode('utf-8').splitlines() ['a', 'b\xc2\xa3'] >>> ^D $ python3 Python 3.5.1 (v3.5.1:37a07cee5969, Dec 5 2015, 21:12:44) [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> u'a\nb?'.encode('utf-8').splitlines() [b'a', b'b\xc2\xa3'] >>> ---------- nosy: +zach.ware resolution: -> not a bug stage: -> resolved status: open -> closed type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 13:58:59 2016 From: report at bugs.python.org (Eric V. Smith) Date: Mon, 07 Mar 2016 18:58:59 +0000 Subject: [issue26506] hex() documentation: mention "%x" % int In-Reply-To: <1457372823.56.0.270827849914.issue26506@psf.upfronthosting.co.za> Message-ID: <1457377139.51.0.983983760887.issue26506@psf.upfronthosting.co.za> Eric V. Smith added the comment: For 3.5 and 2.7, I'd suggest: format(value, 'x') or: format(value, 'X') Although you might disagree because of the verbosity. But at least you're not parsing a string at runtime. And for 3.6 with PEP-498: f'{value:x}' There are of course options for padding and adding the '0x', as well. ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 14:53:09 2016 From: report at bugs.python.org (Roundup Robot) Date: Mon, 07 Mar 2016 19:53:09 +0000 Subject: [issue26505] [PATCH] Spelling of ANY in the license of Modules/getaddrinfo.c In-Reply-To: <1457359329.6.0.772560988126.issue26505@psf.upfronthosting.co.za> Message-ID: <20160307195306.10714.40215@psf.io> Roundup Robot added the comment: New changeset c6b0204c23c5 by Ned Deily in branch '2.7': Issue #26505: Fix typos in getaddrinfo license text. https://hg.python.org/cpython/rev/c6b0204c23c5 New changeset a6b07ad3d14d by Ned Deily in branch '3.5': Issue #26505: Fix typos in getaddrinfo license text. https://hg.python.org/cpython/rev/a6b07ad3d14d New changeset 0d77a17567a4 by Ned Deily in branch 'default': Issue #26505: merge from 3.5 https://hg.python.org/cpython/rev/0d77a17567a4 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 14:53:49 2016 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 07 Mar 2016 19:53:49 +0000 Subject: [issue11477] Incorrect operand precedence when implementing sequences in C In-Reply-To: <1299965091.63.0.267715976543.issue11477@psf.upfronthosting.co.za> Message-ID: <1457380429.71.0.598393310223.issue11477@psf.upfronthosting.co.za> Changes by Terry J. Reedy : ---------- stage: needs patch -> patch review versions: +Python 3.6 -Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 14:54:13 2016 From: report at bugs.python.org (Ned Deily) Date: Mon, 07 Mar 2016 19:54:13 +0000 Subject: [issue26505] [PATCH] Spelling of ANY in the license of Modules/getaddrinfo.c In-Reply-To: <1457359329.6.0.772560988126.issue26505@psf.upfronthosting.co.za> Message-ID: <1457380453.32.0.952554605428.issue26505@psf.upfronthosting.co.za> Ned Deily added the comment: Thanks for noticing and for the patch, Alex! ---------- nosy: +ned.deily resolution: -> fixed stage: -> resolved status: open -> closed versions: +Python 2.7, Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 16:21:25 2016 From: report at bugs.python.org (Eryk Sun) Date: Mon, 07 Mar 2016 21:21:25 +0000 Subject: [issue26493] Bad formatting in WinError 193 when using subprocess.check_call In-Reply-To: <1457283389.71.0.286389844503.issue26493@psf.upfronthosting.co.za> Message-ID: <1457385685.11.0.597021824948.issue26493@psf.upfronthosting.co.za> Eryk Sun added the comment: It would be possible for subprocess to replace "%1" with the filename parsed from the command line and then re-raise the exception. That said, it's not as if this is a deficiency in the Windows implementation relative to subprocess on POSIX. For example, in 3.4 on Linux it raises a generic ENOEXEC error: >>> os.access('./test.txt', os.X_OK) True >>> subprocess.call(['./test.txt']) Traceback (most recent call last): File "", line 1, in File "/usr/lib/python3.4/subprocess.py", line 537, in call with Popen(*popenargs, **kwargs) as p: File "/usr/lib/python3.4/subprocess.py", line 859, in __init__ restore_signals, start_new_session) File "/usr/lib/python3.4/subprocess.py", line 1457, in _execute_child raise child_exception_type(errno_num, err_msg) OSError: [Errno 8] Exec format error It could provide the filename, for example: >>> raise OSError(errno.ENOEXEC, os.strerror(errno.ENOEXEC), './test.txt') Traceback (most recent call last): File "", line 1, in OSError: [Errno 8] Exec format error: './test.txt' A new issue should be raised to fix the FormatMessage calls in the standard library that mistakenly leave out FORMAT_MESSAGE_IGNORE_INSERTS. ---------- type: behavior -> enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 16:45:28 2016 From: report at bugs.python.org (Alex Willmer) Date: Mon, 07 Mar 2016 21:45:28 +0000 Subject: [issue26271] freeze.py makefile uses the wrong flags variables In-Reply-To: <1454454135.77.0.499921177416.issue26271@psf.upfronthosting.co.za> Message-ID: <1457387128.49.0.293691407761.issue26271@psf.upfronthosting.co.za> Changes by Alex Willmer : ---------- nosy: +Alex.Willmer _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 17:31:12 2016 From: report at bugs.python.org (Josh Lee) Date: Mon, 07 Mar 2016 22:31:12 +0000 Subject: [issue25667] Supply dual-stack (IPv4/IPv6) socket bind routine In-Reply-To: <1447939973.83.0.965937708444.issue25667@psf.upfronthosting.co.za> Message-ID: <1457389872.43.0.251680300811.issue25667@psf.upfronthosting.co.za> Changes by Josh Lee : ---------- nosy: +jleedev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 17:38:06 2016 From: report at bugs.python.org (Paul Moore) Date: Mon, 07 Mar 2016 22:38:06 +0000 Subject: [issue26501] bytes splitlines() method returns strings without decoding In-Reply-To: <1457346380.72.0.879606385641.issue26501@psf.upfronthosting.co.za> Message-ID: <1457390286.35.0.217809354332.issue26501@psf.upfronthosting.co.za> Paul Moore added the comment: That's weird. I can confirm it's working for me on 3.5.1. I'll double check I wan't in 2.7 when I'm back at my work PC, but I didn't *think* I was. But regardless, there's clearly no bug here. Apologies for the confusion. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 17:38:54 2016 From: report at bugs.python.org (Jason R. Coombs) Date: Mon, 07 Mar 2016 22:38:54 +0000 Subject: [issue25667] Supply dual-stack (IPv4/IPv6) socket bind routine In-Reply-To: <1447939973.83.0.965937708444.issue25667@psf.upfronthosting.co.za> Message-ID: <1457390334.4.0.0827798501309.issue25667@psf.upfronthosting.co.za> Jason R. Coombs added the comment: No reason not to put it in the socket module. I was thinking originally that the socket module was C only, but on further reflection, it could easily be one of the "additional facilities implemented in Python". Great suggestion. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 21:11:25 2016 From: report at bugs.python.org (Ed Behn) Date: Tue, 08 Mar 2016 02:11:25 +0000 Subject: [issue26507] Use highest pickle protocol in multiprocessing Message-ID: <1457403085.0.0.0995776764652.issue26507@psf.upfronthosting.co.za> New submission from Ed Behn: Currently, the default pickle protocol is used to return worker results in a multiprocessing pool. The highest protocol should be used because backwards compatibility is not an issue. ---------- components: Extension Modules files: patch messages: 261318 nosy: ebehn priority: normal severity: normal status: open title: Use highest pickle protocol in multiprocessing type: enhancement versions: Python 3.6 Added file: http://bugs.python.org/file42086/patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 21:14:23 2016 From: report at bugs.python.org (Ed Behn) Date: Tue, 08 Mar 2016 02:14:23 +0000 Subject: [issue26507] Use highest pickle protocol in multiprocessing In-Reply-To: <1457403085.0.0.0995776764652.issue26507@psf.upfronthosting.co.za> Message-ID: <1457403263.97.0.951152603141.issue26507@psf.upfronthosting.co.za> Changes by Ed Behn : Added file: http://bugs.python.org/file42087/patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 21:25:22 2016 From: report at bugs.python.org (pablo sacristan) Date: Tue, 08 Mar 2016 02:25:22 +0000 Subject: [issue26508] Infinite crash leading to DoS Message-ID: <1457403922.14.0.94490204521.issue26508@psf.upfronthosting.co.za> New submission from pablo sacristan: import ctypes, struct, sys, os while 1: os.system('python /Users/pabstersac/Desktop/Python\ Files/crash.py') #Change to your full path to the file inner = () outer = (inner,) c_outer = (ctypes.c_char * sys.getsizeof(outer)).from_address(id(outer)) inner_index = c_outer[:].find(struct.pack('P', id(inner))) c_outer[inner_index:inner_index+struct.calcsize('P')] = struct.pack('P', id(outer)) print outer #construct and print a self-referencing tuple run it and wait around 10 sec for it to happen, but once it starts you will be forced to force it to shut because it will keep on crashing infinitely which is extremely annoying, and even while it says it crashed it still runs and keeps on running infinitely, which if you do on an unexpecting victim, they will probably shut down the computer directly. There are basically two problems here, the way you construct and then print a self-referencing tuple, and the way you handle when it is put in an infinite loop with itself calling its own file (which if you wait long enough will see the effect goes quicker every second, it goes up exponentially) and you don't stop it correctly. ---------- files: crash.py messages: 261319 nosy: pabstersac priority: normal severity: normal status: open title: Infinite crash leading to DoS type: security Added file: http://bugs.python.org/file42088/crash.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 22:49:00 2016 From: report at bugs.python.org (Davin Potts) Date: Tue, 08 Mar 2016 03:49:00 +0000 Subject: [issue26507] Use highest pickle protocol in multiprocessing In-Reply-To: <1457403085.0.0.0995776764652.issue26507@psf.upfronthosting.co.za> Message-ID: <1457408940.76.0.595497899826.issue26507@psf.upfronthosting.co.za> Davin Potts added the comment: As described in issue23403, it is possible for independent processes to communicate to one another through multiprocessing. Thus changing the default triggers complications and is arguably much less interesting than having control over what protocol (or mechanism) is to be used for pickling. ---------- nosy: +davin _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 23:44:16 2016 From: report at bugs.python.org (Sebastien Bourdeauducq) Date: Tue, 08 Mar 2016 04:44:16 +0000 Subject: [issue26509] spurious ConnectionAbortedError logged on Windows Message-ID: <1457412256.22.0.929855467044.issue26509@psf.upfronthosting.co.za> New submission from Sebastien Bourdeauducq: https://github.com/python/asyncio/issues/319 On Windows, asyncio servers sometimes print such log messages when clients disconnect: ``` ERROR:master:asyncio:Fatal write error on pipe transport protocol: transport: <_ProactorSocketTransport fd=756> Traceback (most recent call last): File "C:\Users\User\Miniconda3\lib\asyncio\proactor_events.py", line 283, in _loop_writing self._write_fut = self._loop._proactor.send(self._sock, data) File "C:\Users\User\Miniconda3\lib\asyncio\windows_events.py", line 450, in send ov.WSASend(conn.fileno(), buf, flags) ConnectionAbortedError: [WinError 10053] An established connection was aborted by the software on your host machine. ``` I guess that this line: https://github.com/python/asyncio/blob/39c135baf73762830148236da622787052efba19/asyncio/proactor_events.py#L291 should be changed to also catch ``ConnectionAbortedError``, as this exception also happens when connections are closed on Windows, in addition to ``ConnectionResetError``. ---------- components: asyncio messages: 261321 nosy: gvanrossum, haypo, sebastien.bourdeauducq, yselivanov priority: normal severity: normal status: open title: spurious ConnectionAbortedError logged on Windows versions: Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 23:55:26 2016 From: report at bugs.python.org (Roundup Robot) Date: Tue, 08 Mar 2016 04:55:26 +0000 Subject: [issue26478] dict views don't implement subtraction correctly In-Reply-To: <1457047242.91.0.370937418553.issue26478@psf.upfronthosting.co.za> Message-ID: <20160308045520.9505.39244@psf.io> Roundup Robot added the comment: New changeset 309f3559a729 by Benjamin Peterson in branch '2.7': properly use PyObject_CallMethod in dictview binary operations (closes #26478) https://hg.python.org/cpython/rev/309f3559a729 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 00:30:29 2016 From: report at bugs.python.org (Roundup Robot) Date: Tue, 08 Mar 2016 05:30:29 +0000 Subject: [issue24324] Remove -Wunreachable-code flag In-Reply-To: <1432907477.51.0.798249204562.issue24324@psf.upfronthosting.co.za> Message-ID: <20160308053025.116283.23704@psf.io> Roundup Robot added the comment: New changeset 61f8f7610a88 by Ned Deily in branch '3.5': Issue #24324: Do not enable unreachable code warnings when using https://hg.python.org/cpython/rev/61f8f7610a88 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 00:52:43 2016 From: report at bugs.python.org (Roundup Robot) Date: Tue, 08 Mar 2016 05:52:43 +0000 Subject: [issue24324] Remove -Wunreachable-code flag In-Reply-To: <1432907477.51.0.798249204562.issue24324@psf.upfronthosting.co.za> Message-ID: <20160308055239.10258.18553@psf.io> Roundup Robot added the comment: New changeset 8fecf6e17616 by Ned Deily in branch 'default': Issue #24324: merge from 3.5 https://hg.python.org/cpython/rev/8fecf6e17616 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 01:01:59 2016 From: report at bugs.python.org (Ned Deily) Date: Tue, 08 Mar 2016 06:01:59 +0000 Subject: [issue24324] Remove -Wunreachable-code flag In-Reply-To: <1432907477.51.0.798249204562.issue24324@psf.upfronthosting.co.za> Message-ID: <1457416919.73.0.578113541318.issue24324@psf.upfronthosting.co.za> Ned Deily added the comment: Thanks for the suggested patches. I used a somewhat different approach in an attempt to retain the benefit of the unreachable code warning when using other (non-GCC) compilers, in particular, llvm clang where the warnings do seem to be useful. ---------- nosy: +ned.deily resolution: -> fixed stage: needs patch -> resolved status: open -> closed versions: +Python 3.6 -Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 01:05:53 2016 From: report at bugs.python.org (Ned Deily) Date: Tue, 08 Mar 2016 06:05:53 +0000 Subject: [issue22110] enable extra compilation warnings In-Reply-To: <1406757101.06.0.990367547704.issue22110@psf.upfronthosting.co.za> Message-ID: <1457417153.37.0.590098191688.issue22110@psf.upfronthosting.co.za> Ned Deily added the comment: See Issue #24324 which modifies configure to not use -Wunreachable-code with gcc for the reasons stated there and by Arfrever above. ---------- nosy: +ned.deily _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 01:11:42 2016 From: report at bugs.python.org (Roundup Robot) Date: Tue, 08 Mar 2016 06:11:42 +0000 Subject: [issue26465] Upgrade OpenSSL shipped with python installers In-Reply-To: <1456842373.05.0.727353806198.issue26465@psf.upfronthosting.co.za> Message-ID: <20160308061139.60680.99442@psf.io> Roundup Robot added the comment: New changeset bca936a0e829 by Ned Deily in branch '2.7': Issue #26465: Update OS X installer build to use OpenSSL 1.0.2g. https://hg.python.org/cpython/rev/bca936a0e829 New changeset 0628189fe42b by Ned Deily in branch '3.5': Issue #26465: Update OS X installer build to use OpenSSL 1.0.2g. https://hg.python.org/cpython/rev/0628189fe42b New changeset 60430bdcb426 by Ned Deily in branch 'default': Issue #26465: merge from 3.5 https://hg.python.org/cpython/rev/60430bdcb426 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 01:14:19 2016 From: report at bugs.python.org (Ned Deily) Date: Tue, 08 Mar 2016 06:14:19 +0000 Subject: [issue26465] Upgrade OpenSSL shipped with python installers In-Reply-To: <1456842373.05.0.727353806198.issue26465@psf.upfronthosting.co.za> Message-ID: <1457417659.16.0.0938608948236.issue26465@psf.upfronthosting.co.za> Changes by Ned Deily : ---------- components: +Build stage: -> needs patch versions: -Python 3.2, Python 3.3, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 01:31:23 2016 From: report at bugs.python.org (Martin Panter) Date: Tue, 08 Mar 2016 06:31:23 +0000 Subject: [issue26039] More flexibility in zipfile interface In-Reply-To: <1452179451.89.0.468945044395.issue26039@psf.upfronthosting.co.za> Message-ID: <1457418683.6.0.247950905237.issue26039@psf.upfronthosting.co.za> Martin Panter added the comment: Acquiring a lock in open(mode="w") and releasing it in close() doesn?t seem like a particularly useful feature to me. Maybe it would be better (and equally compatible?) to just use the lock in the internal write() or writestr() implementations. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 01:37:01 2016 From: report at bugs.python.org (Benjamin Peterson) Date: Tue, 08 Mar 2016 06:37:01 +0000 Subject: [issue26492] Exhausted array iterator should left exhausted In-Reply-To: <1457280280.79.0.892048425987.issue26492@psf.upfronthosting.co.za> Message-ID: <1457419021.49.0.398723122132.issue26492@psf.upfronthosting.co.za> Benjamin Peterson added the comment: Can you add just one patch to seq_test.py? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 02:19:59 2016 From: report at bugs.python.org (Martin Panter) Date: Tue, 08 Mar 2016 07:19:59 +0000 Subject: [issue26486] Backport some tests to 2.7 In-Reply-To: <1457167279.6.0.631210847326.issue26486@psf.upfronthosting.co.za> Message-ID: <1457421599.83.0.152812674281.issue26486@psf.upfronthosting.co.za> Martin Panter added the comment: I suspect this change is causing some buildbot failures (and failures on my computer). E.g. . ====================================================================== FAIL: test_int_pickling_efficiency (test.test_cpickle.cPickleTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/media/disk/home/proj/python/cpython/Lib/test/pickletester.py", line 1509, in test_int_pickling_efficiency self.assertEqual(sorted(sizes), sizes) AssertionError: Lists differ: [5, 5, 6, 6, 8, 8, 8, 14, 14, ... != [5, 5, 6, 6, 8, 8, 8, 16, 18, ... First differing element 7: 14 16 - [5, 5, 6, 6, 8, 8, 8, 14, 14, 16, 18, 19, 21, 22, 24] + [5, 5, 6, 6, 8, 8, 8, 16, 18, 19, 21, 22, 24, 14, 14] ---------- nosy: +martin.panter status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 02:45:16 2016 From: report at bugs.python.org (Roundup Robot) Date: Tue, 08 Mar 2016 07:45:16 +0000 Subject: [issue26456] import _tkinter + TestForkInThread leaves zombie with stalled thread In-Reply-To: <1456727351.62.0.83247971741.issue26456@psf.upfronthosting.co.za> Message-ID: <20160308074513.10228.59659@psf.io> Roundup Robot added the comment: New changeset 613196986c09 by Martin Panter in branch '2.7': Issue #26456: Force all child threads to terminate in TestForkInThread https://hg.python.org/cpython/rev/613196986c09 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 03:14:17 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 08 Mar 2016 08:14:17 +0000 Subject: [issue26039] More flexibility in zipfile interface In-Reply-To: <1452179451.89.0.468945044395.issue26039@psf.upfronthosting.co.za> Message-ID: <1457424857.06.0.727998433698.issue26039@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Yes, using the lock in write() or writestr() is equally compatible. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 03:30:30 2016 From: report at bugs.python.org (Larry) Date: Tue, 08 Mar 2016 08:30:30 +0000 Subject: [issue26498] _io.so flat namespace In-Reply-To: <1457328641.48.0.673687775956.issue26498@psf.upfronthosting.co.za> Message-ID: <1457425830.95.0.646742693491.issue26498@psf.upfronthosting.co.za> Larry added the comment: Ned, thank you for your suggestions. Just so you know, my HD recently crashed so I rebuilt the system with a new SSD. I was previously running 2.7.9 so I installed 2.7.9 to minimize any potential conflicts with my code base. All was well. Now it was time to rev Python to 2.7.11 and that was when the problem occurred. ...so I tried 2.7.10 and then 2.7.9. I hadn't gotten around to virtualenv so all these Python installs were on top of each other in /Library/Frameworks/... Following your suggestion, with 2.7.9 installed, I ran your commands and the output was as expected. I did notice, however, a lot of [benign?] cruft in my .profile and .bashrc and thought it best to clean them up. Ok, still good. I then installed 2.7.11 and reran your commands. Again, everything worked as expected. Huh? I restored back to my earlier versions of .profile and .bashrc (cruft included), and am still unable to reproduce. :-/ I've tested and retested. All is still well, so sadly I'm unable to report the cause. I suggest we close the report. Changing the subject slightly... I noticed that each time we do an install of Python, another path is prepended to PATH even if there is already an identical entry in .profile. Did I mention cruft? ;-) Hard perhaps, but is there a way for the install script to mock execute .profile to devine the resulting PATH, inspecting it for the desired path rather than just blindly adding it to .profile? ...just a thot. Again, thanks for your help. I'm off and running. ---------- resolution: -> not a bug status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 03:54:52 2016 From: report at bugs.python.org (A. Skrobov) Date: Tue, 08 Mar 2016 08:54:52 +0000 Subject: [issue26415] Out of memory, trying to parse a 35MB dict In-Reply-To: <1456182380.09.0.81920177296.issue26415@psf.upfronthosting.co.za> Message-ID: <1457427292.14.0.664371477253.issue26415@psf.upfronthosting.co.za> A. Skrobov added the comment: OK, I've now looked into it with a fresh build of 3.6 trunk on Linux x64. Peak memory usage is about 3KB per node: $ /usr/bin/time -v ./python -c 'import ast; ast.parse("0,"*1000000, mode="eval")' Command being timed: "./python -c import ast; ast.parse("0,"*1000000, mode="eval")" ... Maximum resident set size (kbytes): 3015552 ... Out of the 2945 MB total peak memory usage, only 330 MB are attributable to the heap use: $ valgrind ./python -c 'import ast; ast.parse("0,"*1000000, mode="eval")' ==21232== ... ==21232== HEAP SUMMARY: ==21232== in use at exit: 3,480,447 bytes in 266 blocks ==21232== total heap usage: 1,010,171 allocs, 1,009,905 frees, 348,600,304 bytes allocated ==21232== ... So, apparently, it's not the nodes themselves taking up a disproportionate amount of memory -- it's the heap getting so badly fragmented that 89% of its memory allocation is wasted. gprof confirms that there are lots of mallocs/reallocs going on, up to 21 per node: $ gprof python Flat profile: Each sample counts as 0.01 seconds. % cumulative self self total time seconds seconds calls s/call s/call name 17.82 0.31 0.31 2000020 0.00 0.00 PyParser_AddToken 13.79 0.55 0.24 2 0.12 0.16 freechildren 12.64 0.77 0.22 21039125 0.00 0.00 _PyMem_RawMalloc 6.32 0.88 0.11 17000101 0.00 0.00 PyNode_AddChild 5.75 0.98 0.10 28379846 0.00 0.00 visit_decref 5.75 1.08 0.10 1000004 0.00 0.00 ast_for_expr 4.60 1.16 0.08 2867 0.00 0.00 collect 4.02 1.23 0.07 20023405 0.00 0.00 _PyObject_Free 2.30 1.27 0.04 3031305 0.00 0.00 _PyType_Lookup 2.30 1.31 0.04 3002234 0.00 0.00 _PyObject_GenericSetAttrWithDict 2.30 1.35 0.04 1 0.04 0.05 ast2obj_expr 1.72 1.38 0.03 28366858 0.00 0.00 visit_reachable 1.72 1.41 0.03 12000510 0.00 0.00 subtype_traverse 1.72 1.44 0.03 3644 0.00 0.00 list_traverse 1.44 1.47 0.03 3002161 0.00 0.00 _PyObjectDict_SetItem 1.15 1.49 0.02 20022785 0.00 0.00 PyObject_Free 1.15 1.51 0.02 15000763 0.00 0.00 _PyObject_Realloc So, I suppose what needs to be done is to try reducing the number of reallocs involved in handling an AST node; the representation of the nodes themselves doesn't need to change. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 04:00:59 2016 From: report at bugs.python.org (Paul Moore) Date: Tue, 08 Mar 2016 09:00:59 +0000 Subject: [issue26501] bytes splitlines() method returns strings without decoding In-Reply-To: <1457346380.72.0.879606385641.issue26501@psf.upfronthosting.co.za> Message-ID: <1457427659.31.0.0250795511392.issue26501@psf.upfronthosting.co.za> Paul Moore added the comment: Sigh. I had installed Python 2.7 at some point, and py.exe picked it up by default :-( Isn't it about time that py.exe defaulted to the latest version installed, not the latest version of Python 2? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 04:05:02 2016 From: report at bugs.python.org (Roundup Robot) Date: Tue, 08 Mar 2016 09:05:02 +0000 Subject: [issue26486] Backport some tests to 2.7 In-Reply-To: <1457167279.6.0.631210847326.issue26486@psf.upfronthosting.co.za> Message-ID: <20160308090459.10724.56857@psf.io> Roundup Robot added the comment: New changeset ff2368d5c1d3 by Serhiy Storchaka in branch '2.7': Issue #26486: Removed pickle test that doesn't work in 2.7 on 64-bit platform. https://hg.python.org/cpython/rev/ff2368d5c1d3 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 04:08:10 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 08 Mar 2016 09:08:10 +0000 Subject: [issue26486] Backport some tests to 2.7 In-Reply-To: <1457167279.6.0.631210847326.issue26486@psf.upfronthosting.co.za> Message-ID: <1457428090.79.0.954512596073.issue26486@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Thanks Martin. This test just doesn't work in 2.7 on all platforms. ---------- status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 04:38:41 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 08 Mar 2016 09:38:41 +0000 Subject: [issue26492] Exhausted array iterator should left exhausted In-Reply-To: <1457280280.79.0.892048425987.issue26492@psf.upfronthosting.co.za> Message-ID: <1457429921.31.0.98684544258.issue26492@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Thanks for suggestion Benjamin. seq_tests.py provides common tests for list, tuple, UserList and deque. This test doesn't work for tuple, since it is not mutable. It doesn't work for deque, since it can't be iterated after changing size. Common test for list and UserList can be moved to list_tests.py. In any case we need separate tests for bytearray, array and general sequence iterator. I would be happy to not repeat the test, but tests for array and general sequence iterator have not much common with test for list. Updated patch moves list test to list_tests.py (it now works for UserList) and reuses in for bytearray. ---------- Added file: http://bugs.python.org/file42089/exhausted_array_iterator2.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 05:42:37 2016 From: report at bugs.python.org (STINNER Victor) Date: Tue, 08 Mar 2016 10:42:37 +0000 Subject: [issue26492] Exhausted array iterator should left exhausted In-Reply-To: <1457280280.79.0.892048425987.issue26492@psf.upfronthosting.co.za> Message-ID: <1457433757.77.0.310138198578.issue26492@psf.upfronthosting.co.za> STINNER Victor added the comment: I reviewed exhausted_array_iterator2.patch. ---------- nosy: +haypo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 05:46:20 2016 From: report at bugs.python.org (STINNER Victor) Date: Tue, 08 Mar 2016 10:46:20 +0000 Subject: [issue26509] spurious ConnectionAbortedError logged on Windows In-Reply-To: <1457412256.22.0.929855467044.issue26509@psf.upfronthosting.co.za> Message-ID: <1457433980.54.0.268044387213.issue26509@psf.upfronthosting.co.za> STINNER Victor added the comment: Attached patch fixes the issue. ---------- keywords: +patch Added file: http://bugs.python.org/file42090/fatal_error_ignore.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 05:54:22 2016 From: report at bugs.python.org (STINNER Victor) Date: Tue, 08 Mar 2016 10:54:22 +0000 Subject: [issue26508] Infinite crash leading to DoS In-Reply-To: <1457403922.14.0.94490204521.issue26508@psf.upfronthosting.co.za> Message-ID: <1457434462.35.0.0900841002379.issue26508@psf.upfronthosting.co.za> STINNER Victor added the comment: > "construct and print a self-referencing tuple" I don't understand the use case here. In pure Python, you cannot build a self-referecing tuple!? Yeah, using the C API or by modifying bytes directly in the memory, you can do that. But if you start to use the C API, you must be careful. The C API is designed for speed, not to prevent bugs. I don't think that we should fix anything in Python. I don't consider that it's a bug in Python. > run it and wait around 10 sec for it to happen, but once it starts you will be forced to force it to shut because it will keep on crashing infinitely which is extremely annoying, Basically, crash.py is a fork-bomb: the program starts itself in a loop. It's not a bug in Python. ---------- nosy: +haypo resolution: -> not a bug status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 05:57:36 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 08 Mar 2016 10:57:36 +0000 Subject: [issue26492] Exhausted array iterator should left exhausted In-Reply-To: <1457280280.79.0.892048425987.issue26492@psf.upfronthosting.co.za> Message-ID: <1457434656.9.0.534299445629.issue26492@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Thanks Victor. Answered you comments. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 06:01:22 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 08 Mar 2016 11:01:22 +0000 Subject: [issue26494] Double deallocation on iterator exhausting In-Reply-To: <1457288764.94.0.168287313304.issue26494@psf.upfronthosting.co.za> Message-ID: <1457434882.71.0.787991262783.issue26494@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: TODO: After resolving issue26492 add the test for array. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 06:01:56 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 08 Mar 2016 11:01:56 +0000 Subject: [issue26492] Exhausted array iterator should left exhausted In-Reply-To: <1457280280.79.0.892048425987.issue26492@psf.upfronthosting.co.za> Message-ID: <1457434916.11.0.841075414023.issue26492@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: TODO: After resolving issue26494 add similar test for array. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 06:09:22 2016 From: report at bugs.python.org (STINNER Victor) Date: Tue, 08 Mar 2016 11:09:22 +0000 Subject: [issue26415] Out of memory, trying to parse a 35MB dict In-Reply-To: <1456182380.09.0.81920177296.issue26415@psf.upfronthosting.co.za> Message-ID: <1457435362.73.0.216877293338.issue26415@psf.upfronthosting.co.za> STINNER Victor added the comment: > So, apparently, it's not the nodes themselves taking up a disproportionate amount of memory -- it's the heap getting so badly fragmented that 89% of its memory allocation is wasted. Yeah, the Python parser+compiler badly uses the memory allocator. See my "benchmark" for the memory allocator: python_memleak.py. The classical pattern of memory fragmentation is: * allocate a lot of small objects * allocate a few objects * allocate more small objects * free *all* small objects All objects must allocated on the heap, not mmap(). So the maximum size of a single object must be 128 KB (usual threshold used in malloc() to switch beetween the heap memory and mmap). We can try various hacks to reduce the fragmentation, but IMHO the only real fix is to use a different memory allocator for the compiler and then free everything allocated by the parser+compiler at once. We already have an "arena" memory allocator: Include/pyarena.h, Python/pyarena.c. It is already used by the parser+compiler, but it's only used for AST objects in practice. The parser uses the PyMem allocator API (ex: PyMem_Malloc). ---------- nosy: +haypo Added file: http://bugs.python.org/file42091/python_memleak.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 06:09:51 2016 From: report at bugs.python.org (STINNER Victor) Date: Tue, 08 Mar 2016 11:09:51 +0000 Subject: [issue26415] Fragmentation of the heap memory in the Python parser In-Reply-To: <1456182380.09.0.81920177296.issue26415@psf.upfronthosting.co.za> Message-ID: <1457435391.68.0.273929582692.issue26415@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- title: Out of memory, trying to parse a 35MB dict -> Fragmentation of the heap memory in the Python parser _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 06:10:26 2016 From: report at bugs.python.org (STINNER Victor) Date: Tue, 08 Mar 2016 11:10:26 +0000 Subject: [issue26415] Fragmentation of the heap memory in the Python parser In-Reply-To: <1456182380.09.0.81920177296.issue26415@psf.upfronthosting.co.za> Message-ID: <1457435425.99.0.142556871695.issue26415@psf.upfronthosting.co.za> STINNER Victor added the comment: My misc notes about memory fragmentation: https://haypo-notes.readthedocs.org/heap_fragmentation.html ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 06:15:12 2016 From: report at bugs.python.org (STINNER Victor) Date: Tue, 08 Mar 2016 11:15:12 +0000 Subject: [issue26415] Fragmentation of the heap memory in the Python parser In-Reply-To: <1456182380.09.0.81920177296.issue26415@psf.upfronthosting.co.za> Message-ID: <1457435712.3.0.994406436983.issue26415@psf.upfronthosting.co.za> STINNER Victor added the comment: libapr library of Apache is designed to group all memory allocations required to handle an HTTP request. It is possible to release *all* memory allocations of the request at once. It looks like the the "pool" object: * https://apr.apache.org/docs/apr/2.0/group__apr__pools.html * https://apr.apache.org/docs/apr/2.0/group__apr__allocator.html ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 06:23:55 2016 From: report at bugs.python.org (STINNER Victor) Date: Tue, 08 Mar 2016 11:23:55 +0000 Subject: [issue26493] Bad formatting in WinError 193 when using subprocess.check_call In-Reply-To: <1457283389.71.0.286389844503.issue26493@psf.upfronthosting.co.za> Message-ID: <1457436235.45.0.0975952294711.issue26493@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- nosy: +haypo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 06:26:29 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 08 Mar 2016 11:26:29 +0000 Subject: [issue26494] Double deallocation on iterator exhausting In-Reply-To: <1457288764.94.0.168287313304.issue26494@psf.upfronthosting.co.za> Message-ID: <1457436389.68.0.918628775422.issue26494@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Fixed test for OrderedDict. Tests for list and tuple are moved up to seq_tests.py. ---------- Added file: http://bugs.python.org/file42092/free_after_iterating_3.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 06:35:37 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 08 Mar 2016 11:35:37 +0000 Subject: [issue26415] Fragmentation of the heap memory in the Python parser In-Reply-To: <1456182380.09.0.81920177296.issue26415@psf.upfronthosting.co.za> Message-ID: <1457436937.57.0.151636384997.issue26415@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: On my computer peak memory usage in non-debug build is about 450 MB. Peak memory usage in debug build is about 730 MB. I'm not sure this is due to memory fragmentation. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 06:54:22 2016 From: report at bugs.python.org (STINNER Victor) Date: Tue, 08 Mar 2016 11:54:22 +0000 Subject: [issue26493] Bad formatting in WinError 193 when using subprocess.check_call In-Reply-To: <1457283389.71.0.286389844503.issue26493@psf.upfronthosting.co.za> Message-ID: <1457438062.49.0.418258419527.issue26493@psf.upfronthosting.co.za> STINNER Victor added the comment: > A new issue should be raised to fix the FormatMessage calls in the standard library that mistakenly leave out FORMAT_MESSAGE_IGNORE_INSERTS. Do you suggest to modify OSError constructor to modify the call to FormatMessageW(): don't pass the FORMAT_MESSAGE_IGNORE_INSERTS flag? I prefer "%1 is not a valid Win32 application" message than "". Currently, PyErr_SetFromErrnoWithFilenameObjects() doesn't pass any argument to FormatMessageW(). The problem is that it looks like the expected argument depends a lot of the failing system call. I don't think that it's ok to always pass the filename (or two filenames when we get two filenames, ex: os.rename) to FormatMessageW(). For example, _winapi.CreateProcess() doesn't pass any filename to OSError constructor. > It would be possible for subprocess to replace "%1" with the filename parsed from the command line and then re-raise the exception. I like the idea of formatting the error message in the subprocess module. IMHO it's much safer to reformat the error message from the function which raises the exception, since the function knows the system call, has all parameters to the system call, and may expect some specific system calls. There is no need to re-raise the exception: the "strerror" attribute contains the error message and it can be modified. We need an helper function or add a new method to the OSError class. Example of method: def reformat_strerror(self, *args): sef.strerror = FormatMessageW(..., self.strerror, ..., args) For this specific issue, I don't know if reformat_strerror() should be called from subprocess.py or CreateProcess function of Modules/_winapi.c. I understand that we should call reformat_strerror() with application_name (first parameter of CreateProcess, "executable" in subprocess), but only if the error message is 193. Since there are "a lot" of error messages and a lot of functions calling system calls, I don't think that it will be possible to handle all possible error messages in all Python functions. I suggest to only call reformat_strerror() when an user complains, only promise best effort ;-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 06:56:04 2016 From: report at bugs.python.org (STINNER Victor) Date: Tue, 08 Mar 2016 11:56:04 +0000 Subject: [issue26493] Bad formatting in WinError 193 when using subprocess.check_call In-Reply-To: <1457283389.71.0.286389844503.issue26493@psf.upfronthosting.co.za> Message-ID: <1457438164.14.0.722151536648.issue26493@psf.upfronthosting.co.za> STINNER Victor added the comment: See also issue #25585: "DLL load failed: %1 is not a valid Win32 application" message of ImportError exception. Hum, so maybe a function is better, since ImportError doesn't inherit from OSError. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 06:56:13 2016 From: report at bugs.python.org (STINNER Victor) Date: Tue, 08 Mar 2016 11:56:13 +0000 Subject: [issue25585] Bad path leads to: ImportError: DLL load failed: %1 is not a valid Win32 application. In-Reply-To: <1447004161.31.0.19011460804.issue25585@psf.upfronthosting.co.za> Message-ID: <1457438173.03.0.969633325067.issue25585@psf.upfronthosting.co.za> STINNER Victor added the comment: See also issue #26493. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 06:58:26 2016 From: report at bugs.python.org (STINNER Victor) Date: Tue, 08 Mar 2016 11:58:26 +0000 Subject: [issue26470] Make OpenSSL module compatible with OpenSSL 1.1.0 In-Reply-To: <1456920893.87.0.933592382559.issue26470@psf.upfronthosting.co.za> Message-ID: <1457438306.29.0.86923250692.issue26470@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- nosy: +haypo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 07:18:27 2016 From: report at bugs.python.org (STINNER Victor) Date: Tue, 08 Mar 2016 12:18:27 +0000 Subject: [issue22367] Please add F_OFD_SETLK, etc support to fcntl.lockf In-Reply-To: <1410207529.54.0.778133775349.issue22367@psf.upfronthosting.co.za> Message-ID: <1457439507.95.0.486483387827.issue22367@psf.upfronthosting.co.za> STINNER Victor added the comment: > This implements the open_file_descriptor argument and fixes a bug with converting to int when off_t is 64-bit but long is 32-bit. Please extract the fix into a different patch. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 07:19:47 2016 From: report at bugs.python.org (STINNER Victor) Date: Tue, 08 Mar 2016 12:19:47 +0000 Subject: [issue22367] Add F_OFD_SETLK, etc support to fcntl.lockf In-Reply-To: <1410207529.54.0.778133775349.issue22367@psf.upfronthosting.co.za> Message-ID: <1457439587.01.0.159824264579.issue22367@psf.upfronthosting.co.za> STINNER Victor added the comment: Strange, Rietveld (the tool linked with the [review] button) doesn't show the change on the Modules/fcntlmodule.c file. By the way, I suggest to not include the Modules/clinic/fcntlmodule.c.h change in the patch. ---------- title: Please add F_OFD_SETLK, etc support to fcntl.lockf -> Add F_OFD_SETLK, etc support to fcntl.lockf _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 07:20:23 2016 From: report at bugs.python.org (STINNER Victor) Date: Tue, 08 Mar 2016 12:20:23 +0000 Subject: [issue22367] Add open_file_descriptor parameter to fcntl.lockf() (use the new F_OFD_SETLK flag) In-Reply-To: <1410207529.54.0.778133775349.issue22367@psf.upfronthosting.co.za> Message-ID: <1457439623.45.0.13717261767.issue22367@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- title: Add F_OFD_SETLK, etc support to fcntl.lockf -> Add open_file_descriptor parameter to fcntl.lockf() (use the new F_OFD_SETLK flag) _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 07:20:42 2016 From: report at bugs.python.org (STINNER Victor) Date: Tue, 08 Mar 2016 12:20:42 +0000 Subject: [issue22367] Add open_file_descriptor parameter to fcntl.lockf() (use the new F_OFD_SETLK flag) In-Reply-To: <1410207529.54.0.778133775349.issue22367@psf.upfronthosting.co.za> Message-ID: <1457439642.42.0.557255734536.issue22367@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- nosy: +pitrou _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 07:36:33 2016 From: report at bugs.python.org (STINNER Victor) Date: Tue, 08 Mar 2016 12:36:33 +0000 Subject: [issue18156] Add an 'attr' attribute to AttributeError In-Reply-To: <1370619110.26.0.980030189702.issue18156@psf.upfronthosting.co.za> Message-ID: <1457440593.34.0.483559243625.issue18156@psf.upfronthosting.co.za> STINNER Victor added the comment: > try: > cls.meth() > except AttributeError as exc: > if exc.attr != 'meth': > raise What if cls.__getattr__('meth') calls a completly unrelated function which also raises AttributeError(attr='meth') but on a different object? I would also expect an "obj" attribute, a reference to the object which doesn't have attribute. But AttributeError can be raised manually without setting attr and/or obj attribute. So the best test would look to something like: if exc.obj is cls and exc.attr is not None and exc.attr != 'meth': raise The test is much more complex than expected :-/ Maybe it's simpler to split the code to first get the bounded method? try: meth = cls.meth except AttributeError: ... meth() Or check first if cls has the attribute 'meth' with hasattr(cls, 'meth')? -- About attr/obj attribute not set, an alternative is to add a new BetterAttributeError(obj, attr) exception which requires obj and attr to be set, it inherits from AttributeError. class BetterAttributeError(AttributeError): def __init__(self, obj, attr): super().__init__('%r has no attribute %r' % (obj, attr) self.obj = obj self.attr = attr It would allow a smoother transition from "legacy" AttributeError to the new BetterAttributeError. The major issue with keeping a strong reference to the object is that Python 3 introduced Exception.__traceback__ which can create a reference cycle if an exception is stored in a local variable somewhere in the traceback. It's a major pain point in asyncio. In asyncio, the problem is more likely since exceptions are stored in Future objects to be used later. ---------- nosy: +haypo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 07:36:47 2016 From: report at bugs.python.org (STINNER Victor) Date: Tue, 08 Mar 2016 12:36:47 +0000 Subject: [issue26502] traceback.extract_tb breaks compatibility by returning FrameSummary In-Reply-To: <1457349348.27.0.253072992901.issue26502@psf.upfronthosting.co.za> Message-ID: <1457440607.85.0.493867192578.issue26502@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- nosy: +rbcollins _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 07:48:52 2016 From: report at bugs.python.org (Mathieu Dupuy) Date: Tue, 08 Mar 2016 12:48:52 +0000 Subject: [issue2202] urllib2 fails against IIS 6.0 (No support for MD5-sess auth) In-Reply-To: <1204223194.19.0.670418970441.issue2202@psf.upfronthosting.co.za> Message-ID: <1457441332.9.0.683807116312.issue2202@psf.upfronthosting.co.za> Mathieu Dupuy added the comment: Much better indeed. Thanks. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 07:52:51 2016 From: report at bugs.python.org (Berker Peksag) Date: Tue, 08 Mar 2016 12:52:51 +0000 Subject: [issue26502] traceback.extract_tb breaks compatibility by returning FrameSummary In-Reply-To: <1457349348.27.0.253072992901.issue26502@psf.upfronthosting.co.za> Message-ID: <1457441571.42.0.569316278227.issue26502@psf.upfronthosting.co.za> Berker Peksag added the comment: This is basically a duplicate of issue 25573. We need to add the examples in traceback module documentation to test_traceback.py. > Should __len__ be added as well? IMO, the new FrameSummary API (and its friends) shouldn't change the return value of the existing traceback functions like extract_tb() so I'd say yes. ---------- nosy: +berker.peksag resolution: -> duplicate stage: -> resolved status: open -> closed type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 08:56:01 2016 From: report at bugs.python.org (Memeplex) Date: Tue, 08 Mar 2016 13:56:01 +0000 Subject: [issue26510] Add required argument to add_subparsers Message-ID: <1457445361.5.0.530669445668.issue26510@psf.upfronthosting.co.za> New submission from Memeplex: It's useful in combination with dest. Currently you have to set required as an attribute. This is not only inconsistent but not even documented as a valid usage (in general, it's not clear from the docs whether attribute setting -vs argument passing- is a valid usage). ---------- components: Library (Lib) messages: 261358 nosy: memeplex priority: normal severity: normal status: open title: Add required argument to add_subparsers type: enhancement versions: Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 08:56:11 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 08 Mar 2016 13:56:11 +0000 Subject: [issue26387] Crash calling sqlite3_close with invalid pointer In-Reply-To: <1455818373.79.0.020961668279.issue26387@psf.upfronthosting.co.za> Message-ID: <1457445371.57.0.133298385604.issue26387@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Could you please provide a test Filipp? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 08:56:53 2016 From: report at bugs.python.org (Memeplex) Date: Tue, 08 Mar 2016 13:56:53 +0000 Subject: [issue26510] [argparse] Add required argument to add_subparsers In-Reply-To: <1457445361.5.0.530669445668.issue26510@psf.upfronthosting.co.za> Message-ID: <1457445413.31.0.174338392389.issue26510@psf.upfronthosting.co.za> Changes by Memeplex : ---------- title: Add required argument to add_subparsers -> [argparse] Add required argument to add_subparsers _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 08:58:22 2016 From: report at bugs.python.org (Memeplex) Date: Tue, 08 Mar 2016 13:58:22 +0000 Subject: [issue26510] [argparse] Add required argument to add_subparsers In-Reply-To: <1457445361.5.0.530669445668.issue26510@psf.upfronthosting.co.za> Message-ID: <1457445502.57.0.466482968418.issue26510@psf.upfronthosting.co.za> Changes by Memeplex : ---------- nosy: +bethard _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 09:13:10 2016 From: report at bugs.python.org (Roundup Robot) Date: Tue, 08 Mar 2016 14:13:10 +0000 Subject: [issue25911] Regression: os.walk now using os.scandir() breaks bytes filenames on windows In-Reply-To: <1450539578.39.0.976654454489.issue25911@psf.upfronthosting.co.za> Message-ID: <20160308141306.29613.38429@psf.io> Roundup Robot added the comment: New changeset 19a3e0e664af by Serhiy Storchaka in branch '3.4': Issues #23808, #25911: Trying to fix walk tests on Windows. https://hg.python.org/cpython/rev/19a3e0e664af New changeset f9e22717722d by Serhiy Storchaka in branch '3.5': Issues #23808, #25911: Trying to fix walk tests on Windows. https://hg.python.org/cpython/rev/f9e22717722d New changeset da020e408c7f by Serhiy Storchaka in branch 'default': Issues #23808, #25911: Trying to fix walk tests on Windows. https://hg.python.org/cpython/rev/da020e408c7f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 09:13:10 2016 From: report at bugs.python.org (Roundup Robot) Date: Tue, 08 Mar 2016 14:13:10 +0000 Subject: [issue23808] Symlink to directory on Windows 8 In-Reply-To: <1427654710.52.0.171827508348.issue23808@psf.upfronthosting.co.za> Message-ID: <20160308141306.29613.28297@psf.io> Roundup Robot added the comment: New changeset 19a3e0e664af by Serhiy Storchaka in branch '3.4': Issues #23808, #25911: Trying to fix walk tests on Windows. https://hg.python.org/cpython/rev/19a3e0e664af New changeset f9e22717722d by Serhiy Storchaka in branch '3.5': Issues #23808, #25911: Trying to fix walk tests on Windows. https://hg.python.org/cpython/rev/f9e22717722d New changeset da020e408c7f by Serhiy Storchaka in branch 'default': Issues #23808, #25911: Trying to fix walk tests on Windows. https://hg.python.org/cpython/rev/da020e408c7f ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 09:31:34 2016 From: report at bugs.python.org (A. Skrobov) Date: Tue, 08 Mar 2016 14:31:34 +0000 Subject: [issue26415] Fragmentation of the heap memory in the Python parser In-Reply-To: <1456182380.09.0.81920177296.issue26415@psf.upfronthosting.co.za> Message-ID: <1457447494.62.0.932524699539.issue26415@psf.upfronthosting.co.za> A. Skrobov added the comment: @Serhiy: if your build is 32-bit, then every node is half the size, as it mostly consists of pointers. The amount of heap fragmentation can also depend on gcc/glibc version. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 09:37:28 2016 From: report at bugs.python.org (Filipp Andjelo) Date: Tue, 08 Mar 2016 14:37:28 +0000 Subject: [issue26387] Crash calling sqlite3_close with invalid pointer In-Reply-To: <1455818373.79.0.020961668279.issue26387@psf.upfronthosting.co.za> Message-ID: <1457447848.21.0.963026191665.issue26387@psf.upfronthosting.co.za> Filipp Andjelo added the comment: Hi Serhiy, unfortunately not, we have one heavy application which is crashing with the given error non deterministically after about 25 hours of running on 40 CPUs with 280GiB memory (!) in use. We already made all kind of test to get it reproducible "in a small", but it just doesn't crash. If I have more information, I'll post it here. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 10:39:22 2016 From: report at bugs.python.org (Mike Vertolli) Date: Tue, 08 Mar 2016 15:39:22 +0000 Subject: [issue26511] Add link to id() built-in in comparison operator documentation for "is" Message-ID: <1457451562.01.0.849547274402.issue26511@psf.upfronthosting.co.za> New submission from Mike Vertolli: Here's the doc: https://docs.python.org/2/reference/expressions.html#is It would be great if this line: "The operators is and is not test for object identity: x is y is true if and only if x and y are the same object. x is not y yields the inverse truth value.[7]" Could link to the id() builtin doc: https://docs.python.org/2/library/functions.html#id One way to rephrase this could be: "The operators is and is not test for object identity: x is y is true if and only if x and y are the same object or id(x) == id(y). x is not y yields the inverse truth value.[7]" And, the id's can be hyperlinks. It would also be nice if that reference linked to a page on integer caching in Python. ---------- assignee: docs at python components: Documentation messages: 261364 nosy: Mike Vertolli, docs at python priority: normal severity: normal status: open title: Add link to id() built-in in comparison operator documentation for "is" type: enhancement versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 10:43:40 2016 From: report at bugs.python.org (Hristo Venev) Date: Tue, 08 Mar 2016 15:43:40 +0000 Subject: [issue22367] Add open_file_descriptor parameter to fcntl.lockf() (use the new F_OFD_SETLK flag) In-Reply-To: <1410207529.54.0.778133775349.issue22367@psf.upfronthosting.co.za> Message-ID: <1457451820.48.0.850972201269.issue22367@psf.upfronthosting.co.za> Hristo Venev added the comment: Here is the OFD patch, I'll open another issue for the overflow bug. ---------- versions: +Python 3.6 Added file: http://bugs.python.org/file42093/0002-fcntl-Support-Linux-open-file-descriptor-locks.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 11:45:33 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 08 Mar 2016 16:45:33 +0000 Subject: [issue15068] fileinput requires two EOF when reading stdin In-Reply-To: <1339687174.96.0.0386214807139.issue15068@psf.upfronthosting.co.za> Message-ID: <1457455533.9.0.168097841171.issue15068@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Committed in changesets 5fbd16326353 (2.7), 9ead3a6c5f81 (3.5), and fefedbaac640 (default). Due to SMTP failure there is no Roundup report. Warnings are not emitted in maintained releases. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 12:13:16 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 08 Mar 2016 17:13:16 +0000 Subject: [issue26387] Crash calling sqlite3_close with invalid pointer In-Reply-To: <1455818373.79.0.020961668279.issue26387@psf.upfronthosting.co.za> Message-ID: <1457457196.73.0.667394791896.issue26387@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: This may be similar to issue26494. As for the patch, _pysqlite_seterror() shouldn't be called when GIL is released. And setting self->db not guarded with GIL looks dangerous. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 13:29:55 2016 From: report at bugs.python.org (Roundup Robot) Date: Tue, 08 Mar 2016 18:29:55 +0000 Subject: [issue26465] Upgrade OpenSSL shipped with python installers In-Reply-To: <1456842373.05.0.727353806198.issue26465@psf.upfronthosting.co.za> Message-ID: <20160308182952.29613.22563@psf.io> Roundup Robot added the comment: New changeset 195ce1f4f54b by Steve Dower in branch '2.7': Issue #26465: Update Windows builds to use OpenSSL 1.0.2g. https://hg.python.org/cpython/rev/195ce1f4f54b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 13:30:13 2016 From: report at bugs.python.org (Roundup Robot) Date: Tue, 08 Mar 2016 18:30:13 +0000 Subject: [issue26465] Upgrade OpenSSL shipped with python installers In-Reply-To: <1456842373.05.0.727353806198.issue26465@psf.upfronthosting.co.za> Message-ID: <20160308183007.67095.47660@psf.io> Roundup Robot added the comment: New changeset 6d7f0421b71f by Steve Dower in branch '3.5': Issue #26465: Update Windows builds to use OpenSSL 1.0.2g. https://hg.python.org/cpython/rev/6d7f0421b71f New changeset e045f26ea74a by Steve Dower in branch 'default': Issue #26465: Update Windows builds to use OpenSSL 1.0.2g. https://hg.python.org/cpython/rev/e045f26ea74a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 13:30:27 2016 From: report at bugs.python.org (Steve Dower) Date: Tue, 08 Mar 2016 18:30:27 +0000 Subject: [issue26465] Upgrade OpenSSL shipped with python installers In-Reply-To: <1456842373.05.0.727353806198.issue26465@psf.upfronthosting.co.za> Message-ID: <1457461827.95.0.616675323673.issue26465@psf.upfronthosting.co.za> Changes by Steve Dower : ---------- resolution: -> fixed stage: needs patch -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 13:59:11 2016 From: report at bugs.python.org (shakur shams Mullick) Date: Tue, 08 Mar 2016 18:59:11 +0000 Subject: [issue26263] Serialize array.array to JSON by default In-Reply-To: <1454352639.9.0.0979042510265.issue26263@psf.upfronthosting.co.za> Message-ID: <1457463551.31.0.0856096170878.issue26263@psf.upfronthosting.co.za> Changes by shakur shams Mullick : ---------- nosy: +shakur shams Mullick _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 14:32:06 2016 From: report at bugs.python.org (Roundup Robot) Date: Tue, 08 Mar 2016 19:32:06 +0000 Subject: [issue25911] Regression: os.walk now using os.scandir() breaks bytes filenames on windows In-Reply-To: <1450539578.39.0.976654454489.issue25911@psf.upfronthosting.co.za> Message-ID: <20160308193200.31077.26287@psf.io> Roundup Robot added the comment: New changeset 757159fb4847 by Serhiy Storchaka in branch '3.5': Issue #25911: Tring to silence deprecation warnings in bytes path walk tests. https://hg.python.org/cpython/rev/757159fb4847 New changeset ecf4e51c222f by Serhiy Storchaka in branch 'default': Issue #25911: Tring to silence deprecation warnings in bytes path walk tests. https://hg.python.org/cpython/rev/ecf4e51c222f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 14:45:39 2016 From: report at bugs.python.org (Ben Finney) Date: Tue, 08 Mar 2016 19:45:39 +0000 Subject: [issue14102] argparse: add ability to create a man page In-Reply-To: <1330031760.56.0.8938390885.issue14102@psf.upfronthosting.co.za> Message-ID: <1457466339.75.0.539674435761.issue14102@psf.upfronthosting.co.za> Ben Finney added the comment: Oz Tiram wrote: > I doubt if the correct place for formatting a man page should be in argparse.py itself. My solution is an extension of Andial's brecht solution Thank you for that, Oz. I see an easy seam to refactor this work into separate concerns. The formatting of a man page from the parser for the command, can be coupled to the ?argparse? module since it is dependent only on an ArgumentParser plus some extra properties for populating the man page. The building of one man page should not, IMO, be so tightly coupled to a Python distribution. There may be several different commands installed by one distribution. Each man page's fields should mostly come from the parser for the command, not from the distribution metadata. Instead, the build process should be told which parser to use for generating each of the man pages. I propose to work on Oz's module and produce a man page formatter for exactly one ArgumentParser, as an enhancement for ?argparse?. ---------- nosy: +bignose _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 14:45:50 2016 From: report at bugs.python.org (Ben Finney) Date: Tue, 08 Mar 2016 19:45:50 +0000 Subject: [issue14102] argparse: add ability to create a man page In-Reply-To: <1330031760.56.0.8938390885.issue14102@psf.upfronthosting.co.za> Message-ID: <1457466350.78.0.744633434087.issue14102@psf.upfronthosting.co.za> Changes by Ben Finney : ---------- versions: +Python 3.6 -Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 14:48:53 2016 From: report at bugs.python.org (Michael Cuthbert) Date: Tue, 08 Mar 2016 19:48:53 +0000 Subject: [issue17446] doctest test finder doesnt find line numbers of properties In-Reply-To: <1363536507.07.0.43500928967.issue17446@psf.upfronthosting.co.za> Message-ID: <1457466533.88.0.401550021273.issue17446@psf.upfronthosting.co.za> Michael Cuthbert added the comment: looks like we're stuck on a style change (backslash to parens; ironic: I chose backslash to match surrounding code; I never use them myself). tuxtimo - could you fix this? (or I'll do once the move to github is done). Thanks! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 14:49:22 2016 From: report at bugs.python.org (Henrique Andrade) Date: Tue, 08 Mar 2016 19:49:22 +0000 Subject: [issue25459] EAGAIN errors in Python logging module In-Reply-To: <1454871437.87.0.477227769814.issue25459@psf.upfronthosting.co.za> Message-ID: Henrique Andrade added the comment: Vinay, apologies for the long time you took me to respond (the notification was stuck in my Spam folder, thanks Gmail!). Indeed, both of your comments are spot on. In my particular case, I ended up implementing what your first suggestion alludes to (a retry capped by a maximum). The reason for my reporting this is because the existing (mainlined) implementation has shortcomings, which might be affecting others out there. I contacted the module developer, but no response. So assuming we have a consensus from whomever "owns" the module, I can volunteer to do a proper patch. On the issue of maximum retries, I would go with a reasonable (configurable) max as well as a (configurable) back-off sleep. On Sun, Feb 7, 2016 at 1:57 PM, Vinay Sajip wrote: > > Vinay Sajip added the comment: > > The problem with your suggested fix is that if you keep getting EAGAIN, > the handler will appear to hang. If you want to suggest that maybe we limit > the number of tries, then what number of retries would you pick, and why? > Also, a caller might want to know about EAGAIN, so I'm not sure you'd want > to (effectively) swallow it in the handler. > > Perhaps a different strategy (than just trying for ever) would be better. > If you know the application is unusual in having a SIGPIPE handler and you > think this is a contributory factor, why not just subclass the handler, add > a more resilient emit() and use that in your application? > > ---------- > status: open -> pending > > _______________________________________ > Python tracker > > _______________________________________ > -- Henrique Andrade | +1-530-426-2123 | hcma at unscrambl.com | http://unscrambl.com ---------- status: pending -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 14:53:13 2016 From: report at bugs.python.org (Giampaolo Rodola') Date: Tue, 08 Mar 2016 19:53:13 +0000 Subject: [issue25458] ftplib: command response shift - mismatch In-Reply-To: <1445510152.74.0.829316001802.issue25458@psf.upfronthosting.co.za> Message-ID: <1457466793.95.0.288082759853.issue25458@psf.upfronthosting.co.za> Giampaolo Rodola' added the comment: I'm not sure I understood the problem. Perhaps if you provide a patch that would make things more clear and you'd have more chances to see this issue fixed. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 14:59:37 2016 From: report at bugs.python.org (Giampaolo Rodola') Date: Tue, 08 Mar 2016 19:59:37 +0000 Subject: [issue25933] Unhandled exception (TypeError) with ftplib in function retrbinary/retrlines causes inoperable behavior without crashing In-Reply-To: <1450899526.91.0.95420964187.issue25933@psf.upfronthosting.co.za> Message-ID: <1457467177.94.0.445689836317.issue25933@psf.upfronthosting.co.za> Giampaolo Rodola' added the comment: It looks to me that forcing self.voidresp() in case the callback raises an exception is a bad idea: it may easily end up hanging if the server is not supposed to send a response at that point (see: the transfer is not finished). As for the issue per se: I think there's nothing wrong with the current behavior except perhaps we could provide a better error message. But in order to do that we should check file mode before hand and relying on the file mode is also not a good idea IMO because the file object can be anything. ---------- nosy: +giampaolo.rodola _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 15:24:58 2016 From: report at bugs.python.org (Zachary Ware) Date: Tue, 08 Mar 2016 20:24:58 +0000 Subject: [issue26465] Upgrade OpenSSL shipped with python installers In-Reply-To: <1456842373.05.0.727353806198.issue26465@psf.upfronthosting.co.za> Message-ID: <1457468698.06.0.617441505157.issue26465@psf.upfronthosting.co.za> Zachary Ware added the comment: Steve: This broke 64-bit Windows, I haven't tried digging into what's going on yet. See: http://buildbot.python.org/all/builders/AMD64%20Windows7%20SP1%203.x/builds/7331/steps/compile/logs/stdio ---------- resolution: fixed -> stage: resolved -> status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 15:36:35 2016 From: report at bugs.python.org (Martin Panter) Date: Tue, 08 Mar 2016 20:36:35 +0000 Subject: [issue26456] import _tkinter + TestForkInThread leaves zombie with stalled thread In-Reply-To: <1456727351.62.0.83247971741.issue26456@psf.upfronthosting.co.za> Message-ID: <1457469395.53.0.192033941053.issue26456@psf.upfronthosting.co.za> Martin Panter added the comment: The change to the test seems to have the desired effect. The buildbots are no longer timing out (tests are failing for other reasons). ---------- resolution: -> fixed stage: commit review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 15:41:31 2016 From: report at bugs.python.org (Martin Panter) Date: Tue, 08 Mar 2016 20:41:31 +0000 Subject: [issue15068] fileinput requires two EOF when reading stdin In-Reply-To: <1339687174.96.0.0386214807139.issue15068@psf.upfronthosting.co.za> Message-ID: <1457469691.22.0.890272875234.issue15068@psf.upfronthosting.co.za> Martin Panter added the comment: It seems this change is causing some (intermittent?) buildbot failures in 2.7: http://buildbot.python.org/all/builders/s390x%20RHEL%202.7/builds/273/steps/test/logs/stdio ====================================================================== FAIL: test_saveall (test.test_gc.GCTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/dje/cpython-buildarea/2.7.edelsohn-rhel-z/build/Lib/test/test_gc.py", line 199, in test_saveall self.assertEqual(gc.garbage, []) AssertionError: Lists differ: [ Diff is 1461 characters long. Set self.maxDiff to None to see it. ====================================================================== FAIL: test_create_read (test.test_csv.TestLeaks) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/dje/cpython-buildarea/2.7.edelsohn-rhel-z/build/Lib/test/test_csv.py", line 1103, in test_create_read self.assertEqual(gc.garbage, []) AssertionError: Lists differ: [ Diff is 1461 characters long. Set self.maxDiff to None to see it. ---------- nosy: +martin.panter _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 15:46:31 2016 From: report at bugs.python.org (Steve Dower) Date: Tue, 08 Mar 2016 20:46:31 +0000 Subject: [issue26465] Upgrade OpenSSL shipped with python installers In-Reply-To: <1456842373.05.0.727353806198.issue26465@psf.upfronthosting.co.za> Message-ID: <1457469991.97.0.964830039201.issue26465@psf.upfronthosting.co.za> Steve Dower added the comment: I didn't have nasm on the path when preparing, so it made empty asm files. I've committed the correctly build ASM files, and I'll trigger the buildbots to clean and patch the prepare script to fail if nasm is not available. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 16:24:04 2016 From: report at bugs.python.org (Julien) Date: Tue, 08 Mar 2016 21:24:04 +0000 Subject: [issue26512] Vocabulary: Using "integral" in library/stdtypes.html Message-ID: <1457472244.72.0.113699245831.issue26512@psf.upfronthosting.co.za> New submission from Julien: o/ TL;DR: I think the various usages of "Integral" in https://docs.python.org/3.5/library/stdtypes.html#numeric-types-int-float-complex are either wrong or too hard to understand and should be rewriten as "int". While translating the documentation I found the sentence "x truncated to Integral" in https://docs.python.org/3.5/library/stdtypes.html#numeric-types-int-float-complex for the `math.floor(x)` method. By "Integral" I assume you're speaking about the ABC `numbers.Integral`, whish is already not clear, but the capital I helps. According to pydoc and PEP3141, the `numbers.Integral` ABC inherits from Rational, which inherits from Real which inherits from Complex which inherits from Number. So number is the broader ABC and integral the opposite, the representation of an integer. I do _NOT_ assume that someone reading the stdtypes.html section is aware of those ABCs, so I don't think it's nice for them to use them without linking to them. So I infer than "x truncated to integral" means "x truncated to the nearest integer". Which is far more readable. Two lines after, I found "The greatest integral float <= x" for `math.floor(x)` which is less readable, no capital I to `integral` and what is an `integral float` ? Also the documentation of `math.floor` states an `int` is returned (as the doc for math.trunc states an Integral is returned). So there's two possibilities here: - The doc uses vocabulary and phrase structures I don't understand and "integral float" actually mean something. - The doc is not clear In both cases, I suggest to either transform "integral" usages to a link to :class:`numbers.Integral` or simply speaking of "int" here. Context: I'm translating the documentation in French, I achieved `tutorial.html` and `functions.html` and it's until here the hardest sentence to understand (others were simply wrong like in http://bugs.python.org/issue26029) or understandable, so even if those structures are semantically and gramatically correct, they're clearly one of the hardest to understand, which is sad as we're only speaking of rounding numbers. I mean, if there's a goal to sand away spikes in doc readability, this one is a big one. So, can an english native speaker can enlighten me about this ? Bests, ---------- assignee: docs at python components: Documentation messages: 261380 nosy: docs at python, sizeof priority: normal severity: normal status: open title: Vocabulary: Using "integral" in library/stdtypes.html type: enhancement versions: Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 16:28:07 2016 From: report at bugs.python.org (Steve Dower) Date: Tue, 08 Mar 2016 21:28:07 +0000 Subject: [issue26465] Upgrade OpenSSL shipped with python installers In-Reply-To: <1456842373.05.0.727353806198.issue26465@psf.upfronthosting.co.za> Message-ID: <1457472487.18.0.559387464243.issue26465@psf.upfronthosting.co.za> Changes by Steve Dower : ---------- resolution: -> fixed stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 16:31:53 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 08 Mar 2016 21:31:53 +0000 Subject: [issue15068] fileinput requires two EOF when reading stdin In-Reply-To: <1339687174.96.0.0386214807139.issue15068@psf.upfronthosting.co.za> Message-ID: <1457472713.27.0.507979021775.issue15068@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Ah, thanks Martin. I forgot that assigning an attribute to a bound method creates a reference loop. This can be fixed without performance lost by using a clever trick. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 16:37:04 2016 From: report at bugs.python.org (Roundup Robot) Date: Tue, 08 Mar 2016 21:37:04 +0000 Subject: [issue15068] fileinput requires two EOF when reading stdin In-Reply-To: <1339687174.96.0.0386214807139.issue15068@psf.upfronthosting.co.za> Message-ID: <20160308213646.10718.29254@psf.io> Roundup Robot added the comment: New changeset 88d6742aa99a by Serhiy Storchaka in branch '2.7': Issue #15068: Avoid creating a reference loop in fileinput. https://hg.python.org/cpython/rev/88d6742aa99a New changeset a0de41b46aa6 by Serhiy Storchaka in branch '3.5': Issue #15068: Avoid creating a reference loop in fileinput. https://hg.python.org/cpython/rev/a0de41b46aa6 New changeset 27c9849ba5f3 by Serhiy Storchaka in branch 'default': Issue #15068: Avoid creating a reference loop in fileinput. https://hg.python.org/cpython/rev/27c9849ba5f3 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 16:37:32 2016 From: report at bugs.python.org (Alexander Belopolsky) Date: Tue, 08 Mar 2016 21:37:32 +0000 Subject: [issue26512] Vocabulary: Using "integral" in library/stdtypes.html In-Reply-To: <1457472244.72.0.113699245831.issue26512@psf.upfronthosting.co.za> Message-ID: <1457473052.79.0.132600249845.issue26512@psf.upfronthosting.co.za> Alexander Belopolsky added the comment: In the contexts that you mentioned, "integral" is a synonym of "integer." ---------- nosy: +belopolsky _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 16:41:33 2016 From: report at bugs.python.org (Florian Roth) Date: Tue, 08 Mar 2016 21:41:33 +0000 Subject: [issue26513] platform.win32_ver() broken in 2.7.11 Message-ID: <1457473293.66.0.928061603359.issue26513@psf.upfronthosting.co.za> New submission from Florian Roth: Using Python 2.7.9 and 2.7.10 (32bit) on a Windows Server 2008 R2 64bit System platform.win32_ver() shows the following, which is correct: ('2008ServerR2', '6.1.7601', 'SP1', u'Multiprocessor Free') Using Python version 2.7.11 (32bit) on the same Windows 2008 R2 server shows: ('7', '6.1.7601', 'SP1', u'Multiprocessor Free') which is wrong. Platform OS detection seems to be broken with version 2.7.11. ---------- components: Windows messages: 261384 nosy: Florian Roth, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: platform.win32_ver() broken in 2.7.11 versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 16:55:55 2016 From: report at bugs.python.org (Marc Guetg) Date: Tue, 08 Mar 2016 21:55:55 +0000 Subject: [issue26514] Object defines '__ne__' as 'not __eq__' if '__ne__' is not implemented Message-ID: <1457474155.28.0.06785872232.issue26514@psf.upfronthosting.co.za> New submission from Marc Guetg: I propose to change __ne__ of `object` in the following form: class NewObject(object): def __ne__(self, other): return not self.__eq__(other) Currently overwriting the `__eq__` method requires also overwriting `__ne__`. In a vast majority of cases this results in some boilerplate code as: (a == b) ^ (a != b) == True to reduce surprises. Changing the default behavior still allows for the limited number of use cases where we want to implement __ne__ differently. In short I propose the same behavior than __str__ and __repr__ have for __eq__ and __ne__. (https://docs.python.org/3/reference/datamodel.html#object.__str__) ---------- components: Interpreter Core messages: 261385 nosy: Marc Guetg priority: normal severity: normal status: open title: Object defines '__ne__' as 'not __eq__' if '__ne__' is not implemented type: enhancement versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 17:10:09 2016 From: report at bugs.python.org (Ethan Furman) Date: Tue, 08 Mar 2016 22:10:09 +0000 Subject: [issue26514] Object defines '__ne__' as 'not __eq__' if '__ne__' is not implemented In-Reply-To: <1457474155.28.0.06785872232.issue26514@psf.upfronthosting.co.za> Message-ID: <1457475009.11.0.571928483653.issue26514@psf.upfronthosting.co.za> Ethan Furman added the comment: The following behaviour is from 3.5: --> class Huh: ... def __eq__(self, other): ... return other == 'blah' ... --> h = Huh() --> h == 'ew' False --> h != 'ew' True --> h == 'blah' True --> h != 'blah' False Which seems to be exactly what you want. Do you have a counter-example? ---------- nosy: +ethan.furman _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 17:35:44 2016 From: report at bugs.python.org (Josh Rosenberg) Date: Tue, 08 Mar 2016 22:35:44 +0000 Subject: [issue26514] Object defines '__ne__' as 'not __eq__' if '__ne__' is not implemented In-Reply-To: <1457474155.28.0.06785872232.issue26514@psf.upfronthosting.co.za> Message-ID: <1457476544.43.0.0601738956509.issue26514@psf.upfronthosting.co.za> Josh Rosenberg added the comment: It's not exactly what was asked for, but it's actually better (in that the __ne__ default implementation handles NotImplemented correctly). Per the docs at https://docs.python.org/3/reference/datamodel.html#object.__eq__ : "By default, __ne__() delegates to __eq__() and inverts the result unless it is NotImplemented." This feature was never backported to 2.7, but it's existed in one form or another for the entire 3.x line. ---------- nosy: +josh.r _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 17:41:20 2016 From: report at bugs.python.org (Collin Anderson) Date: Tue, 08 Mar 2016 22:41:20 +0000 Subject: [issue25228] Regression in cookie parsing with brackets and quotes In-Reply-To: <1443113876.69.0.763546669405.issue25228@psf.upfronthosting.co.za> Message-ID: <1457476880.73.0.479508139261.issue25228@psf.upfronthosting.co.za> Collin Anderson added the comment: It should be safe to hard split on semicolon. `name="some;value"` is not valid, even though it's quoted. I think raw double quotes, commas, semicolons and backslashes are _always_ invalid characters in cookie values. >From https://tools.ietf.org/html/rfc6265: {{{ cookie-value = *cookie-octet / ( DQUOTE *cookie-octet DQUOTE ) cookie-octet = %x21 / %x23-2B / %x2D-3A / %x3C-5B / %x5D-7E ; US-ASCII characters excluding CTLs, ; whitespace DQUOTE, comma, semicolon, ; and backslash }}} ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 17:43:31 2016 From: report at bugs.python.org (Peter Pan) Date: Tue, 08 Mar 2016 22:43:31 +0000 Subject: [issue25458] ftplib: command response shift - mismatch In-Reply-To: <1445510152.74.0.829316001802.issue25458@psf.upfronthosting.co.za> Message-ID: <1457477011.97.0.761423943761.issue25458@psf.upfronthosting.co.za> Peter Pan added the comment: The problem in my example is ftplib reports a "226" response to command "NOOP" which is nonsense. ftplib received "226" before "ftp.sendcmd('NOOP')" was called. Since "transfercmd()" returns a socket, ftplib was planned to allow for manual transfer socket handling, but it is currently unable to handle the asynchronous responses from the server when the transfer is done. This is a bug or design error. Multiple changes are needed to support manual transfer socket handling. I suggest the following: Since asynchronous responses from the server are possible on the command socket, "set_debuglevel(1)" must report them at once, but this would require multithreading. A good compromise is to debug print and clear any buffered status right before sending the next command. We also need a method to check the last status code, in order to know the result of the last manual transfer. ftplib has to store it separately as an attribute. New attribute ------------- this.last_status_code = None #has no effect to any command or debug output this.last_status_message New internal method ------------------- #loop: look for buffered status response; if present, print debug and assign this.last_status = buffer.pop() .unbuffer(): ... New user methods ---------------- #Set last status to None so we can use "get_last_status" to check/poll for the next one. .clear_last_status(): this.last_status_code = None this.last_status_message = "" return #Return the last status received from the server; if there is one on the buffer, unbuffer and return that. .get_last_status(): this.unbuffer() return [this.last_status_code, this.last_status_message] ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 18:54:15 2016 From: report at bugs.python.org (Eryk Sun) Date: Tue, 08 Mar 2016 23:54:15 +0000 Subject: [issue26514] Object defines '__ne__' as 'not __eq__' if '__ne__' is not implemented In-Reply-To: <1457474155.28.0.06785872232.issue26514@psf.upfronthosting.co.za> Message-ID: <1457481255.9.0.890180915727.issue26514@psf.upfronthosting.co.za> Changes by Eryk Sun : ---------- resolution: -> works for me stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 18:58:17 2016 From: report at bugs.python.org (Steve Dower) Date: Tue, 08 Mar 2016 23:58:17 +0000 Subject: [issue26513] platform.win32_ver() broken in 2.7.11 In-Reply-To: <1457473293.66.0.928061603359.issue26513@psf.upfronthosting.co.za> Message-ID: <1457481497.78.0.455266949377.issue26513@psf.upfronthosting.co.za> Steve Dower added the comment: Nothing has changed here as far as I'm aware. The part of platform.py in use here has potentially different behavior if you have pywin32 installed. Is that the case? Maybe you updated that as well or haven't installed it for 2.7.11 yet? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 19:45:58 2016 From: report at bugs.python.org (Michael Felt) Date: Wed, 09 Mar 2016 00:45:58 +0000 Subject: [issue26466] could not build python 2.7.11 on AIX In-Reply-To: <1456844902.77.0.455974310535.issue26466@psf.upfronthosting.co.za> Message-ID: <1457484358.33.0.231403705339.issue26466@psf.upfronthosting.co.za> Michael Felt added the comment: Hope it is okay for me to close this. As it is working with the additional flag to configure. ---------- status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 19:52:58 2016 From: report at bugs.python.org (Michael Felt) Date: Wed, 09 Mar 2016 00:52:58 +0000 Subject: [issue26439] ctypes.util.find_library fails when ldconfig/glibc not available (e.g., AIX) In-Reply-To: <1456413023.18.0.874865601403.issue26439@psf.upfronthosting.co.za> Message-ID: <1457484778.15.0.336132709702.issue26439@psf.upfronthosting.co.za> Michael Felt added the comment: The patch works when installed on top of pre-compiled version (e.g., copy the two files to /opt/lib/python2.7/ctypes/ but there seems to be a nasty side-effect when trying to build. make completes, but make install fails during a compile step. Please assist with howto see how/why ctypes/util is impacting this part. And - for my first adventure into python please provide the needed (expected) feedback. Michael make install DESTDIR=/var/aixtools/aixtools/python/2.7.11.2 > .buildaix/install.out Listing /var/aixtools/aixtools/python/2.7.11.2/opt/lib/python2.7/xml/sax ... Compiling /var/aixtools/aixtools/python/2.7.11.2/opt/lib/python2.7/xml/sax/__init__.py ... Compiling /var/aixtools/aixtools/python/2.7.11.2/opt/lib/python2.7/xml/sax/_exceptions.py ... Compiling /var/aixtools/aixtools/python/2.7.11.2/opt/lib/python2.7/xml/sax/expatreader.py ... Compiling /var/aixtools/aixtools/python/2.7.11.2/opt/lib/python2.7/xml/sax/handler.py ... Compiling /var/aixtools/aixtools/python/2.7.11.2/opt/lib/python2.7/xml/sax/saxutils.py ... Compiling /var/aixtools/aixtools/python/2.7.11.2/opt/lib/python2.7/xml/sax/xmlreader.py ... Compiling /var/aixtools/aixtools/python/2.7.11.2/opt/lib/python2.7/xmllib.py ... Compiling /var/aixtools/aixtools/python/2.7.11.2/opt/lib/python2.7/xmlrpclib.py ... Compiling /var/aixtools/aixtools/python/2.7.11.2/opt/lib/python2.7/zipfile.py ... So, zipfile.py seems to exit non-zero. :( ---------- keywords: +patch Added file: http://bugs.python.org/file42094/python.Lib.ctypes.160309.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 20:10:26 2016 From: report at bugs.python.org (Roundup Robot) Date: Wed, 09 Mar 2016 01:10:26 +0000 Subject: [issue21042] ctypes.util.find_library() should return full pathname instead of filename in linux In-Reply-To: <1395614835.79.0.900137034576.issue21042@psf.upfronthosting.co.za> Message-ID: <20160309011022.10714.38791@psf.io> Roundup Robot added the comment: New changeset 3092cf163eb4 by Martin Panter in branch 'default': Issue #21042: Return full path in ctypes.util.find_library() on Linux https://hg.python.org/cpython/rev/3092cf163eb4 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 21:00:40 2016 From: report at bugs.python.org (Xiang Zhang) Date: Wed, 09 Mar 2016 02:00:40 +0000 Subject: [issue18156] Add an 'attr' attribute to AttributeError In-Reply-To: <1370619110.26.0.980030189702.issue18156@psf.upfronthosting.co.za> Message-ID: <1457488840.35.0.494162281857.issue18156@psf.upfronthosting.co.za> Xiang Zhang added the comment: The concerns mentioned by haypo seems to have existed in PEP473. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 21:30:32 2016 From: report at bugs.python.org (pablo sacristan) Date: Wed, 09 Mar 2016 02:30:32 +0000 Subject: [issue26508] Infinite crash leading to DoS In-Reply-To: <1457403922.14.0.94490204521.issue26508@psf.upfronthosting.co.za> Message-ID: <1457490632.9.0.0176177435373.issue26508@psf.upfronthosting.co.za> pablo sacristan added the comment: Then it is no bug that it crashes python? You don't have to put it in a loop, but by looping it I am adding the part that makes it take more time but will keep on crashing infinitely, take away the while loop but not what it has inside and then also delete the os.system() and you get python to crash once. Is a crash not a bug? ---------- resolution: not a bug -> works for me _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 21:32:08 2016 From: report at bugs.python.org (pablo sacristan) Date: Wed, 09 Mar 2016 02:32:08 +0000 Subject: [issue26508] Infinite crash leading to DoS In-Reply-To: <1457403922.14.0.94490204521.issue26508@psf.upfronthosting.co.za> Message-ID: <1457490728.22.0.0829046693503.issue26508@psf.upfronthosting.co.za> pablo sacristan added the comment: New content for crash.py: import ctypes, struct, sys, os inner = () outer = (inner,) c_outer = (ctypes.c_char * sys.getsizeof(outer)).from_address(id(outer)) inner_index = c_outer[:].find(struct.pack('P', id(inner))) c_outer[inner_index:inner_index+struct.calcsize('P')] = struct.pack('P', id(outer)) print outer ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 21:33:25 2016 From: report at bugs.python.org (pablo sacristan) Date: Wed, 09 Mar 2016 02:33:25 +0000 Subject: [issue26508] Infinite crash leading to DoS In-Reply-To: <1457403922.14.0.94490204521.issue26508@psf.upfronthosting.co.za> Message-ID: <1457490805.66.0.500753048303.issue26508@psf.upfronthosting.co.za> Changes by pablo sacristan : ---------- status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 21:41:55 2016 From: report at bugs.python.org (Brett Cannon) Date: Wed, 09 Mar 2016 02:41:55 +0000 Subject: [issue26508] Infinite crash leading to DoS In-Reply-To: <1457403922.14.0.94490204521.issue26508@psf.upfronthosting.co.za> Message-ID: <1457491315.69.0.205893016914.issue26508@psf.upfronthosting.co.za> Brett Cannon added the comment: Victor's point is that this isn't a bug because you are manipulating the C API to make this occur. That means there is no safety guarantee and thus this is not a bug but simply a mis-use of the C API. ---------- nosy: +brett.cannon resolution: works for me -> not a bug status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 21:43:41 2016 From: report at bugs.python.org (Brett Cannon) Date: Wed, 09 Mar 2016 02:43:41 +0000 Subject: [issue26515] Update extending/embedding docs to new way to build modules in C Message-ID: <1457491421.2.0.684118231911.issue26515@psf.upfronthosting.co.za> New submission from Brett Cannon: https://docs.python.org/3/extending/extending.html#a-simple-example uses PyModule_Create() instead of PyModuleDef_Init(). ---------- assignee: docs at python components: Documentation messages: 261398 nosy: brett.cannon, docs at python, eric.snow, ncoghlan priority: normal severity: normal stage: needs patch status: open title: Update extending/embedding docs to new way to build modules in C versions: Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 22:00:24 2016 From: report at bugs.python.org (Dan Haffey) Date: Wed, 09 Mar 2016 03:00:24 +0000 Subject: [issue21910] File protocol should document if writelines must handle generators sensibly In-Reply-To: <1404380309.75.0.473808735546.issue21910@psf.upfronthosting.co.za> Message-ID: <1457492424.87.0.520193001251.issue21910@psf.upfronthosting.co.za> Dan Haffey added the comment: +1, I just lost an hour-plus compute job to this. It sure violates POLA. I've been passing large generators to file.writelines since about as long as generators have existed, so I never would have guessed that a class named "StreamWriter" of all things wouldn't, you know, stream its writelines argument. ---------- nosy: +dhaffey _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 22:20:59 2016 From: report at bugs.python.org (Martin Panter) Date: Wed, 09 Mar 2016 03:20:59 +0000 Subject: [issue21042] ctypes.util.find_library() should return full pathname instead of filename in linux In-Reply-To: <1395614835.79.0.900137034576.issue21042@psf.upfronthosting.co.za> Message-ID: <1457493659.15.0.650449686479.issue21042@psf.upfronthosting.co.za> Martin Panter added the comment: It looks like the ldconfig parsing isn?t working for some ABIs. See the following buildbot failures: * Cortex A15 armv7l: http://buildbot.python.org/all/builders/ARMv7%20Ubuntu%203.x/builds/3721/steps/test/logs/stdio * ppc64le POWER8: http://buildbot.python.org/all/builders/PPC64LE%20Fedora%203.x/builds/769/steps/test/logs/stdio I presume there are other flags in the ABI string, perhaps like (libc6,hard-float) on ARM. The code that produces these strings seems to be here: . Looking closer at the find_library() implementation, I also realize it is not correct to say an absolute path is always returned. If the ldconfig check fails, it falls back to _get_soname(). I think we have the following options: * Adjust the documentation to say an absolute path is only returned if the ldconfig call works * Figure out how to get the right ldconfig flags for ARM and PPC * Use the old parsing code on ARM and PPC platforms, and only return a full path on x86 or other platforms * Revert the whole change ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 9 02:29:47 2016 From: report at bugs.python.org (Martin Panter) Date: Wed, 09 Mar 2016 07:29:47 +0000 Subject: [issue26499] http.client.IncompleteRead from HTTPResponse read after part reading file In-Reply-To: <1457345453.59.0.0327827539319.issue26499@psf.upfronthosting.co.za> Message-ID: <1457508587.81.0.32623148343.issue26499@psf.upfronthosting.co.za> Martin Panter added the comment: Thanks for the report and the patch. It looks okay as far as it goes, but I think there are other related bugs: ## read1() doesn?t update length either ## >>> handle = urlopen("https://www.python.org/") >>> len(handle.read1()) 7374 >>> handle.read() Traceback (most recent call last): File "", line 1, in File "/home/proj/python/cpython/Lib/http/client.py", line 462, in read s = self._safe_read(self.length) File "/home/proj/python/cpython/Lib/http/client.py", line 614, in _safe_read raise IncompleteRead(b''.join(s), amt) http.client.IncompleteRead: IncompleteRead(39583 bytes read, 7374 more expected) ## readline() and read1() blindly read beyond Content-Length ## >>> conn = HTTPSConnection("www.python.org") >>> conn.request("GET", "/") >>> resp = conn.getresponse() >>> resp.readlines() # Hangs until the connection is closed I wonder if anyone has considered implementing HTTPResponse by wrapping or subclassing BufferedReader; that way you get well-tested readline() etc functionality for free. The HTTP protocol (Connection: close, Content-Length, chunked decoding) could be handled by an internal RawIOBase.readinto() method. ---------- nosy: +martin.panter _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 9 03:11:14 2016 From: report at bugs.python.org (Florian Roth) Date: Wed, 09 Mar 2016 08:11:14 +0000 Subject: [issue26513] platform.win32_ver() broken in 2.7.11 In-Reply-To: <1457473293.66.0.928061603359.issue26513@psf.upfronthosting.co.za> Message-ID: <1457511074.73.0.57461457679.issue26513@psf.upfronthosting.co.za> Florian Roth added the comment: Screenshot 2.7.9 and platform.win32_ver() ---------- Added file: http://bugs.python.org/file42095/Screen Shot 2016-03-08 at 19.05.38.png _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 9 03:18:08 2016 From: report at bugs.python.org (Florian Roth) Date: Wed, 09 Mar 2016 08:18:08 +0000 Subject: [issue26513] platform.win32_ver() broken in 2.7.11 In-Reply-To: <1457473293.66.0.928061603359.issue26513@psf.upfronthosting.co.za> Message-ID: <1457511488.32.0.462619310191.issue26513@psf.upfronthosting.co.za> Florian Roth added the comment: I tested it on two different Windows 2008 R2 server systems. Same results. And I checked the issue by uninstalling 2.7.11 and installed 2.7.9 and 2.9.10 to verify. This means that not the system itself can be the problem. Please see screenshots: https://www.dropbox.com/sh/26vfz4f8jziv665/AACtkCNK-ypAtquKwglUVdqQa?dl=0 I'll also check the 64bit version. ---------- Added file: http://bugs.python.org/file42096/Screen Shot 2016-03-08 at 18.51.32.png _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 9 03:29:15 2016 From: report at bugs.python.org (Florian Roth) Date: Wed, 09 Mar 2016 08:29:15 +0000 Subject: [issue26513] platform.win32_ver() broken in 2.7.11 In-Reply-To: <1457473293.66.0.928061603359.issue26513@psf.upfronthosting.co.za> Message-ID: <1457512155.94.0.0503673587268.issue26513@psf.upfronthosting.co.za> Florian Roth added the comment: Confirmed. Version 2.7.11 64bit is erroneous too. Version 2.7.10 64bit works fine. I added the 64bit version screenshots to the shared dropbox folder. I'll downgrade all my projects to version 2.7.10 as the OS version detection is essential for proper function. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 9 03:30:19 2016 From: report at bugs.python.org (SilentGhost) Date: Wed, 09 Mar 2016 08:30:19 +0000 Subject: [issue26499] http.client.IncompleteRead from HTTPResponse read after part reading file In-Reply-To: <1457345453.59.0.0327827539319.issue26499@psf.upfronthosting.co.za> Message-ID: <1457512219.49.0.535267497199.issue26499@psf.upfronthosting.co.za> SilentGhost added the comment: Here is the updated patch. I only included the additional fix for read1 since readlines is not overwritten in the HTTPConnection. Not sure how to write test for it, does it need a much longer body (compared to the one in tests) to produce this behaviour? The larger refactoring might be appropriate for 3.6, but I believe these smaller fixed could go into the next micro release. ---------- Added file: http://bugs.python.org/file42097/issue26499_2.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 9 03:45:49 2016 From: report at bugs.python.org (Julien) Date: Wed, 09 Mar 2016 08:45:49 +0000 Subject: [issue26512] Vocabulary: Using "integral" in library/stdtypes.html In-Reply-To: <1457472244.72.0.113699245831.issue26512@psf.upfronthosting.co.za> Message-ID: <1457513149.02.0.424018006127.issue26512@psf.upfronthosting.co.za> Julien added the comment: > In the contexts that you mentioned, "integral" is a synonym of "integer." Can you provide a source ? There's no mention of "integral" in the Wikipedia page of "integer" (but there's mentions of "integral element" and "integral domain" which are not synonyms for "integer". Even if "integral" is a synonym for "integer", I think we should use "integer" or "int" in the documentation because "integral" is harder to understand as readers are searching why "integral" is used in this particular context instead of "integer". It looks like the documentation describes the mathematical, theoretical, point of view of those functions, as supported by the PEP3141, but those functions are not theoretical, they're actual implementations returning actual integers. I can understand the need to abstract the implementations to make the documentation more readable, we're already not manipulating bits or even bytes, there's nice abstractions of those implementations so we can manipulate `int`, `float` etc, which are also implementation we may want to abstract again and say we're not manipulating "the implementation" (like "an int") but a mathematical domain (like "a natural number"), but going all the way down to vocabulary I can't even find on Wikipedia is probably going the wrong way: The documentation is less readable this way. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 9 03:52:44 2016 From: report at bugs.python.org (Roundup Robot) Date: Wed, 09 Mar 2016 08:52:44 +0000 Subject: [issue26177] tkinter: Canvas().keys returns empty strings. In-Reply-To: <1453445489.52.0.0197706093826.issue26177@psf.upfronthosting.co.za> Message-ID: <20160309085240.10254.44139@psf.io> Roundup Robot added the comment: New changeset d86891dee68a by Serhiy Storchaka in branch '3.5': Issue #26177: Fixed the keys() method for Canvas and Scrollbar widgets. https://hg.python.org/cpython/rev/d86891dee68a New changeset f0c895fb0374 by Serhiy Storchaka in branch '2.7': Issue #26177: Fixed the keys() method for Canvas and Scrollbar widgets. https://hg.python.org/cpython/rev/f0c895fb0374 New changeset 3a0bc2efed26 by Serhiy Storchaka in branch 'default': Issue #26177: Fixed the keys() method for Canvas and Scrollbar widgets. https://hg.python.org/cpython/rev/3a0bc2efed26 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 9 03:55:11 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 09 Mar 2016 08:55:11 +0000 Subject: [issue26177] tkinter: Canvas().keys returns empty strings. In-Reply-To: <1453445489.52.0.0197706093826.issue26177@psf.upfronthosting.co.za> Message-ID: <1457513711.96.0.445263578033.issue26177@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- resolution: -> fixed stage: commit review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 9 04:03:19 2016 From: report at bugs.python.org (STINNER Victor) Date: Wed, 09 Mar 2016 09:03:19 +0000 Subject: [issue26508] Infinite crash leading to DoS In-Reply-To: <1457403922.14.0.94490204521.issue26508@psf.upfronthosting.co.za> Message-ID: <1457514199.1.0.591654866854.issue26508@psf.upfronthosting.co.za> STINNER Victor added the comment: "Then it is no bug that it crashes python?" The bug is your program creating inconsistent data. Without ctypes, you cannot create such inconsistent data. "Is a crash not a bug?" There are various ways to "crash" Python, but most of them are deliberate bugs. For example: haypo at selma$ python3 Python 3.4.3 (default, Jun 29 2015, 12:16:01) [GCC 5.1.1 20150618 (Red Hat 5.1.1-4)] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import ctypes >>> ctypes.string_at(0) Erreur de segmentation (core dumped) The ctypes doesn't prevent you from making mistakes. If you use ctypes, you must be very careful and understand what you are doing. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 9 04:21:58 2016 From: report at bugs.python.org (Martin Panter) Date: Wed, 09 Mar 2016 09:21:58 +0000 Subject: [issue26499] http.client.IncompleteRead from HTTPResponse read after part reading file In-Reply-To: <1457345453.59.0.0327827539319.issue26499@psf.upfronthosting.co.za> Message-ID: <1457515318.3.0.976665565187.issue26499@psf.upfronthosting.co.za> Martin Panter added the comment: Yes I agree it would be best to fix the bug(s) without major refactoring if practical. To fix the other bug, I think the parameters in read1(n) and readline(limit) need to be capped at self.length. The inherited BufferedIOBase.readlines() implementation should just call readline() multiple times. The point is that if you call readline() when self.length is reduced to zero, it should behave like EOF, rather than waiting for more data from the socket. To test this, you might be able to use the FakeSocket class. You might have to add a second HTTP response to the data, and test that readline() etc doesn?t read any of the second response. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 9 04:23:23 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 09 Mar 2016 09:23:23 +0000 Subject: [issue26513] platform.win32_ver() broken in 2.7.11 In-Reply-To: <1457473293.66.0.928061603359.issue26513@psf.upfronthosting.co.za> Message-ID: <1457515403.85.0.916813307425.issue26513@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: May be this is related to issue19143. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 9 05:43:00 2016 From: report at bugs.python.org (Filipp Andjelo) Date: Wed, 09 Mar 2016 10:43:00 +0000 Subject: [issue26387] Crash calling sqlite3_close with invalid pointer In-Reply-To: <1455818373.79.0.020961668279.issue26387@psf.upfronthosting.co.za> Message-ID: <1457520180.8.0.770696322577.issue26387@psf.upfronthosting.co.za> Filipp Andjelo added the comment: The issue26494 seems really suspicious, could be our case. And regarding my patch, nice to know, you are the same opinion. However, the code there is looking very strange. I really don't understand, why there are mutex guards anyway, since close() can only be called from one thread (there is a check) and dealloc() can only be called, when the object is not in use anymore. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 9 05:47:32 2016 From: report at bugs.python.org (Pau Tallada) Date: Wed, 09 Mar 2016 10:47:32 +0000 Subject: [issue9998] ctypes find_library should search LD_LIBRARY_PATH on linux In-Reply-To: <1285857910.26.0.582948500976.issue9998@psf.upfronthosting.co.za> Message-ID: <1457520452.55.0.66962407826.issue9998@psf.upfronthosting.co.za> Pau Tallada added the comment: Any progress on this? It also affects installation of rtree (https://github.com/Toblerity/rtree/issues/56) ---------- nosy: +Pau Tallada _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 9 06:15:15 2016 From: report at bugs.python.org (STINNER Victor) Date: Wed, 09 Mar 2016 11:15:15 +0000 Subject: [issue26516] Add PYTHONMALLOC env var and add support for malloc debug hooks in release mode Message-ID: <1457522115.12.0.78692190259.issue26516@psf.upfronthosting.co.za> New submission from STINNER Victor: Attached patch: - Add PYTHONMALLOC env var which accepts 4 values: * pymalloc: use pymalloc for PyObject_Malloc(), malloc for PyMem_Malloc() and PyMem_RawMalloc() * pymalloc_debug: pymalloc + debug hooks * malloc: use malloc for PyObject_Malloc(), PyMem_Malloc() and PyMem_RawMalloc() * malloc_debug: malloc + debug hooks - Add support for debug hooks in release mode - Add unit test for debug hooks in test_capi.py - Add unit on misuse of memory allocators in test_capi.py PYTHONMALLOC is used even if -E command line option is used, I prefer to keep the code simple. PYTHONMALLOC must be checked before the first call to any Python memory allocator, so it must occur very earlier. Well, it's simply the first instruction of main()... My main use case is to be able to use debug hooks to detect: * misuse of python memory allocators like object allocated with PyObject_Malloc() and freed with PyMem_Free() * buffer overflow * buffer underlow ---------- files: pymem.patch keywords: patch messages: 261413 nosy: haypo, lemburg, serhiy.storchaka priority: normal severity: normal status: open title: Add PYTHONMALLOC env var and add support for malloc debug hooks in release mode type: enhancement versions: Python 3.6 Added file: http://bugs.python.org/file42098/pymem.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 9 06:45:27 2016 From: report at bugs.python.org (STINNER Victor) Date: Wed, 09 Mar 2016 11:45:27 +0000 Subject: [issue26516] Add PYTHONMALLOC env var and add support for malloc debug hooks in release mode In-Reply-To: <1457522115.12.0.78692190259.issue26516@psf.upfronthosting.co.za> Message-ID: <1457523927.89.0.704118697318.issue26516@psf.upfronthosting.co.za> STINNER Victor added the comment: The output of sys._debugmallocstats() contains different info: * Stats of type free lists * pymalloc stats * number of calls to memory allocators The available info depends on: * pymalloc disabled at compilation with ./configure --without-pymalloc * pymalloc disabled at runtime with PYTHONMALLOC=malloc or PYTHONMALLOC=malloc_debug * debug hooks adds the "times object malloc called" counter: by default if Python is compiled with ./configure --with-pydebug, or enabled at runtime using PYTHONMALLOC=pymalloc_debug or PYTHONMALLOC=malloc_debug ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 9 06:47:37 2016 From: report at bugs.python.org (STINNER Victor) Date: Wed, 09 Mar 2016 11:47:37 +0000 Subject: [issue26516] Add PYTHONMALLOC env var and add support for malloc debug hooks in release mode In-Reply-To: <1457522115.12.0.78692190259.issue26516@psf.upfronthosting.co.za> Message-ID: <1457524057.88.0.985363623353.issue26516@psf.upfronthosting.co.za> STINNER Victor added the comment: Example with Python compiled in release mode. By default, a buffer overflow is not detected. It may crash later, in a random place... $ ./python -c 'import _testcapi; _testcapi.pymem_buffer_overflow()' Enabling debug hooks detects the buffer overflow immediatly: $ PYTHONMALLOC=pymalloc_debug ./python -c 'import _testcapi; _testcapi.pymem_buffer_overflow()' Debug memory block at address p=0x1a7f490: API 'm' 16 bytes originally requested The 7 pad bytes at p-7 are FORBIDDENBYTE, as expected. The 8 pad bytes at tail=0x1a7f4a0 are not all FORBIDDENBYTE (0xfb): at tail+0: 0x78 *** OUCH at tail+1: 0xfb at tail+2: 0xfb at tail+3: 0xfb at tail+4: 0xfb at tail+5: 0xfb at tail+6: 0xfb at tail+7: 0xfb The block was made by call #35014 to debug malloc/realloc. Data at p: cb cb cb cb cb cb cb cb cb cb cb cb cb cb cb cb Fatal Python error: bad trailing pad byte Current thread 0x00007fca30572700 (most recent call first): File "", line 1 in Abandon (core dumped) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 9 06:50:47 2016 From: report at bugs.python.org (STINNER Victor) Date: Wed, 09 Mar 2016 11:50:47 +0000 Subject: [issue26516] Add PYTHONMALLOC env var and add support for malloc debug hooks in release mode In-Reply-To: <1457522115.12.0.78692190259.issue26516@psf.upfronthosting.co.za> Message-ID: <1457524247.21.0.660791172709.issue26516@psf.upfronthosting.co.za> STINNER Victor added the comment: The motivation to support PYTHONMALLOC=malloc (always use malloc) and not just PYTHONMALLOC=debug (enable debug hooks) is to allow to use external memory debugger like Valgrind. Valgrind doesn't like pymalloc (pymalloc raises false alarms), we had to a configuration option for it: ./configure --with-valgrind. Using PYTHONMALLOC=malloc allows to use Valgrind on the system Python, it's easier to use. No need to recompile Python. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 9 06:59:44 2016 From: report at bugs.python.org (Peter Pan) Date: Wed, 09 Mar 2016 11:59:44 +0000 Subject: [issue25458] ftplib: command response shift - mismatch In-Reply-To: <1445510152.74.0.829316001802.issue25458@psf.upfronthosting.co.za> Message-ID: <1457524784.53.0.452072318103.issue25458@psf.upfronthosting.co.za> Peter Pan added the comment: I've updated "ftplib.py" from the 3.5.1 source code release. This should fix issues: http://bugs.python.org/issue25458 http://bugs.python.org/issue25491 ---------- Added file: http://bugs.python.org/file42099/ftplib.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 9 07:04:15 2016 From: report at bugs.python.org (Peter Pan) Date: Wed, 09 Mar 2016 12:04:15 +0000 Subject: [issue25458] ftplib: command response shift - mismatch In-Reply-To: <1445510152.74.0.829316001802.issue25458@psf.upfronthosting.co.za> Message-ID: <1457525055.89.0.923514962592.issue25458@psf.upfronthosting.co.za> Peter Pan added the comment: Here is a small test for the new version. (To see the original ftplib.py version failing copy+paste the code from my initial post into a python file and run) ---------- Added file: http://bugs.python.org/file42100/test_ftp.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 9 07:23:47 2016 From: report at bugs.python.org (Roger Mosher) Date: Wed, 09 Mar 2016 12:23:47 +0000 Subject: [issue26504] tclErr: invalid command name "PyAggImagePhoto" In-Reply-To: <1457358385.73.0.791027295001.issue26504@psf.upfronthosting.co.za> Message-ID: <1457526227.53.0.965395945135.issue26504@psf.upfronthosting.co.za> Roger Mosher added the comment: It appears to be a problem with the Anaconda 3 distribution. See: https://groups.google.com/a/continuum.io/forum/#!topic/anaconda/xssOnleIPFw for a discussion. ---------- status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 9 07:29:14 2016 From: report at bugs.python.org (Filipp Andjelo) Date: Wed, 09 Mar 2016 12:29:14 +0000 Subject: [issue26494] Double deallocation on iterator exhausting In-Reply-To: <1457288764.94.0.168287313304.issue26494@psf.upfronthosting.co.za> Message-ID: <1457526554.16.0.0978430691836.issue26494@psf.upfronthosting.co.za> Filipp Andjelo added the comment: Hi Serhiy, I tried the short example you gave, but it doesn't crash. I'm getting: Exception ignored in: Traceback (most recent call last): File "./test.py", line 5, in __del__ next(it) StopIteration Exception ignored in: Traceback (most recent call last): File "./test.py", line 5, in __del__ next(it) StopIteration Traceback (most recent call last): File "./test.py", line 8, in next(it) StopIteration Am I missing something? ---------- nosy: +scorp _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 9 08:09:45 2016 From: report at bugs.python.org (Jools) Date: Wed, 09 Mar 2016 13:09:45 +0000 Subject: [issue26517] Crash in installer Message-ID: <1457528985.92.0.506941181927.issue26517@psf.upfronthosting.co.za> New submission from Jools: Crash when installing python 2.7.11 x64 edition out of the box. x86 version works. I chose to install for all users, and the system has write permissions to the folder (C:\bin\python27). ---------- components: Windows messages: 261421 nosy: jools, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: Crash in installer type: crash versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 9 08:15:03 2016 From: report at bugs.python.org (Jools) Date: Wed, 09 Mar 2016 13:15:03 +0000 Subject: [issue26518] AttributeError: 'module' object has no attribute '_handlerList' Message-ID: <1457529303.49.0.107361475013.issue26518@psf.upfronthosting.co.za> New submission from Jools: AttributeError: 'module' object has no attribute '_handlerList' when trying to install any packages with pip. This one is with trying to install the logging package: http://pastebin.com/TCUpUMYn ---------- components: Library (Lib) messages: 261422 nosy: jools priority: normal severity: normal status: open title: AttributeError: 'module' object has no attribute '_handlerList' versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 9 08:26:53 2016 From: report at bugs.python.org (Berker Peksag) Date: Wed, 09 Mar 2016 13:26:53 +0000 Subject: [issue26518] AttributeError: 'module' object has no attribute '_handlerList' In-Reply-To: <1457529303.49.0.107361475013.issue26518@psf.upfronthosting.co.za> Message-ID: <1457530013.57.0.0632106639018.issue26518@psf.upfronthosting.co.za> Berker Peksag added the comment: This doesn't look like an issue with the Python standard library. I think you should report this to pip. Also, why are you installing logging module on Python 2.7? The PyPI version of logging module is very old (last updated 2005). ---------- nosy: +berker.peksag resolution: -> third party stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 9 08:48:37 2016 From: report at bugs.python.org (Steve Dower) Date: Wed, 09 Mar 2016 13:48:37 +0000 Subject: [issue26517] Crash in installer In-Reply-To: <1457528985.92.0.506941181927.issue26517@psf.upfronthosting.co.za> Message-ID: <1457531317.04.0.366099109155.issue26517@psf.upfronthosting.co.za> Steve Dower added the comment: Do you have any more details about this? A log file perhaps? With the current information there's nothing we can do to help you. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 9 09:02:42 2016 From: report at bugs.python.org (Roundup Robot) Date: Wed, 09 Mar 2016 14:02:42 +0000 Subject: [issue26516] Add PYTHONMALLOC env var and add support for malloc debug hooks in release mode In-Reply-To: <1457522115.12.0.78692190259.issue26516@psf.upfronthosting.co.za> Message-ID: <20160309140236.29617.35314@psf.io> Roundup Robot added the comment: New changeset af2fc10f703b by Victor Stinner in branch '3.5': Issue #26516: Enhance Python mem allocators doc https://hg.python.org/cpython/rev/af2fc10f703b ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 9 09:06:55 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 09 Mar 2016 14:06:55 +0000 Subject: [issue26494] Double deallocation on iterator exhausting In-Reply-To: <1457288764.94.0.168287313304.issue26494@psf.upfronthosting.co.za> Message-ID: <1457532415.1.0.630891113845.issue26494@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: It crashes in debug build. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 9 09:07:03 2016 From: report at bugs.python.org (A. Skrobov) Date: Wed, 09 Mar 2016 14:07:03 +0000 Subject: [issue26415] Fragmentation of the heap memory in the Python parser In-Reply-To: <1456182380.09.0.81920177296.issue26415@psf.upfronthosting.co.za> Message-ID: <1457532423.49.0.805984681934.issue26415@psf.upfronthosting.co.za> A. Skrobov added the comment: The attached patch for the parser reduces "Maximum resident set size (kbytes)" threefold, for the degenerate example of 'import ast; ast.parse("0,"*1000000, mode="eval")', by eliminating many CST nodes that have a single child. According to the comment in node.c -- "89% of PyObject_REALLOC calls in PyNode_AddChild passed 1 for the size" -- the memory saving should be generally applicable, and not limited just to this degenerate case. Modules/parsermodule.c is not yet updated to match. Please tell if you want me to do that, in case that my proposed change to the parser is acceptable. ---------- Added file: http://bugs.python.org/file42101/patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 9 09:08:27 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 09 Mar 2016 14:08:27 +0000 Subject: [issue26415] Fragmentation of the heap memory in the Python parser In-Reply-To: <1456182380.09.0.81920177296.issue26415@psf.upfronthosting.co.za> Message-ID: <1457532507.05.0.899392139519.issue26415@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 9 09:10:50 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 09 Mar 2016 14:10:50 +0000 Subject: [issue26516] Add PYTHONMALLOC env var and add support for malloc debug hooks in release mode In-Reply-To: <1457522115.12.0.78692190259.issue26516@psf.upfronthosting.co.za> Message-ID: <1457532650.62.0.833125935006.issue26516@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 9 09:15:00 2016 From: report at bugs.python.org (STINNER Victor) Date: Wed, 09 Mar 2016 14:15:00 +0000 Subject: [issue26516] Add PYTHONMALLOC env var and add support for malloc debug hooks in release mode In-Reply-To: <1457522115.12.0.78692190259.issue26516@psf.upfronthosting.co.za> Message-ID: <1457532900.66.0.923880873958.issue26516@psf.upfronthosting.co.za> STINNER Victor added the comment: More complete patch (version 2): * Document PYTHONMALLOC environment variable * Add PYTHONMALLOC=debug to install debug hooks without forcing a specific memory allocator (keep the default memory allocator) * Fix sys._debugmallocstats() for PYTHONMALLOC=malloc: don't display pymalloc stats * _testcapi.pymem_api_misuse(): more realistic code, use PyMem_Mallloc() + PyMem_RawFree(). This code works in release mode (since PyMem and PyMem_Raw use the same allocator: malloc/free), but fail with a fatal error with debug hooks (API misused). ---------- Added file: http://bugs.python.org/file42102/pymem-2.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 9 09:24:45 2016 From: report at bugs.python.org (STINNER Victor) Date: Wed, 09 Mar 2016 14:24:45 +0000 Subject: [issue26249] Change PyMem_Malloc to use pymalloc allocator In-Reply-To: <1454262504.41.0.628053130208.issue26249@psf.upfronthosting.co.za> Message-ID: <1457533485.23.0.136120702134.issue26249@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- title: Change PyMem_Malloc to use PyObject_Malloc allocator? -> Change PyMem_Malloc to use pymalloc allocator _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 9 09:25:58 2016 From: report at bugs.python.org (STINNER Victor) Date: Wed, 09 Mar 2016 14:25:58 +0000 Subject: [issue26516] Add PYTHONMALLOC env var and add support for malloc debug hooks in release mode In-Reply-To: <1457522115.12.0.78692190259.issue26516@psf.upfronthosting.co.za> Message-ID: <1457533558.77.0.479739686796.issue26516@psf.upfronthosting.co.za> STINNER Victor added the comment: When I wrote the PEP 445, I already proposed to add a new environment variable to install debug hooks on a Python compiled in release mode: https://www.python.org/dev/peps/pep-0445/#add-a-new-pydebugmalloc-environment-variable But the proposition was rejected because of the PEP 432, but 3 years later, this PEP is still stuck at the draft state. So I propose to move on. Anyway, PYTHONMALLOC is really a corner case since it must be read *very early* (first instruction of main()). Oh by the way, I forgot to explain the initial motivation for this change! It's the issue #26249: "Change PyMem_Malloc to use pymalloc allocator". With this change, applications misuing PyMem_Malloc API (ex: alloc memory with PyMem_Malloc(), free memory with free()) will start to crash. PYTHONMALLOC=debug should help these applications to detect bugs easier and get an obvious error message. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 9 09:26:35 2016 From: report at bugs.python.org (STINNER Victor) Date: Wed, 09 Mar 2016 14:26:35 +0000 Subject: [issue26249] Change PyMem_Malloc to use pymalloc allocator In-Reply-To: <1454262504.41.0.628053130208.issue26249@psf.upfronthosting.co.za> Message-ID: <1457533595.45.0.911909597577.issue26249@psf.upfronthosting.co.za> STINNER Victor added the comment: I created the issue #26516 "Add PYTHONMALLOC env var and add support for malloc debug hooks in release mode" to help developers to detect bugs in their code, especially misuse of the PyMem_Malloc() API. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 9 09:36:09 2016 From: report at bugs.python.org (STINNER Victor) Date: Wed, 09 Mar 2016 14:36:09 +0000 Subject: [issue26249] Change PyMem_Malloc to use pymalloc allocator In-Reply-To: <1454262504.41.0.628053130208.issue26249@psf.upfronthosting.co.za> Message-ID: <1457534169.71.0.0261901698678.issue26249@psf.upfronthosting.co.za> STINNER Victor added the comment: Patch 3: - Ooops, I updated pymem_api_misuse(), but I forgot to update the related unit test. It's now fixed. ---------- Added file: http://bugs.python.org/file42103/pymem-3.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 9 09:36:36 2016 From: report at bugs.python.org (STINNER Victor) Date: Wed, 09 Mar 2016 14:36:36 +0000 Subject: [issue26516] Add PYTHONMALLOC env var and add support for malloc debug hooks in release mode In-Reply-To: <1457522115.12.0.78692190259.issue26516@psf.upfronthosting.co.za> Message-ID: <1457534196.61.0.247324810896.issue26516@psf.upfronthosting.co.za> STINNER Victor added the comment: Patch 3: - Ooops, I updated pymem_api_misuse(), but I forgot to update the related unit test. It's now fixed. ---------- Added file: http://bugs.python.org/file42104/pymem-3.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 9 09:36:58 2016 From: report at bugs.python.org (STINNER Victor) Date: Wed, 09 Mar 2016 14:36:58 +0000 Subject: [issue26249] Change PyMem_Malloc to use pymalloc allocator In-Reply-To: <1454262504.41.0.628053130208.issue26249@psf.upfronthosting.co.za> Message-ID: <1457534218.62.0.731656564014.issue26249@psf.upfronthosting.co.za> Changes by STINNER Victor : Removed file: http://bugs.python.org/file42103/pymem-3.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 9 09:44:11 2016 From: report at bugs.python.org (STINNER Victor) Date: Wed, 09 Mar 2016 14:44:11 +0000 Subject: [issue26249] Change PyMem_Malloc to use pymalloc allocator In-Reply-To: <1454262504.41.0.628053130208.issue26249@psf.upfronthosting.co.za> Message-ID: <1457534651.06.0.772358396165.issue26249@psf.upfronthosting.co.za> STINNER Victor added the comment: In february 2016, I started a thread on the python-dev mailing list: [Python-Dev] Modify PyMem_Malloc to use pymalloc for performance https://mail.python.org/pipermail/python-dev/2016-February/143084.html M.-A. Lemburg wrote: """ > Do you see any drawback of using pymalloc for PyMem_Malloc()? Yes: You cannot free memory allocated using pymalloc with the standard C lib free(). It would be better to go through the list of PyMem_*() calls in Python and replace them with PyObject_*() calls, where possible. > Does anyone recall the rationale to have two families to memory allocators? The PyMem_*() APIs were needed to have a cross-platform malloc() implementation which returns standard C lib free()able memory, but also behaves well when passing 0 as size. """ M.-A. Lemburg fears that the PyMem_Malloc() API is misused: """ Sometimes, yes, but we also do allocations for e.g. parsing values in Python argument tuples (e.g. using "es" or "et"): https://docs.python.org/3.6/c-api/arg.html We do document to use PyMem_Free() on those; not sure whether everyone does this though. """ M.-A. Lemburg suggested to the patch of this issue on: """ Yes, but those are part of the stdlib. You'd need to check a few C extensions which are not tested as part of the stdlib, e.g. numpy, scipy, lxml, pillow, etc. (esp. ones which implement custom types in C since these will often need the memory management APIs). It may also be a good idea to check wrapper generators such as cython, swig, cffi, etc. """ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 9 10:11:29 2016 From: report at bugs.python.org (=?utf-8?q?Martin_Hundeb=C3=B8ll?=) Date: Wed, 09 Mar 2016 15:11:29 +0000 Subject: [issue26443] cross building extensions picks up host headers In-Reply-To: <1456499973.95.0.823052816124.issue26443@psf.upfronthosting.co.za> Message-ID: <1457536289.7.0.907458228514.issue26443@psf.upfronthosting.co.za> Martin Hundeb?ll added the comment: Yes, it is a duplicate of #20211, and I agree with the fix proposed in there. Thanks for pointing it out. ---------- resolution: -> duplicate status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 9 10:22:33 2016 From: report at bugs.python.org (Berker Peksag) Date: Wed, 09 Mar 2016 15:22:33 +0000 Subject: [issue26443] cross building extensions picks up host headers In-Reply-To: <1456499973.95.0.823052816124.issue26443@psf.upfronthosting.co.za> Message-ID: <1457536953.06.0.144389661145.issue26443@psf.upfronthosting.co.za> Changes by Berker Peksag : ---------- stage: -> resolved superseder: -> setup.py: do not add invalid header locations _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 9 10:24:27 2016 From: report at bugs.python.org (=?utf-8?q?Martin_Hundeb=C3=B8ll?=) Date: Wed, 09 Mar 2016 15:24:27 +0000 Subject: [issue20211] setup.py: do not add invalid header locations In-Reply-To: <1389308528.92.0.403642458985.issue20211@psf.upfronthosting.co.za> Message-ID: <1457537067.55.0.167894757375.issue20211@psf.upfronthosting.co.za> Martin Hundeb?ll added the comment: The patch looks good to me, and works in my setup. ---------- nosy: +hundeboll _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 9 10:29:16 2016 From: report at bugs.python.org (Georg Brandl) Date: Wed, 09 Mar 2016 15:29:16 +0000 Subject: [issue26512] Vocabulary: Using "integral" in library/stdtypes.html In-Reply-To: <1457472244.72.0.113699245831.issue26512@psf.upfronthosting.co.za> Message-ID: <1457537356.94.0.0938663191408.issue26512@psf.upfronthosting.co.za> Georg Brandl added the comment: There's two different uses here: The one use in "truncated to Integral" means that you get an integer type out. It is not specified to be `int` because `__trunc__` may return other types. It could be made into a link like the other use of Integral. The other uses are "integral float", which is *not* the same as an integer. It is a float whose value is a whole number, and AFAIK "integral" is the correct adjective for that. ---------- nosy: +georg.brandl _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 9 11:01:57 2016 From: report at bugs.python.org (STINNER Victor) Date: Wed, 09 Mar 2016 16:01:57 +0000 Subject: [issue26519] Cython doesn't work anymore on Python 3.6 Message-ID: <1457539317.39.0.81348046338.issue26519@psf.upfronthosting.co.za> New submission from STINNER Victor: I tried to run numpy test suite on Python 3.6 compiled in debug mode. I got an assertion error. Then I wanted to try the Git version of numpy, but the "Cythonizing sources" step of the numpy installer fails with: --- Traceback (most recent call last): File "bin/cython", line 9, in load_entry_point('Cython==0.23.4', 'console_scripts', 'cython')() (...) File "lib/python3.6/site-packages/Cython/Compiler/Nodes.py", line 6585, in generate_execution_code self.body.generate_execution_code(code) File "lib/python3.6/site-packages/Cython/Compiler/Nodes.py", line 7026, in generate_execution_code fresh_finally_clause().generate_execution_code(code) File "lib/python3.6/site-packages/Cython/Compiler/Nodes.py", line 7013, in fresh_finally_clause node_copy = copy.deepcopy(node) File "/home/haypo/prog/python/default/Lib/copy.py", line 182, in deepcopy y = _reconstruct(x, rv, 1, memo) (...) File "/home/haypo/prog/python/default/Lib/copy.py", line 314, in _reconstruct item = deepcopy(item, memo) File "/home/haypo/prog/python/default/Lib/copy.py", line 174, in deepcopy rv = reductor(4) TypeError: can't pickle Argument objects --- Argument class indirectly comes from Cython.Compiler.Nodes.ExprStatNode. Command to reproduce the bug: --- tar -xf mtrand.tar.gz # download mtrand.tar.gz attached to this issue python -m venv ENV ENV/bin/python -m pip install cython ENV/bin/python ENV/bin/cython --fast-fail -o mtrand.c mtrand.pyx --- It looks like cython behaviour failed after this change: --- changeset: 99677:b8d108a2a38e parent: 99675:80d1faa9735d parent: 99676:0cd2de69fb66 user: Serhiy Storchaka date: Fri Dec 25 21:05:35 2015 +0200 files: Lib/test/test_csv.py Misc/NEWS Objects/typeobject.c description: Issue #22995: Instances of extension types with a state that aren't subclasses of list or dict and haven't implemented any pickle-related methods (__reduce__, __reduce_ex__, __getnewargs__, __getnewargs_ex__, or __getstate__), can no longer be pickled. Including memoryview. --- Sorry, I don't understand yet if it's a regression in Python 3.6 or a real bug in Cython. ---------- files: mtrand.tar.gz messages: 261437 nosy: haypo, serhiy.storchaka priority: normal severity: normal status: open title: Cython doesn't work anymore on Python 3.6 versions: Python 3.6 Added file: http://bugs.python.org/file42105/mtrand.tar.gz _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 9 11:06:57 2016 From: report at bugs.python.org (STINNER Victor) Date: Wed, 09 Mar 2016 16:06:57 +0000 Subject: [issue26519] Cython doesn't work anymore on Python 3.6 In-Reply-To: <1457539317.39.0.81348046338.issue26519@psf.upfronthosting.co.za> Message-ID: <1457539617.0.0.32607355933.issue26519@psf.upfronthosting.co.za> STINNER Victor added the comment: Oops, my commands to reproduce the bug were wrong. Commands to reproduce the bug: --- tar -xf mtrand.tar.gz # download mtrand.tar.gz attached to this issue ./python -m venv ENV ENV/bin/python -m pip install cython ENV/bin/python ENV/bin/cython --fast-fail -o mtrand/mtrand.c mtrand/mtrand.pyx --- ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 9 11:20:11 2016 From: report at bugs.python.org (Julien) Date: Wed, 09 Mar 2016 16:20:11 +0000 Subject: [issue26512] Vocabulary: Using "integral" in library/stdtypes.html In-Reply-To: <1457472244.72.0.113699245831.issue26512@psf.upfronthosting.co.za> Message-ID: <1457540411.75.0.133304186603.issue26512@psf.upfronthosting.co.za> Julien added the comment: > It could be made into a link like the other use of Integral. I'll propose a patch. > The other uses are "integral float", which is *not* the same as an integer. It is a float whose value is a whole number, and AFAIK "integral" is the correct adjective for that. Can you please give me some links to definitions / usages of the "integral" adjective ? As "integral float" is not verbose on google SERPs, so I can document myself on it and eventually translate it correctly in french ? I'm still thinking that those sentences are way too hard to understand for a youg user (Think of all the childs learning Python ^^), and they're contrasting a lot with the other parts of the documentations which are far more readable. (Also remember that I'm not native english, maybe "integral" is a wisely used word for this context and I completly missed it). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 9 11:22:10 2016 From: report at bugs.python.org (Erwin Mayer) Date: Wed, 09 Mar 2016 16:22:10 +0000 Subject: [issue26520] asyncio.new_event_loop() hangs Message-ID: <1457540530.17.0.125897820678.issue26520@psf.upfronthosting.co.za> New submission from Erwin Mayer: I am using the following function to force a coroutine to run synchronously: def await_sync(coro: types.CoroutineType, timeout_s: int=None): """ :param coro: a coroutine or lambda loop: coroutine(loop) :param timeout_s: :return: """ loop = asyncio.new_event_loop() # type: BaseEventLoop if not is_awaitable(coro): coro = coro(loop) if timeout_s is None: fut = asyncio.ensure_future(coro, loop=loop) else: fut = asyncio.ensure_future(asyncio.wait_for(coro, timeout=timeout_s, loop=loop), loop=loop) loop.run_until_complete(fut) return fut.result() def is_awaitable(coro_or_future): if isinstance(coro_or_future, futures.Future): return coro_or_future elif asyncio.coroutines.iscoroutine(coro_or_future): return True elif asyncio.compat.PY35 and inspect.isawaitable(coro_or_future): return True else: return False However, intermittently, it will freeze upon simply trying to create a new loop: loop = asyncio.new_event_loop(). Inspecting the stack traces shows me the exact location where it hangs: File: "/src\system\utils.py", line 34, in await_sync loop = asyncio.new_event_loop() # type: BaseEventLoop File: "\lib\asyncio\events.py", line 636, in new_event_loop return get_event_loop_policy().new_event_loop() File: "\lib\asyncio\events.py", line 587, in new_event_loop return self._loop_factory() File: "\lib\asyncio\selector_events.py", line 55, in __init__ self._make_self_pipe() File: "\lib\asyncio\selector_events.py", line 116, in _make_self_pipe self._ssock, self._csock = self._socketpair() File: "\lib\asyncio\windows_events.py", line 295, in _socketpair return windows_utils.socketpair() File: "\lib\socket.py", line 515, in socketpair ssock, _ = lsock.accept() File: "\lib\socket.py", line 195, in accept fd, addr = self._accept() I am using Python 3.5.1. StackOverflow question: http://stackoverflow.com/questions/35861175/what-can-cause-asyncio-to-hang-upon-simply-creating-a-new-loop ---------- components: asyncio messages: 261440 nosy: Erwin Mayer, gvanrossum, haypo, yselivanov priority: normal severity: normal status: open title: asyncio.new_event_loop() hangs type: crash versions: Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 9 11:31:50 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 09 Mar 2016 16:31:50 +0000 Subject: [issue26519] Cython doesn't work anymore on Python 3.6 In-Reply-To: <1457539317.39.0.81348046338.issue26519@psf.upfronthosting.co.za> Message-ID: <1457541110.57.0.518977167192.issue26519@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: May be this is the same issue as reported in msg257646. This was a bug in Cython and it is fixed now. ---------- nosy: +scoder _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 9 11:39:59 2016 From: report at bugs.python.org (STINNER Victor) Date: Wed, 09 Mar 2016 16:39:59 +0000 Subject: [issue26519] Cython doesn't work anymore on Python 3.6 In-Reply-To: <1457539317.39.0.81348046338.issue26519@psf.upfronthosting.co.za> Message-ID: <1457541599.9.0.687007742476.issue26519@psf.upfronthosting.co.za> STINNER Victor added the comment: "May be this is the same issue as reported in msg257646. This was a bug in Cython and it is fixed now." Oh, I wasn't aware of the issue #22995. I will read it. The bug isn't fixed yet in the latest release of Cython (0.23.4, released at 2015-10-10). I guess that it's fixed in the development version. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 9 11:48:17 2016 From: report at bugs.python.org (STINNER Victor) Date: Wed, 09 Mar 2016 16:48:17 +0000 Subject: [issue26520] asyncio.new_event_loop() hangs In-Reply-To: <1457540530.17.0.125897820678.issue26520@psf.upfronthosting.co.za> Message-ID: <1457542096.97.0.729764342963.issue26520@psf.upfronthosting.co.za> STINNER Victor added the comment: Do you have a firewall? Maybe the firewall blocks programs listening on sockets? It would be silly, the socket is only listening on 127.0.0.1 (local link) (or ::1 in IPv6, also local link). Extract of the socketpair() function: try: csock.connect((addr, port)) except (BlockingIOError, InterruptedError): pass Can you please try to replace this code with: try: csock.connect((addr, port)) except (BlockingIOError, InterruptedError) as exc: print("CONNECT ERROR! %r" % (exc,)) You can copy socket.py from the Python standard library to the current directory and modify the local copy. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 9 11:51:05 2016 From: report at bugs.python.org (STINNER Victor) Date: Wed, 09 Mar 2016 16:51:05 +0000 Subject: [issue26519] Cython doesn't work anymore on Python 3.6 In-Reply-To: <1457539317.39.0.81348046338.issue26519@psf.upfronthosting.co.za> Message-ID: <1457542265.11.0.526625828967.issue26519@psf.upfronthosting.co.za> STINNER Victor added the comment: > This was a bug in Cython and it is fixed now. If the change is deliberate, can you please mention it in "What's New in Python 3.6" doc? Especially in the "Porting to Python 3.6" section: https://docs.python.org/dev/whatsnew/3.6.html#porting-to-python-3-6 Can you suggest a fix in the doc? I guess that a method should be added: __reduce__(), __reduce_ex__() or __getstate__()? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 9 11:55:45 2016 From: report at bugs.python.org (STINNER Victor) Date: Wed, 09 Mar 2016 16:55:45 +0000 Subject: [issue26249] Change PyMem_Malloc to use pymalloc allocator In-Reply-To: <1454262504.41.0.628053130208.issue26249@psf.upfronthosting.co.za> Message-ID: <1457542545.97.0.492527962039.issue26249@psf.upfronthosting.co.za> STINNER Victor added the comment: numpy: good! * I patched Pyhon 3.6 with pymem.patch of this issue + pymem-3.patch of issue #26516 * I had issues to run tests with Python 3.6 compiled in debug mode: http://bugs.python.org/issue26519 & https://github.com/numpy/numpy/issues/7399 * I ran the test suite: all tests pass, no bug related to memory allocators * Tested numpy version: commit b92cc76afad2e74cbbf6f5b9f5b68050f7c8642a (Mar 7 2016) Commands ran in numpy tests in a virtual environment: numpy$ python setup.py install numpy$ cd.. $ python -c 'import numpy; numpy.test()' (...) Ran 6206 tests in 280.986s OK (KNOWNFAIL=7, SKIP=6) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 9 11:57:24 2016 From: report at bugs.python.org (Antoine Pitrou) Date: Wed, 09 Mar 2016 16:57:24 +0000 Subject: [issue26249] Change PyMem_Malloc to use pymalloc allocator In-Reply-To: <1454262504.41.0.628053130208.issue26249@psf.upfronthosting.co.za> Message-ID: <1457542644.75.0.808426604001.issue26249@psf.upfronthosting.co.za> Antoine Pitrou added the comment: Victor, why do you insist on this instead of changing internal API calls in CPython? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 9 11:58:43 2016 From: report at bugs.python.org (STINNER Victor) Date: Wed, 09 Mar 2016 16:58:43 +0000 Subject: [issue26249] Change PyMem_Malloc to use pymalloc allocator In-Reply-To: <1457542644.75.0.808426604001.issue26249@psf.upfronthosting.co.za> Message-ID: STINNER Victor added the comment: Antoine Pitrou added the comment: > Victor, why do you insist on this instead of changing internal API calls in CPython? https://mail.python.org/pipermail/python-dev/2016-February/143097.html "There are 536 calls to the functions PyMem_Malloc(), PyMem_Realloc() and PyMem_Free()." ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 9 12:00:03 2016 From: report at bugs.python.org (Antoine Pitrou) Date: Wed, 09 Mar 2016 17:00:03 +0000 Subject: [issue26249] Change PyMem_Malloc to use pymalloc allocator In-Reply-To: <1454262504.41.0.628053130208.issue26249@psf.upfronthosting.co.za> Message-ID: <1457542803.02.0.0294789139999.issue26249@psf.upfronthosting.co.za> Antoine Pitrou added the comment: > "There are 536 calls to the functions PyMem_Malloc(), PyMem_Realloc() and PyMem_Free()." I'm sure you can use powerful tools such as "sed" ;-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 9 12:01:25 2016 From: report at bugs.python.org (STINNER Victor) Date: Wed, 09 Mar 2016 17:01:25 +0000 Subject: [issue26249] Change PyMem_Malloc to use pymalloc allocator In-Reply-To: <1454262504.41.0.628053130208.issue26249@psf.upfronthosting.co.za> Message-ID: <1457542885.21.0.48616790922.issue26249@psf.upfronthosting.co.za> STINNER Victor added the comment: > I'm sure you can use powerful tools such as "sed" ;-) I guess that PyMem functions are used in third party C extensions modules. I expect (minor) speedup in these modules too. I don't understand why we should keep a slow allocator if Python has a faster allocator? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 9 12:05:30 2016 From: report at bugs.python.org (STINNER Victor) Date: Wed, 09 Mar 2016 17:05:30 +0000 Subject: [issue26249] Change PyMem_Malloc to use pymalloc allocator In-Reply-To: <1454262504.41.0.628053130208.issue26249@psf.upfronthosting.co.za> Message-ID: <1457543130.75.0.737938886439.issue26249@psf.upfronthosting.co.za> STINNER Victor added the comment: lxml: good! * I patched Python 3.6 with pymem.patch of this issue + pymem-3.patch of issue #26516 * Tested lxml version: git commit 93ec66f6533995a7742278f9ba14b925149ac140 (Mar 8 2016) lxml$ make test (...) Ran 1735 tests in 27.663s OK ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 9 12:08:13 2016 From: report at bugs.python.org (Steve Dower) Date: Wed, 09 Mar 2016 17:08:13 +0000 Subject: [issue26513] platform.win32_ver() broken in 2.7.11 In-Reply-To: <1457473293.66.0.928061603359.issue26513@psf.upfronthosting.co.za> Message-ID: <1457543293.37.0.423434061407.issue26513@psf.upfronthosting.co.za> Steve Dower added the comment: That's what I initially assumed, but when I looked in my 2.7 repo those changes weren't there. But according to the bug I checked them in, so I guess it is my fault. Looking at the diff (e.g. 2f57270374f7), it seems I got sucked in by following the old code that tried to get `sys.getwindowsversion().platform_type`, when it should have been `platform`. (Possibly this was changed late during review, as I definitely tested on at least one server platform to verify... maybe it worked with the old fallback code and then once I made sure that we always set `platform` I removed the fallback without fixing the attribute.) The patch is simple enough - committing and merging branches is the hard part. When I get a few free minutes I'll fix the attribute. ---------- assignee: -> steve.dower type: -> behavior versions: +Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 9 12:13:07 2016 From: report at bugs.python.org (STINNER Victor) Date: Wed, 09 Mar 2016 17:13:07 +0000 Subject: [issue26249] Change PyMem_Malloc to use pymalloc allocator In-Reply-To: <1454262504.41.0.628053130208.issue26249@psf.upfronthosting.co.za> Message-ID: <1457543587.72.0.0443885980601.issue26249@psf.upfronthosting.co.za> STINNER Victor added the comment: Pillow: good Note: I had to install JPEG headers (sudo dnf install -y libjpeg-turbo-devel). Tested version: git commit 555544c5cfc3874deaac9cfa87780822ee714c0d (Mar 8 2016). --- Pillow$ python setup.py install Pillow$ python selftest.py Pillow$ python test-installed.py (...) Ran 671 tests in 8.458s FAILED (SKIP=124, errors=2) --- The two errors are "OSError: decoder libtiff not available". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 9 12:13:22 2016 From: report at bugs.python.org (Antoine Pitrou) Date: Wed, 09 Mar 2016 17:13:22 +0000 Subject: [issue26249] Change PyMem_Malloc to use pymalloc allocator In-Reply-To: <1457542885.21.0.48616790922.issue26249@psf.upfronthosting.co.za> Message-ID: <56E059B0.3000809@free.fr> Antoine Pitrou added the comment: Le 09/03/2016 18:01, STINNER Victor a ?crit : > I don't understand why we should keep a slow allocator if Python has a faster allocator? Define "slow". malloc() on Linux should be reasonably fast. Do you think it's reasonable to risk breaking external libraries just for a hypothetic "performance improvement"? Again, why don't you try simply changing internal calls? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 9 12:15:44 2016 From: report at bugs.python.org (STINNER Victor) Date: Wed, 09 Mar 2016 17:15:44 +0000 Subject: [issue26249] Change PyMem_Malloc to use pymalloc allocator In-Reply-To: <1454262504.41.0.628053130208.issue26249@psf.upfronthosting.co.za> Message-ID: <1457543744.39.0.562163603752.issue26249@psf.upfronthosting.co.za> STINNER Victor added the comment: > Define "slow". malloc() on Linux should be reasonably fast. See first messages of this issue for benchmark results. Some specific benchmarks are faster, none is slower. > Do you think it's reasonable to risk breaking external libraries just for a hypothetic "performance improvement"? Yes. It was discussed in the python-dev thread. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 9 12:20:37 2016 From: report at bugs.python.org (Antoine Pitrou) Date: Wed, 09 Mar 2016 17:20:37 +0000 Subject: [issue26249] Change PyMem_Malloc to use pymalloc allocator In-Reply-To: <1454262504.41.0.628053130208.issue26249@psf.upfronthosting.co.za> Message-ID: <1457544037.84.0.152216732491.issue26249@psf.upfronthosting.co.za> Antoine Pitrou added the comment: > Yes. It was discussed in the python-dev thread. I'm talking about the performance improvement in third-party libraries, not the performance improvement in CPython itself which can be addressed by replacing the internal API calls. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 9 12:27:09 2016 From: report at bugs.python.org (STINNER Victor) Date: Wed, 09 Mar 2016 17:27:09 +0000 Subject: [issue26249] Change PyMem_Malloc to use pymalloc allocator In-Reply-To: <1454262504.41.0.628053130208.issue26249@psf.upfronthosting.co.za> Message-ID: <1457544429.76.0.750981770881.issue26249@psf.upfronthosting.co.za> STINNER Victor added the comment: > I'm talking about the performance improvement in third-party libraries, not the performance improvement in CPython itself which can be addressed by replacing the internal API calls. Oh ok. I don't know how to measure the performance of third-party libraries. I expect no speedup or a little speedup, but no slow-down. > Do you think it's reasonable to risk breaking external libraries just for a hypothetic "performance improvement"? The question is if my change really breaks anything in practice. I'm testing some popular C extensions to prepare an answer. Early results is that developer use correctly the Python allocator API :-) I disagree on the fact that my change breaks any API. The API doc is clear. For example, you must use PyMem_Free() on memory allocated by PyMem_Malloc(). If you use free(), it fails badly with Python compiled in debug mode. My issue #26516 "Add PYTHONMALLOC env var and add support for malloc debug hooks in release mode" may help developers to validate their own application. I suggest you to continue the discussion on python-dev for a wider audience. I will test a few more projects before replying on the python-dev thread. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 9 12:28:59 2016 From: report at bugs.python.org (Antoine Pitrou) Date: Wed, 09 Mar 2016 17:28:59 +0000 Subject: [issue26249] Change PyMem_Malloc to use pymalloc allocator In-Reply-To: <1457544429.76.0.750981770881.issue26249@psf.upfronthosting.co.za> Message-ID: <56E05D5A.3060404@free.fr> Antoine Pitrou added the comment: Le 09/03/2016 18:27, STINNER Victor a ?crit : > > I disagree on the fact that my change breaks any API. The API doc is clear. Does the API doc say anything about the GIL, for example? Or Valgrind? > I suggest you to continue the discussion on python-dev for a wider audience. I will test a few more projects before replying on the python-dev thread. I have no interest in going back and forth between the Python tracker and python-dev (especially since I hardly read python-dev these days). If you address my questions positively here I will be happy with the patch! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 9 12:30:17 2016 From: report at bugs.python.org (STINNER Victor) Date: Wed, 09 Mar 2016 17:30:17 +0000 Subject: [issue26249] Change PyMem_Malloc to use pymalloc allocator In-Reply-To: <1454262504.41.0.628053130208.issue26249@psf.upfronthosting.co.za> Message-ID: <1457544617.95.0.799348711632.issue26249@psf.upfronthosting.co.za> STINNER Victor added the comment: cryptography: good * Git commit 0681de7241dcbaec7b3dc85d3cf3944e4bec8309 (Mar 9 2016) "4 failed, 77064 passed, 3096 skipped in 405.09 seconds" 1 error is related to the version number (probably an issue on how I run the tests), 3 errors are FileNotFoundError related to cryptography_vectors. At least, there is no Python fatal error related to memory allocators ;-) -- Hum, just in case, I checked my venv: (ENV) haypo at smithers$ python -c 'import _testcapi; _testcapi.pymem_api_misuse()' ... Fatal Python error: bad ID: Allocated using API 'o', verified using API 'r' (ENV) haypo at smithers$ python -c 'import _testcapi; _testcapi.pymem_buffer_overflow()' ... Fatal Python error: bad trailing pad byte It works ;-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 9 12:36:03 2016 From: report at bugs.python.org (STINNER Victor) Date: Wed, 09 Mar 2016 17:36:03 +0000 Subject: [issue26249] Change PyMem_Malloc to use pymalloc allocator In-Reply-To: <56E05D5A.3060404@free.fr> Message-ID: STINNER Victor added the comment: 2016-03-09 18:28 GMT+01:00 Antoine Pitrou : > Does the API doc say anything about the GIL, for example? Or Valgrind? For the GIL, yes, Python 3 doc is explicit: https://docs.python.org/dev/c-api/memory.html#memory-interface Red and bold warning: "The GIL must be held when using these functions." Hum, sadly it looks like the warning miss in Python 2 doc. The GIL was the motivation to introduce the PyMem_RawMalloc() function in Python 3.4. For Valgrind: using the issue #26516, you will be able to use PYTHONMALLOC=malloc to use easily Valgrind even on a Python compiled in release mode (which is a new feature, before you had to manually recompile Python in debug mode with --with-valgrind)). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 9 12:49:00 2016 From: report at bugs.python.org (Yury Selivanov) Date: Wed, 09 Mar 2016 17:49:00 +0000 Subject: [issue26249] Change PyMem_Malloc to use pymalloc allocator In-Reply-To: <1454262504.41.0.628053130208.issue26249@psf.upfronthosting.co.za> Message-ID: <1457545740.08.0.380916429851.issue26249@psf.upfronthosting.co.za> Changes by Yury Selivanov : ---------- nosy: -Yury.Selivanov, yselivanov _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 9 12:54:51 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 09 Mar 2016 17:54:51 +0000 Subject: [issue26519] Cython doesn't work anymore on Python 3.6 In-Reply-To: <1457539317.39.0.81348046338.issue26519@psf.upfronthosting.co.za> Message-ID: <1457546091.31.0.14902545934.issue26519@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Cython 0.23.4 was released at 2015-10-10. The fix was applied 2016-01-16. Try to use Cython from trunk. May be this is not exactly the same bug and Cython needs other fix. The change is deliberate. It helps to find existing bugs. Except trivial case when your extension class has no any fields in additional to pickleable parent class, the class needs to provide some combinations of __getstate__, __setstate__, __getnewargs__/__getnewargs_ex__ and __reduce__/__reduce_ex__ to be pickleable. This was said in PEP 307. Previously you silently produced invalid pickle and got an exception or invalid object when unpickle it. Now you more likely get an exception at pickling time. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 9 13:10:24 2016 From: report at bugs.python.org (Erwin Mayer) Date: Wed, 09 Mar 2016 18:10:24 +0000 Subject: [issue26520] asyncio.new_event_loop() hangs In-Reply-To: <1457540530.17.0.125897820678.issue26520@psf.upfronthosting.co.za> Message-ID: <1457547024.07.0.784270174069.issue26520@psf.upfronthosting.co.za> Erwin Mayer added the comment: This cannot be a firewall issue as a loop can be successfully created thousands of time, for hours, before a creation attempt will hang (with no change from the firewall). The rest of the program (other threads) continues to run and there is memory issue. If I understand correctly, the sockets used by asyncio are internal only and would not be exposed to the world through any local port, so I don't see how a firewall could intercept them (that would be worrisome for all users of asyncio). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 9 13:44:28 2016 From: report at bugs.python.org (Guido van Rossum) Date: Wed, 09 Mar 2016 18:44:28 +0000 Subject: [issue26520] asyncio.new_event_loop() hangs In-Reply-To: <1457540530.17.0.125897820678.issue26520@psf.upfronthosting.co.za> Message-ID: <1457549068.08.0.043845873688.issue26520@psf.upfronthosting.co.za> Guido van Rossum added the comment: Why are you creating a new event loop for this purpose? There are all sorts of things that can go wrong with that. This is not appropriate for a bug report, you should continue to seek help on StackOverflow. ---------- resolution: -> rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 9 13:55:04 2016 From: report at bugs.python.org (Alexander Belopolsky) Date: Wed, 09 Mar 2016 18:55:04 +0000 Subject: [issue26512] Vocabulary: Using "integral" in library/stdtypes.html In-Reply-To: <1457472244.72.0.113699245831.issue26512@psf.upfronthosting.co.za> Message-ID: <1457549704.07.0.255040680833.issue26512@psf.upfronthosting.co.za> Alexander Belopolsky added the comment: > Can you provide a source ? How about a dictionary? For example, Oxford English Dictionary has """ integral, adj. and n. 4. Math. a. That is, or is denoted by, an integer, or involves only integers; consisting of a whole number or undivided quantity; not fractional, or not involving a fraction. """ http://www.oed.com/view/Entry/97344?redirectedFrom=integral#eid ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 9 13:57:36 2016 From: report at bugs.python.org (Ethan Furman) Date: Wed, 09 Mar 2016 18:57:36 +0000 Subject: [issue26521] add `extend_enum` to Enum Message-ID: <1457549856.93.0.164722622997.issue26521@psf.upfronthosting.co.za> New submission from Ethan Furman: In this SO question [1] the OP has a need to generate an Enum lazily. I created an `extend_enum` function to do so. By the time I was done I realized I would not want anyone to have to create that function by hand, nor keep it up to date (should we ever change the implementation details). Should we add this to the stdlib? Note that this does not change anything about subclassing Enum. [1] http://stackoverflow.com/q/28126314/208880 ---------- assignee: ethan.furman messages: 261464 nosy: barry, eli.bendersky, ethan.furman priority: low severity: normal status: open title: add `extend_enum` to Enum versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 9 14:06:44 2016 From: report at bugs.python.org (Richard Futrell) Date: Wed, 09 Mar 2016 19:06:44 +0000 Subject: [issue26522] pickle.whichmodule(object.__new__, None) = 'email.MIMEAudio' Message-ID: <1457550403.98.0.525527175536.issue26522@psf.upfronthosting.co.za> New submission from Richard Futrell: On Python 2.7.11, pickle.whichmodule(object.__new__, None) = 'email.MIMEAudio' This is unlikely to be the correct module. ---------- components: XML messages: 261465 nosy: canjobear priority: normal severity: normal status: open title: pickle.whichmodule(object.__new__, None) = 'email.MIMEAudio' versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 9 14:15:36 2016 From: report at bugs.python.org (Barry A. Warsaw) Date: Wed, 09 Mar 2016 19:15:36 +0000 Subject: [issue26521] add `extend_enum` to Enum In-Reply-To: <1457549856.93.0.164722622997.issue26521@psf.upfronthosting.co.za> Message-ID: <1457550936.16.0.878999209283.issue26521@psf.upfronthosting.co.za> Barry A. Warsaw added the comment: I was thrown off a bit by the description below. it's not that the OP wants to generate an Enum lazily (the functional API lets them do that), it's that the OP wants to *extend* an Enum lazily. Seems like a pretty obscure use case to me. I'd vote for letting it live in SO and not putting it in the stdlib. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 9 14:16:23 2016 From: report at bugs.python.org (Erwin Mayer) Date: Wed, 09 Mar 2016 19:16:23 +0000 Subject: [issue26520] asyncio.new_event_loop() hangs In-Reply-To: <1457540530.17.0.125897820678.issue26520@psf.upfronthosting.co.za> Message-ID: <1457550983.04.0.405041129862.issue26520@psf.upfronthosting.co.za> Erwin Mayer added the comment: I simply need to run a coroutine synchronously (which may or may not have a loop parameter), so I tried to do it by the book. With .NET it is easy to call .Wait() on a Task (but .NET by default uses a threadpool, not a single-threaded event loop). I am intrigued: how is it possible to achieve this at all without creating an event loop, and what kind of things are you referring to that could go wrong with my implementation? I am a bit scared as well as if this canonical way to use loops fails for no good reason, it may imply other things in asyncio could go wrong. Unless proven otherwise (I do not rule out an implementation mistake), there could be a bug here, hence this post (StackOverflow is generally of little help when it comes to bugs). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 9 14:19:15 2016 From: report at bugs.python.org (Guido van Rossum) Date: Wed, 09 Mar 2016 19:19:15 +0000 Subject: [issue26520] asyncio.new_event_loop() hangs In-Reply-To: <1457550983.04.0.405041129862.issue26520@psf.upfronthosting.co.za> Message-ID: Guido van Rossum added the comment: Asyncio is not .NET. Don't assume that what's "by the book" according to .NET applies to asyncio. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 9 14:56:19 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 09 Mar 2016 19:56:19 +0000 Subject: [issue26522] pickle.whichmodule(object.__new__, None) = 'email.MIMEAudio' In-Reply-To: <1457550403.98.0.525527175536.issue26522@psf.upfronthosting.co.za> Message-ID: <1457553379.53.0.509758881689.issue26522@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: I get other result: >>> import pickle >>> pickle.whichmodule(object.__new__, None) Traceback (most recent call last): File "", line 1, in File "/home/serhiy/py/cpython2.7/Lib/pickle.py", line 823, in whichmodule if name != '__main__' and getattr(module, funcname, None) is func: TypeError: getattr(): attribute name must be string Could you please provide the full example? ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 9 14:58:22 2016 From: report at bugs.python.org (SilentGhost) Date: Wed, 09 Mar 2016 19:58:22 +0000 Subject: [issue26499] http.client.IncompleteRead from HTTPResponse read after part reading file In-Reply-To: <1457345453.59.0.0327827539319.issue26499@psf.upfronthosting.co.za> Message-ID: <1457553502.57.0.62651423673.issue26499@psf.upfronthosting.co.za> SilentGhost added the comment: All the highlighted issue are now fixed. The limit on n in read1 wasn't tested. Your suggestion regarding testing went a bit over my head, Martin. So, just trying to make sure we're on the same page. ExtendedReadTest, where I thought placing these new tests, is already employing FakeSocket, but I'm not sure how one would add a second response and to what. In any case, some of the code in that class seems rather specific, so it's not clear if it could or should be reused. ---------- Added file: http://bugs.python.org/file42106/issue26499_3.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 9 15:10:03 2016 From: report at bugs.python.org (Richard Futrell) Date: Wed, 09 Mar 2016 20:10:03 +0000 Subject: [issue26522] pickle.whichmodule(object.__new__, None) = 'email.MIMEAudio' In-Reply-To: <1457550403.98.0.525527175536.issue26522@psf.upfronthosting.co.za> Message-ID: <1457554203.88.0.0908332368522.issue26522@psf.upfronthosting.co.za> Richard Futrell added the comment: Ah, I get the same result as you in a clean interpreter session. Looks like it's not Python's fault. The bug seems to arise from an interaction with cloudpickle 0.2.1 (and only in IPython), which puts the bad value into a cache somewhere in the pickle module. So I'll take this issue to cloudpickle. In [1]: import cloudpickle In [2]: cloudpickle.dumps(object.__new__) Out[2]: '\x80\x02cemail.MIMEAudio\n__new__\nq\x00.' In [3]: import pickle In [4]: pickle.whichmodule(object.__new__, None) Out[4]: 'email.MIMEAudio' ---------- resolution: -> not a bug _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 9 15:15:57 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 09 Mar 2016 20:15:57 +0000 Subject: [issue26521] add `extend_enum` to Enum In-Reply-To: <1457549856.93.0.164722622997.issue26521@psf.upfronthosting.co.za> Message-ID: <1457554557.06.0.0633255303128.issue26521@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: To me, the essential property of enums in other languages is that there is known limited set of possible values. If this set is dynamically extended, this is not enum. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 9 15:28:47 2016 From: report at bugs.python.org (Erwin Mayer) Date: Wed, 09 Mar 2016 20:28:47 +0000 Subject: [issue26520] asyncio.new_event_loop() hangs In-Reply-To: <1457540530.17.0.125897820678.issue26520@psf.upfronthosting.co.za> Message-ID: <1457555327.78.0.158085906825.issue26520@psf.upfronthosting.co.za> Erwin Mayer added the comment: I understand that asyncio is not .NET and did my best to implement "by the book" according to the asyncio documentation I read extensively. My await_async function has in fact nothing in common with what I would do in .NET but is hopefully as close as possible to the canonical way to create and consume a loop. The only maybe non standard thing I do is create a lot of short-lived loops, but nothing in the documentation indicates this heavy usage can cause instability/freezing. The case I am reporting can therefore be seen as an asyncio stress test and is worrisome as if there is indeed a bug, it could occur randomly when creating a single loop as well. So far, I cannot see anything in my implementation that would be fundamentally wrong (for example: do we need to always call close() on a loop, or is it taken care of by the GC). I can provide remote access to my screen when the issue occurs if it helps, and will post a bounty on my StackOverflow question tomorrow. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 9 15:37:10 2016 From: report at bugs.python.org (Antoine Pitrou) Date: Wed, 09 Mar 2016 20:37:10 +0000 Subject: [issue26523] multiprocessing ThreadPool is untested Message-ID: <1457555830.32.0.570545129367.issue26523@psf.upfronthosting.co.za> New submission from Antoine Pitrou: There is a mistake in _test_multiprocessing.py which means that ThreadPool is untested, the regular Pool is tested instead by the ThreadsMixin. Patch attached. ---------- components: Library (Lib), Tests files: test_threadpool.patch keywords: patch messages: 261474 nosy: jnoller, neologix, pitrou, sbt priority: normal severity: normal stage: patch review status: open title: multiprocessing ThreadPool is untested type: behavior versions: Python 3.5, Python 3.6 Added file: http://bugs.python.org/file42107/test_threadpool.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 9 15:46:32 2016 From: report at bugs.python.org (Guido van Rossum) Date: Wed, 09 Mar 2016 20:46:32 +0000 Subject: [issue26520] asyncio.new_event_loop() hangs In-Reply-To: <1457555327.78.0.158085906825.issue26520@psf.upfronthosting.co.za> Message-ID: Guido van Rossum added the comment: Closing the loop is not taken care of by GC, so I would start there. AFAIK that's covered by the docs, but if you think the docs could be clearer please do submit a separate issue with a documentation update (you can easily submit a patch for that!). It would be more useful as a bug report if you boiled it down to a small stand-alone program that exhibits the bug, rather than saying "in production, after many hours, I get a traceback" (the code you posted by itself is not enough to repro the issue, since you never show what the coroutine does). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 9 15:58:29 2016 From: report at bugs.python.org (Antoine Pitrou) Date: Wed, 09 Mar 2016 20:58:29 +0000 Subject: [issue26523] multiprocessing ThreadPool is untested In-Reply-To: <1457555830.32.0.570545129367.issue26523@psf.upfronthosting.co.za> Message-ID: <1457557109.91.0.309699981534.issue26523@psf.upfronthosting.co.za> Antoine Pitrou added the comment: Turns out a couple of tests were calling multiprocessing.Pool directly, updating patch. ---------- Added file: http://bugs.python.org/file42108/test_threadpool2.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 9 16:06:55 2016 From: report at bugs.python.org (John Beck) Date: Wed, 09 Mar 2016 21:06:55 +0000 Subject: [issue26524] document what config directory is used for Message-ID: <1457557615.13.0.55098857732.issue26524@psf.upfronthosting.co.za> New submission from John Beck: Solaris ships Python versions 2.7, 3.4 and 3.5 at present. For 2.7, we ship both 32-bit and 64-bit versions; for 3.4 and 3.5 we only ship 64-bit versions. For 2.7, we ship /usr/lib/python2.7/config/ with the usual suspects (Makefile, Setup.config, config.c, install-sh, python.o, Setup, Setup.local, config.c.in, makesetup) thereunder for the 32-bit version but for the 64-bit version, we don't ship the equivalent directory at all. For 3.4 and 3.5, we ship /usr/lib/python3.[45]/config-3.[45]m/ with its usual suspects. We had a bug filed about the discrepancy in shipping the 32-bit but not the 64-bit version of that directory for 2.7. An investigation suggested the directory is not used for 2.7, nor did it seem used (per docs we could find) for 3.x. But testing revealed it is used for 3.x, as our builds failed, e.g.: error: invalid Python installation: unable to open /usr/lib/python3.4/config-3.4m/Makefile (No such file or directory) when we removed the config-3.[45]m directories. OK, fine, it was an experiment, so we'll keep the directories. But it was not clear to us from the docs we could find, such as: https://docs.python.org/3.6/extending/extending.html exactly how the config directory is used. This is a documentation enhancement request to clarify how the config directory is used. ---------- assignee: docs at python components: Documentation messages: 261477 nosy: docs at python, jbeck priority: normal severity: normal status: open title: document what config directory is used for versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 9 16:15:46 2016 From: report at bugs.python.org (Wolfgang Maier) Date: Wed, 09 Mar 2016 21:15:46 +0000 Subject: [issue26506] hex() documentation: mention "%x" % int In-Reply-To: <1457372823.56.0.270827849914.issue26506@psf.upfronthosting.co.za> Message-ID: <1457558146.35.0.234187004467.issue26506@psf.upfronthosting.co.za> Wolfgang Maier added the comment: Your two suggestions prompted me to do a speed comparison between them and the result surprised me. I tried: import random nums = [random.randint(0, 255) for n in range(10000000)] then timed the simple: for n in nums: hx = '%X' % n # or hx = format(n, 'X') I also tested a number of more complex formats like: hx = '%{:02X}'.format(n) vs hx = '%%%02X' % n In all cases, the old vs new formatting styles are rather similar in speed in my system Python 2.7.6 (with maybe a slight advantage for the format-based formatting). In Python 3.5.0, however, old-style %-formatting is much speedier than under Python 2, while new-style formatting doesn't appear to have changed much, with the result that %-formatting is now between 30-50% faster than format-based formatting. So I guess my questions are: - are my timings wrong? and if not: - how got %-formatting improved (generally? or for %X specifically?) - can this speed up be transferred to format-based formatting somehow? ---------- nosy: +wolma _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 9 16:30:14 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 09 Mar 2016 21:30:14 +0000 Subject: [issue26522] pickle.whichmodule(object.__new__, None) = 'email.MIMEAudio' In-Reply-To: <1457550403.98.0.525527175536.issue26522@psf.upfronthosting.co.za> Message-ID: <1457559014.0.0.554218148175.issue26522@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 9 16:43:11 2016 From: report at bugs.python.org (Eric V. Smith) Date: Wed, 09 Mar 2016 21:43:11 +0000 Subject: [issue26506] hex() documentation: mention "%x" % int In-Reply-To: <1457372823.56.0.270827849914.issue26506@psf.upfronthosting.co.za> Message-ID: <1457559791.36.0.885805084084.issue26506@psf.upfronthosting.co.za> Eric V. Smith added the comment: Without lots of analysis (and disassembly), I can't speak to how valid your tests are, but they don't seem unreasonable. format() will always be slower, because it's more general (primarily in that it can be extended to new types). Plus, it involves at least a name lookup that %-formatting can skip. The usual ways to optimize this lookup holds here, too, if speed is really that critical (which I'm skeptical of). For example, say you had a custom type which implemented __format__ to understand the "X" format code. Using format(), this type could format itself as hex. %-formatting can't do that. In any event, I don't think we want to promulgate the fastest way to do a hex conversion, just the clearest. I can't say why format() in 3.5 is slower. There are many changes and tracking it down would be quite time consuming. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 9 16:47:42 2016 From: report at bugs.python.org (Wolfgang Maier) Date: Wed, 09 Mar 2016 21:47:42 +0000 Subject: [issue26506] hex() documentation: mention "%x" % int In-Reply-To: <1457372823.56.0.270827849914.issue26506@psf.upfronthosting.co.za> Message-ID: <1457560062.43.0.831908300108.issue26506@psf.upfronthosting.co.za> Wolfgang Maier added the comment: Ah, but it's not that format() is slower in 3.5, but that %-formatting got faster. It looks as if it got optimized and I was wondering whether the same optimization could be applied to format(). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 9 17:07:15 2016 From: report at bugs.python.org (Mark Lawrence) Date: Wed, 09 Mar 2016 22:07:15 +0000 Subject: [issue20211] setup.py: do not add invalid header locations In-Reply-To: <1389308528.92.0.403642458985.issue20211@psf.upfronthosting.co.za> Message-ID: <1457561235.37.0.419346313459.issue20211@psf.upfronthosting.co.za> Changes by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 9 18:16:57 2016 From: report at bugs.python.org (STINNER Victor) Date: Wed, 09 Mar 2016 23:16:57 +0000 Subject: [issue26506] hex() documentation: mention "%x" % int In-Reply-To: <1457372823.56.0.270827849914.issue26506@psf.upfronthosting.co.za> Message-ID: <1457565417.41.0.0556401980322.issue26506@psf.upfronthosting.co.za> STINNER Victor added the comment: > Ah, but it's not that format() is slower in 3.5, but that %-formatting got faster. Hum, python3 looks faster on this dummy microbenchmark yeah. Who said that Python 3 is slower? :-) $ python2 -m timeit -s 'import random; nums = [random.randint(0, 255) for n in range(10**5)]' '["%x" % x for x in nums]' 10 loops, best of 3: 43.7 msec per loop $ python3 -m timeit -s 'import random; nums = [random.randint(0, 255) for n in range(10**5)]' '["%x" % x for x in nums]' 10 loops, best of 3: 19.2 msec per loop I spent a lot time to micro-optimize str%args, str.format(args), and operations on str in general in Python 3. I wrote a first article to explain my work on optimization: https://haypo.github.io/pybyteswriter.html I have a draft article explaning other kinds of optimizations related to the PEP 393. > It looks as if it got optimized and I was wondering whether the same optimization could be applied to format(). str.format(args) was also optimized, but it's still faster than str%args. On Python 3, "%x" % 0x1234abc takes 17 nanoseconds according to timeit. It's super fast! Any extra work can have a non negligible overhead. For example, it's known that operators are faster than functions in Python. One reason is that a calling requires to lookup the function in namespaces (local, global or builtin namespaces). It can be even worse (slower) to lookup a method (especially with custom __getattr__ method). -- Hum, I don't recall why you started to talk about performance :-D Why not documenting "%x" % value *and* format(value, 'x')? I prefer "%x" % value. I never use format(value, ...) but sometimes I use "{0:x}".format(value). f'{x:value}' looks too magical for me. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 9 19:03:51 2016 From: report at bugs.python.org (Jakub Stasiak) Date: Thu, 10 Mar 2016 00:03:51 +0000 Subject: [issue26396] Create json.JSONType In-Reply-To: <1456015468.57.0.0882861590724.issue26396@psf.upfronthosting.co.za> Message-ID: <1457568231.37.0.251763812926.issue26396@psf.upfronthosting.co.za> Changes by Jakub Stasiak : ---------- nosy: +jstasiak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 9 19:21:05 2016 From: report at bugs.python.org (Joseph Moran) Date: Thu, 10 Mar 2016 00:21:05 +0000 Subject: [issue26322] Missing docs for typing.Set In-Reply-To: <1455050900.92.0.506743123977.issue26322@psf.upfronthosting.co.za> Message-ID: <1457569265.91.0.348114437775.issue26322@psf.upfronthosting.co.za> Joseph Moran added the comment: Deleted second ABSTRACTSET and added SET in typing docs ---------- nosy: +joegotflow83 Added file: http://bugs.python.org/file42109/26322 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 9 20:39:45 2016 From: report at bugs.python.org (Ned Deily) Date: Thu, 10 Mar 2016 01:39:45 +0000 Subject: [issue26523] multiprocessing ThreadPool is untested In-Reply-To: <1457555830.32.0.570545129367.issue26523@psf.upfronthosting.co.za> Message-ID: <1457573985.4.0.819198039248.issue26523@psf.upfronthosting.co.za> Changes by Ned Deily : ---------- nosy: +davin _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 9 23:42:01 2016 From: report at bugs.python.org (Sebastien Bourdeauducq) Date: Thu, 10 Mar 2016 04:42:01 +0000 Subject: [issue26509] spurious ConnectionAbortedError logged on Windows In-Reply-To: <1457412256.22.0.929855467044.issue26509@psf.upfronthosting.co.za> Message-ID: <1457584921.92.0.0726626946786.issue26509@psf.upfronthosting.co.za> Sebastien Bourdeauducq added the comment: Your patch seems to miss the ``_fatal_error`` method in ``proactor_events.py`` (which is actually where the bug happens in my application - it's using ``ProactorEventLoop``). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 10 01:13:57 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 10 Mar 2016 06:13:57 +0000 Subject: [issue26523] multiprocessing ThreadPool is untested In-Reply-To: <1457555830.32.0.570545129367.issue26523@psf.upfronthosting.co.za> Message-ID: <1457590437.83.0.474744367094.issue26523@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: LGTM. Is it worth to change multiprocessing.Pool in _TestPoolWorkerErrors and _TestPoolWorkerLifetime? Currently they work only for processes, but may be they can be generalized. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 10 03:51:32 2016 From: report at bugs.python.org (gladman) Date: Thu, 10 Mar 2016 08:51:32 +0000 Subject: [issue26525] Documentation of ord(c) easy to misread Message-ID: <1457599892.41.0.987128084347.issue26525@psf.upfronthosting.co.za> New submission from gladman: It is very easy to misread the greek 'nu' used in the ord(c) documentation as ord('v') (i.e. an alphabetic 'v'). This can lead the reader to draw a wrong conclusion about the behaviour of the function. Would it not be better if this example used a greek letter that is less easy to misread in this way? Or, perhaps, add extra text indicating that the greek letter 'nu' is being referenced? ---------- assignee: docs at python components: Documentation messages: 261485 nosy: docs at python, gladman priority: normal severity: normal status: open title: Documentation of ord(c) easy to misread versions: Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 10 04:02:32 2016 From: report at bugs.python.org (A. Skrobov) Date: Thu, 10 Mar 2016 09:02:32 +0000 Subject: [issue26526] In parsemodule.c, replace over 2KLOC of hand-crafted validation code, with a DFA Message-ID: <1457600551.84.0.318395917649.issue26526@psf.upfronthosting.co.za> New submission from A. Skrobov: Updating Modules/parsermodule.c for every change in grammar and/or parser is a maintenance burden, listed as such at https://docs.python.org/devguide/grammar.html The attached patch lets the validation code use the auto-generated DFA structures, thus ensuring it stays up to date with the grammar. It also trims the code by over 2KLOC. ---------- components: Extension Modules files: patch messages: 261486 nosy: A. Skrobov, fdrake priority: normal severity: normal status: open title: In parsemodule.c, replace over 2KLOC of hand-crafted validation code, with a DFA type: enhancement versions: Python 3.6 Added file: http://bugs.python.org/file42110/patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 10 04:22:21 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 10 Mar 2016 09:22:21 +0000 Subject: [issue26525] Documentation of ord(c) easy to misread In-Reply-To: <1457599892.41.0.987128084347.issue26525@psf.upfronthosting.co.za> Message-ID: <1457601741.89.0.301004776562.issue26525@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- nosy: +georg.brandl _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 10 04:23:35 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 10 Mar 2016 09:23:35 +0000 Subject: [issue26526] In parsemodule.c, replace over 2KLOC of hand-crafted validation code, with a DFA In-Reply-To: <1457600551.84.0.318395917649.issue26526@psf.upfronthosting.co.za> Message-ID: <1457601815.48.0.182209849591.issue26526@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- nosy: +benjamin.peterson _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 10 04:25:19 2016 From: report at bugs.python.org (STINNER Victor) Date: Thu, 10 Mar 2016 09:25:19 +0000 Subject: [issue26526] In parsemodule.c, replace over 2KLOC of hand-crafted validation code, with a DFA In-Reply-To: <1457600551.84.0.318395917649.issue26526@psf.upfronthosting.co.za> Message-ID: <1457601919.79.0.718714443549.issue26526@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 10 04:25:57 2016 From: report at bugs.python.org (STINNER Victor) Date: Thu, 10 Mar 2016 09:25:57 +0000 Subject: [issue26526] In parsermodule.c, replace over 2KLOC of hand-crafted validation code, with a DFA In-Reply-To: <1457600551.84.0.318395917649.issue26526@psf.upfronthosting.co.za> Message-ID: <1457601957.31.0.226596497522.issue26526@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- title: In parsemodule.c, replace over 2KLOC of hand-crafted validation code, with a DFA -> In parsermodule.c, replace over 2KLOC of hand-crafted validation code, with a DFA _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 10 04:30:53 2016 From: report at bugs.python.org (Martin Panter) Date: Thu, 10 Mar 2016 09:30:53 +0000 Subject: [issue17590] mingw: translate gcc internal defines to python platform specific defines In-Reply-To: <1364758799.57.0.261822298653.issue17590@psf.upfronthosting.co.za> Message-ID: <1457602253.3.0.265501193726.issue17590@psf.upfronthosting.co.za> Martin Panter added the comment: What?s the point of allowing each macro to already be defined? I understand they may also be defined by PC/pyconfig.h, but is that possible if __MINGW32__ is defined? Is the __MINGW32__ condition needed at all? Maybe we can just blindly rely on the _WIN32 etc macros. Perhaps the PC/pyconfig.h definitions could be removed in favour of the ones in "pyport.h"? ---------- components: +Windows nosy: +Alex.Willmer, martin.panter, paul.moore, steve.dower, tim.golden, zach.ware stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 10 04:47:41 2016 From: report at bugs.python.org (STINNER Victor) Date: Thu, 10 Mar 2016 09:47:41 +0000 Subject: [issue26249] Change PyMem_Malloc to use pymalloc allocator In-Reply-To: <1454262504.41.0.628053130208.issue26249@psf.upfronthosting.co.za> Message-ID: <1457603261.36.0.840222212626.issue26249@psf.upfronthosting.co.za> STINNER Victor added the comment: > Does the API doc say anything about the GIL, for example? I modified Python to add assert(PyGILState_Check()); in PyMem_Malloc() and other functions. Sadly, I found a bug in Numpy: Numpy releases the GIL for performance but call PyMem_Malloc() with the GIL released. I proposed a fix: https://github.com/numpy/numpy/pull/7404 I guess that the fix is obvious and will be quickly merged, but it means that other libraries may have the issue. Using the issue #26516 (PYTHONMALLOC=debug), we can check PyGILState_Check() at runtime, but there is currently an issue related to sub-interpreters. The assertion fails in support.run_in_subinterp(), function used by test_threading and test_capi for example. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 10 05:02:32 2016 From: report at bugs.python.org (Martin Panter) Date: Thu, 10 Mar 2016 10:02:32 +0000 Subject: [issue17596] mingw: add wincrypt.h in Python/random.c In-Reply-To: <1364759550.1.0.784816138904.issue17596@psf.upfronthosting.co.za> Message-ID: <1457604152.71.0.481211147813.issue17596@psf.upfronthosting.co.za> Martin Panter added the comment: Yes I would tend to think including would be harmless on Windows, but I don?t have a native Windows to try it out on. Here is a proposed patch anyway. It would be good for someone to be able to confirm it doesn?t break the normal Windows build. ---------- components: +Windows nosy: +Alex.Willmer, martin.panter, paul.moore, steve.dower, tim.golden, zach.ware stage: -> patch review versions: +Python 3.6 -Python 3.4 Added file: http://bugs.python.org/file42111/MINGW-wincrypt.v3.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 10 06:03:40 2016 From: report at bugs.python.org (Nick Coghlan) Date: Thu, 10 Mar 2016 11:03:40 +0000 Subject: [issue23857] Make default HTTPS certificate verification setting configurable In-Reply-To: <1428057486.92.0.857087998573.issue23857@psf.upfronthosting.co.za> Message-ID: <1457607820.8.0.578940620401.issue23857@psf.upfronthosting.co.za> Nick Coghlan added the comment: The attached patch adds documentation (to the ssl module docs, the environment variable descriptions and the 2.7 What's New) and also fixes the PYTHONHTTPSVERIFY tests to use a subprocess so they can still run under -E. Assuming the docs pass muster, then the only bit missing should be the NEWS entry. ---------- stage: -> commit review Added file: http://bugs.python.org/file42112/pep493_with_docs.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 10 06:04:31 2016 From: report at bugs.python.org (Olivier Le Moign) Date: Thu, 10 Mar 2016 11:04:31 +0000 Subject: [issue26527] CGI library - Using unicode in header fields Message-ID: <1457607871.95.0.782640087152.issue26527@psf.upfronthosting.co.za> New submission from Olivier Le Moign: According to RFC5987 (http://tools.ietf.org/html/rfc5987), it's possible to use other encoding than ASCII in header fields. Specifically in the CGI library, posting files with non-ASCII characters will lead the header to be (for example) filename*=utf-8"xxxxx" which is not recognised: l 513 if 'filename' in pdict: self.filename = pdict['filename'] self._binary_file = self.filename is not None The file will thus be treated as a string. The correction isn't too big but being a total newbie, I'm a bit scared to suggest a patch. ---------- components: Unicode messages: 261491 nosy: ezio.melotti, haypo, olemoign priority: normal severity: normal status: open title: CGI library - Using unicode in header fields type: behavior versions: Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 10 06:12:02 2016 From: report at bugs.python.org (Olivier Le Moign) Date: Thu, 10 Mar 2016 11:12:02 +0000 Subject: [issue26527] CGI library - Using unicode in header fields In-Reply-To: <1457607871.95.0.782640087152.issue26527@psf.upfronthosting.co.za> Message-ID: <1457608322.43.0.0798534016264.issue26527@psf.upfronthosting.co.za> Olivier Le Moign added the comment: I guess this is fixed by https://pypi.python.org/pypi/rfc6266. Could have looked better, sorry. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 10 06:18:46 2016 From: report at bugs.python.org (STINNER Victor) Date: Thu, 10 Mar 2016 11:18:46 +0000 Subject: [issue26525] Documentation of ord(c) easy to misread In-Reply-To: <1457599892.41.0.987128084347.issue26525@psf.upfronthosting.co.za> Message-ID: <1457608726.75.0.585660516325.issue26525@psf.upfronthosting.co.za> STINNER Victor added the comment: I suggest to use the EURO SIGN ? (U+20ac). ---------- keywords: +easy nosy: +haypo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 10 06:21:10 2016 From: report at bugs.python.org (STINNER Victor) Date: Thu, 10 Mar 2016 11:21:10 +0000 Subject: [issue26506] hex() documentation: mention "%x" % int In-Reply-To: <1457372823.56.0.270827849914.issue26506@psf.upfronthosting.co.za> Message-ID: <1457608870.08.0.000642012161195.issue26506@psf.upfronthosting.co.za> STINNER Victor added the comment: > I regulary see Python code using hex(value)[2:] In fact, it's even worse, I also saw Python 2 code stripping trailing "L", since hex(long) adds a L suffix... $ python2 Python 2.7.10 (default, Sep 8 2015, 17:20:17) [GCC 5.1.1 20150618 (Red Hat 5.1.1-4)] on linux2 >>> hex(123L) '0x7bL' >>> "%x" % 123L '7b' >>> format(123L, "x") '7b' >>> "%#x" % 123L '0x7b' >>> format(123L, "#x") '0x7b' ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 10 06:32:40 2016 From: report at bugs.python.org (Chris Jerdonek) Date: Thu, 10 Mar 2016 11:32:40 +0000 Subject: [issue15693] expose glossary link on hover In-Reply-To: <1345132108.78.0.567099034623.issue15693@psf.upfronthosting.co.za> Message-ID: <1457609560.41.0.488636735.issue15693@psf.upfronthosting.co.za> Chris Jerdonek added the comment: It looks like the issue I previously filed on the Sphinx tracker was migrated here: https://github.com/sphinx-doc/sphinx/issues/996 . But the patch I submitted seems to have been dropped. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 10 06:49:32 2016 From: report at bugs.python.org (Martin Panter) Date: Thu, 10 Mar 2016 11:49:32 +0000 Subject: [issue17597] mingw: Allow Objects/exceptions.c to include "errmap.h" In-Reply-To: <1364759799.81.0.998386094022.issue17597@psf.upfronthosting.co.za> Message-ID: <1457610572.82.0.383149903992.issue17597@psf.upfronthosting.co.za> Martin Panter added the comment: Yes it makes more sense to me to move the file to a common directory. That should avoid any potential conflict with pyconfig.h. What did you mean by a platform-specific filename? Here is a patch to move the file. I have not tested regenerating it however, so it would be good to get some feedback on that. I don?t have a Windows etc setup to check if I have broken anything. ---------- components: +Windows -Cross-Build nosy: +martin.panter, paul.moore, steve.dower, tim.golden, zach.ware stage: -> patch review title: mingw: add $srcdir/PC to CPPFLAGS -> mingw: Allow Objects/exceptions.c to include "errmap.h" Added file: http://bugs.python.org/file42113/move-errmap.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 10 07:09:57 2016 From: report at bugs.python.org (reidfaiv) Date: Thu, 10 Mar 2016 12:09:57 +0000 Subject: [issue26528] NameError for built in function open when re-raising stored exception from yielded function Message-ID: <1457611797.69.0.202848672993.issue26528@psf.upfronthosting.co.za> New submission from reidfaiv: Builtin open() gets NameError) in context manager __exit__ in case: * context manager yielding records * we return another generator when consuming these and * second generator raises, catches, stores and re-raises an excption Reduced down code looks like this: --------------------------------------- #!/usr/bin/env python # -*- coding: utf-8 -*- # context manager "query" (open in init, yield rows and close on exit) class _query(): def __init__(self, **kwargs): pass def __enter__(self): return [1, 2, 3] def __exit__(self, type_, value, tb): print('__exit__') # print() is also built-in, but works f = open('test.log', 'wt') # <-- NameError: name 'open' is not defined f.close() # this works fine def a(): try: raise Exception('volatile exception') except Exception as e: raise e # this does not work def b(): try: raise Exception('stored exception') except Exception as e: ee = e # <-- storing exception and then raise ee # <-- re-raising stored exception triggers the issue def event_gen(**kwargs): with _query() as cursor: for _ in cursor: yield b # <--- does not work # yield a # <--- works fine def run(**kwargs): g = event_gen(**kwargs) r = next(g) r() # This also works # for r in event_gen(**kwargs): # r() if __name__ == '__main__': run() --------------------------------------- >python.exe gen_err.py Traceback (most recent call last): File "gen_err.py", line 52, in run() File "gen_err.py", line 46, in run r() File "gen_err.py", line 33, in b raise ee # <-- re-raising stored exception triggers the issue File "gen_err.py", line 30, in b raise Exception('stored exception') Exception: stored exception __exit__ Exception ignored in: Traceback (most recent call last): File "gen_err.py", line 39, in event_gen File "gen_err.py", line 15, in __exit__ NameError: name 'open' is not defined This happens with Python 3.4+ Works with earlier versions as expected. If exception re-raised immediately, works fine. If outermost generator is consumed in for loop, works fine. ---------- components: Interpreter Core files: gen_err.py messages: 261497 nosy: reidfaiv priority: normal severity: normal status: open title: NameError for built in function open when re-raising stored exception from yielded function type: behavior versions: Python 3.4, Python 3.5 Added file: http://bugs.python.org/file42114/gen_err.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 10 07:41:35 2016 From: report at bugs.python.org (Vadim Markovtsev) Date: Thu, 10 Mar 2016 12:41:35 +0000 Subject: [issue26529] urllib.request: ftplib's cwd() can do harm Message-ID: <1457613695.97.0.915811579491.issue26529@psf.upfronthosting.co.za> New submission from Vadim Markovtsev: urllib/request.py, near line 2345 # Set transfer mode to ASCII! self.ftp.voidcmd('TYPE A') # Try a directory listing. Verify that directory exists. if file: pwd = self.ftp.pwd() try: try: self.ftp.cwd(file) except ftplib.error_perm as reason: raise URLError('ftp error: %r' % reason) from reason finally: self.ftp.cwd(pwd) cmd = 'LIST ' + file else: cmd = 'LIST' conn, retrlen = self.ftp.ntransfercmd(cmd) and near line 2314: def init(self): import ftplib self.busy = 0 self.ftp = ftplib.FTP() self.ftp.connect(self.host, self.port, self.timeout) self.ftp.login(self.user, self.passwd) _target = '/'.join(self.dirs) self.ftp.cwd(_target) The fact is, one can download a file from FTP without accessing the listing of it's parent directory. Example: ftp://ftp.apnic.net/apnic/whois-data/APNIC/split/apnic.db.inetnum.gz (African whois db). So these cwd() calls prevent from successfully downloading the file. If the corresponding blocks are commented out, the file is downloaded OK. I am not sure how to fix this, rather than totally remove cwd() stuff. ---------- components: Library (Lib) messages: 261498 nosy: Vadim Markovtsev priority: normal severity: normal status: open title: urllib.request: ftplib's cwd() can do harm 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 Thu Mar 10 08:15:45 2016 From: report at bugs.python.org (Martin Panter) Date: Thu, 10 Mar 2016 13:15:45 +0000 Subject: [issue26528] NameError for built in function open when re-raising stored exception from yielded function In-Reply-To: <1457611797.69.0.202848672993.issue26528@psf.upfronthosting.co.za> Message-ID: <1457615744.94.0.696567592444.issue26528@psf.upfronthosting.co.za> Martin Panter added the comment: What is probably happening here is how garbage collection works at the interpreter exit. It is sort of mentioned in the warning at . The variable g is an iterator for event_gen(), and it is still ?alive? when the exception is raised. The exception contains a reference to the traceback and all the local variables, including g. So the context manager in the generator cannot exit until g is deleted [or g.close() is called]. In the ?volatile exception? case, I guess it is easy for the interpreter to release the exception traceback, including the g iterator that it references, straight after it has reported the traceback. But when you store an exception that you catch in a local variable, you create a reference loop (something like ee.__traceback__.tb_frame.f_locals["ee"] is ee). So it is not so easy to release the references, and by the time the garbage collector runs, I guess it has already set builtin names like ?open? (global variable of the ?builtins? module) to None. If you need a generator to clean up, you should probably close the generator before exiting the function rather than relying on garbage collection. Unfortunately there is no mechanism like ResourceWarning to indicate this problem with generators. ---------- nosy: +martin.panter _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 10 08:36:02 2016 From: report at bugs.python.org (STINNER Victor) Date: Thu, 10 Mar 2016 13:36:02 +0000 Subject: [issue26512] Vocabulary: Using "integral" in library/stdtypes.html In-Reply-To: <1457472244.72.0.113699245831.issue26512@psf.upfronthosting.co.za> Message-ID: <1457616962.96.0.0326418798021.issue26512@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- nosy: +mark.dickinson _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 10 08:59:29 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 10 Mar 2016 13:59:29 +0000 Subject: [issue26512] Vocabulary: Using "integral" in library/stdtypes.html In-Reply-To: <1457472244.72.0.113699245831.issue26512@psf.upfronthosting.co.za> Message-ID: <1457618369.46.0.660142262526.issue26512@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- nosy: +martin.panter _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 10 09:17:02 2016 From: report at bugs.python.org (reidfaiv) Date: Thu, 10 Mar 2016 14:17:02 +0000 Subject: [issue26528] NameError for built in function open when re-raising stored exception from yielded function In-Reply-To: <1457611797.69.0.202848672993.issue26528@psf.upfronthosting.co.za> Message-ID: <1457619422.07.0.458394959909.issue26528@psf.upfronthosting.co.za> reidfaiv added the comment: Indeed, explicitly closing generator helps, following works: def run(**kwargs): g = event_gen(**kwargs) r = next(g) g.close() r() Thanks! Do you want to keep this issue open for investigation? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 10 09:17:10 2016 From: report at bugs.python.org (STINNER Victor) Date: Thu, 10 Mar 2016 14:17:10 +0000 Subject: [issue26530] tracemalloc: add C API to manually track/untrack memory allocations Message-ID: <1457619430.68.0.0968942184372.issue26530@psf.upfronthosting.co.za> New submission from STINNER Victor: The API of Python memory allocators was extended for numpy: calloc() was added (issue #21233). It looks like it's not enough because allocations with an alignment is also required for vector operations (SIMD). For Python, there is the issue #18835 but the benefit for Python code is unclear or negligible. Instead of extending the API each time, it would be simpler to add an API to allow third party memory allocators to track/untrack memory in tracemalloc. I guess that the API should make the assumption that the GIL is not hold and so try to acquire the GIL (if it's not already hold). Related numpy issue: https://github.com/numpy/numpy/issues/4663 See also: https://mail.scipy.org/pipermail/numpy-discussion/2015-January/072068.html ---------- messages: 261501 nosy: haypo, njs priority: normal severity: normal status: open title: tracemalloc: add C API to manually track/untrack memory allocations type: enhancement versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 10 09:34:20 2016 From: report at bugs.python.org (STINNER Victor) Date: Thu, 10 Mar 2016 14:34:20 +0000 Subject: [issue26530] tracemalloc: add C API to manually track/untrack memory allocations In-Reply-To: <1457619430.68.0.0968942184372.issue26530@psf.upfronthosting.co.za> Message-ID: <1457620460.66.0.621418422799.issue26530@psf.upfronthosting.co.za> STINNER Victor added the comment: Patch without test. I chose to require the GIL to be held for efficiency. IMHO the common case is more than the GIL is held. Example to call the function if the GIL is not held: int res; PyGILState_STATE gil_state; gil_state = PyGILState_Ensure(); res = _PyTraceMalloc_Track(ptr, size); PyGILState_Release(gil_state); return res; See also my numpy pull request on PyMem_Malloc() called without the GIL being held: https://github.com/numpy/numpy/pull/7404 ---------- keywords: +patch Added file: http://bugs.python.org/file42115/tracemalloc_track.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 10 09:37:30 2016 From: report at bugs.python.org (Vadim Markovtsev) Date: Thu, 10 Mar 2016 14:37:30 +0000 Subject: [issue26529] urllib.request: ftplib's cwd() can do harm In-Reply-To: <1457613695.97.0.915811579491.issue26529@psf.upfronthosting.co.za> Message-ID: <1457620650.84.0.280671632088.issue26529@psf.upfronthosting.co.za> Changes by Vadim Markovtsev : ---------- resolution: -> not a bug status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 10 09:39:57 2016 From: report at bugs.python.org (A. Skrobov) Date: Thu, 10 Mar 2016 14:39:57 +0000 Subject: [issue26415] Fragmentation of the heap memory in the Python parser In-Reply-To: <1456182380.09.0.81920177296.issue26415@psf.upfronthosting.co.za> Message-ID: <1457620797.17.0.186061788704.issue26415@psf.upfronthosting.co.za> A. Skrobov added the comment: I've now tried it with "perf.py -r -m", and the memory savings are as follows: ### 2to3 ### Mem max: 45976.000 -> 47440.000: 1.0318x larger ### chameleon_v2 ### Mem max: 436968.000 -> 401088.000: 1.0895x smaller ### django_v3 ### Mem max: 23808.000 -> 22584.000: 1.0542x smaller ### fastpickle ### Mem max: 10768.000 -> 9248.000: 1.1644x smaller ### fastunpickle ### Mem max: 10988.000 -> 9328.000: 1.1780x smaller ### json_dump_v2 ### Mem max: 10892.000 -> 10612.000: 1.0264x smaller ### json_load ### Mem max: 11012.000 -> 9908.000: 1.1114x smaller ### nbody ### Mem max: 8696.000 -> 7944.000: 1.0947x smaller ### regex_v8 ### Mem max: 12504.000 -> 9432.000: 1.3257x smaller ### tornado_http ### Mem max: 27636.000 -> 27608.000: 1.0010x smaller So, on these benchmarks, the saving is not threefold, of course; but still quite substantial (up to 30%). The run time difference, on these benchmarks, is between "1.04x slower" and "1.06x faster", for reasons beyond my understanding (variability of background load, possibly?) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 10 10:19:57 2016 From: report at bugs.python.org (Georg Brandl) Date: Thu, 10 Mar 2016 15:19:57 +0000 Subject: [issue26525] Documentation of ord(c) easy to misread In-Reply-To: <1457599892.41.0.987128084347.issue26525@psf.upfronthosting.co.za> Message-ID: <1457623197.56.0.272994460834.issue26525@psf.upfronthosting.co.za> Georg Brandl added the comment: Sure! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 10 10:21:27 2016 From: report at bugs.python.org (Antoine Pitrou) Date: Thu, 10 Mar 2016 15:21:27 +0000 Subject: [issue26530] tracemalloc: add C API to manually track/untrack memory allocations In-Reply-To: <1457619430.68.0.0968942184372.issue26530@psf.upfronthosting.co.za> Message-ID: <1457623287.91.0.174607242862.issue26530@psf.upfronthosting.co.za> Antoine Pitrou added the comment: This may indeed be useful but: - those functions should be no-ops when tracing isn't enabled (so as to be as fast as possible) - you should take the GIL if necessary (but only if tracing is enabled, of course) ---------- nosy: +pitrou _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 10 10:24:40 2016 From: report at bugs.python.org (Antoine Pitrou) Date: Thu, 10 Mar 2016 15:24:40 +0000 Subject: [issue26507] Use highest pickle protocol in multiprocessing In-Reply-To: <1457403085.0.0.0995776764652.issue26507@psf.upfronthosting.co.za> Message-ID: <1457623480.27.0.0761939847463.issue26507@psf.upfronthosting.co.za> Antoine Pitrou added the comment: Agreed with Davin. ---------- nosy: +pitrou _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 10 11:07:56 2016 From: report at bugs.python.org (STINNER Victor) Date: Thu, 10 Mar 2016 16:07:56 +0000 Subject: [issue26530] tracemalloc: add C API to manually track/untrack memory allocations In-Reply-To: <1457619430.68.0.0968942184372.issue26530@psf.upfronthosting.co.za> Message-ID: <1457626076.89.0.677921944213.issue26530@psf.upfronthosting.co.za> STINNER Victor added the comment: Antoine Pitrou: > This may indeed be useful but: > - those functions should be no-ops when tracing isn't enabled (so as to be as fast as possible) Done > - you should take the GIL if necessary (but only if tracing is enabled, of course) Ok, done. The new patch has a safer API: * _PyTraceMalloc_Track() can be called twice with the same pointer: the old trace is removed, a new trace is added * _PyTraceMalloc_Track() ensures that the GIL is hold * _PyTraceMalloc_Track() & _PyTraceMalloc_Untrack() do nothing if tracemalloc is disabled I also added unit tests. ---------- Added file: http://bugs.python.org/file42116/tracemalloc_track-2.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 10 11:18:45 2016 From: report at bugs.python.org (Joshua Cannell) Date: Thu, 10 Mar 2016 16:18:45 +0000 Subject: [issue26531] Keyboard Interrupts not caught when used within a class method on Windows 10 Message-ID: <1457626725.91.0.992328225706.issue26531@psf.upfronthosting.co.za> New submission from Joshua Cannell: There seems to be an issue capturing keyboard interrupts on Windows 10 when using raw_input() inside of a class method w/python 2.7.x. So far I have tested this on: 2.7.11 x86 on Windows 10 x64 - Does not capture (Traceback) 2.7.11 x64 on Windows 10 x64 - Does not capture (Traceback) 2.7.11 x86 on Windows XP - Does capture So far I've only tested 2.7.11, so I don't know which other version may or may not be affected. The proof of concept code is attached. If there is anything else I can provide to help, please let me know. I'm not accustomed to posting bugs here so I apologize if I've missed something. ---------- components: Windows files: keyint_poc.py messages: 261508 nosy: jecanne, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: Keyboard Interrupts not caught when used within a class method on Windows 10 type: behavior versions: Python 2.7 Added file: http://bugs.python.org/file42117/keyint_poc.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 10 11:26:58 2016 From: report at bugs.python.org (TJG) Date: Thu, 10 Mar 2016 16:26:58 +0000 Subject: [issue26531] Keyboard Interrupts not caught when used within a class method on Windows 10 In-Reply-To: <1457626725.91.0.992328225706.issue26531@psf.upfronthosting.co.za> Message-ID: <56E1A04E.3070605@timgolden.me.uk> TJG added the comment: I don't have Win10 to test with, but can you confirm that the method is necessary for the code to fail? IOW does this fail equally? while True: try: raw_input() except KeyboardInterrupt: print "Interrupt!" Also, do I assume that the code simply carries on regardless without reaching the exception handler? Or does something else happen? ---------- nosy: +tjguk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 10 11:48:09 2016 From: report at bugs.python.org (STINNER Victor) Date: Thu, 10 Mar 2016 16:48:09 +0000 Subject: [issue26530] tracemalloc: add C API to manually track/untrack memory allocations In-Reply-To: <1457619430.68.0.0968942184372.issue26530@psf.upfronthosting.co.za> Message-ID: <1457628489.82.0.157404993648.issue26530@psf.upfronthosting.co.za> STINNER Victor added the comment: Hum, there is an issue in the patch version 2: tracemalloc_add_trace() rely on the assumption that the pointer is not already tracked. Since we give control to the traces to the user, this assumption may become wrong (if the API is badly used). This issue is now fixed in the patch version 3: tracemalloc_add_trace() now works if the pointer is already tracked. It allows to implement a micro-optimization on realloc() if the new pointer is equal to the old pointer (memory block didn't move). By the way, to track realloc(): _PyTraceMalloc_Untrack() must be called with the old pointer and _PyTraceMalloc_Track() must be called with the new pointer. I don't think that it's worth to add an helper function just for two calls. (The optimization old_ptr==new_ptr is really a micro-optimization, don't use tracemalloc if you care of performances, tracemalloc simply kills the performance ;-)) ---------- Added file: http://bugs.python.org/file42118/tracemalloc_track-3.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 10 11:51:24 2016 From: report at bugs.python.org (STINNER Victor) Date: Thu, 10 Mar 2016 16:51:24 +0000 Subject: [issue26531] Keyboard Interrupts not caught when used within a class method on Windows 10 In-Reply-To: <1457626725.91.0.992328225706.issue26531@psf.upfronthosting.co.za> Message-ID: <1457628684.71.0.193413747472.issue26531@psf.upfronthosting.co.za> STINNER Victor added the comment: Please try Python 3, I recall that we fixed bugs on input() on Windows related to CTRL+c. ---------- nosy: +haypo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 10 12:00:47 2016 From: report at bugs.python.org (Joshua Cannell) Date: Thu, 10 Mar 2016 17:00:47 +0000 Subject: [issue26531] Keyboard Interrupts not caught when used within a class method on Windows 10 In-Reply-To: <1457626725.91.0.992328225706.issue26531@psf.upfronthosting.co.za> Message-ID: <1457629247.39.0.490463861808.issue26531@psf.upfronthosting.co.za> Joshua Cannell added the comment: Hi, Thanks for the quick response. I tried your code, it doesn't capture the keyboard interrupt, so the method doesn't seem to be needed. Also, the code doesn't carry on if interrupt was received, but instead produces the stack traceback. For example: while True: try: data = raw_input() print data except KeyboardInterrupt: print "Interrupt!" Does not print "data" if a KeyboardInterrupt is received during raw_input. Unfortunately, I can't use python 3 as my organization currently uses 2 in their production environment. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 10 12:12:32 2016 From: report at bugs.python.org (TJG) Date: Thu, 10 Mar 2016 17:12:32 +0000 Subject: [issue26531] Keyboard Interrupts not caught when used within a class method on Windows 10 In-Reply-To: <1457629247.39.0.490463861808.issue26531@psf.upfronthosting.co.za> Message-ID: <56E1AAF9.7000802@timgolden.me.uk> TJG added the comment: If I run your code, it does what I expect: pressing Ctrl-C produces "Interrupt", doesn't print the data returned from raw_input, and doesn't produce a stacktrace. I'm not on Win10 and it's entirely possible that this area of the MS CRT has been reworked: it's a bit quirky and our use of it is fairly fragile. I'm still not clear, though, whether we have a bug or whether it's just that your expectation is at odds with the way in which this is intended to work. If you think there's a bug here, could you run the code you posted in a console window, do what actions are needed to make it fail, and then cut-and-paste the result here, possibly as an attached file. (Don't post a screenshot; just use the cmd window's mark-and-copy functionality to select the visible text). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 10 12:15:17 2016 From: report at bugs.python.org (STINNER Victor) Date: Thu, 10 Mar 2016 17:15:17 +0000 Subject: [issue26516] Add PYTHONMALLOC env var and add support for malloc debug hooks in release mode In-Reply-To: <1457522115.12.0.78692190259.issue26516@psf.upfronthosting.co.za> Message-ID: <1457630117.21.0.0317875789642.issue26516@psf.upfronthosting.co.za> STINNER Victor added the comment: Oh, I forgot to update wmain() for Windows. Patch 4 handles wmain() too. I added a few comments and reformatted some parts of the code. ---------- Added file: http://bugs.python.org/file42119/pymem-4.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 10 12:23:45 2016 From: report at bugs.python.org (Zachary Ware) Date: Thu, 10 Mar 2016 17:23:45 +0000 Subject: [issue26531] KeyboardInterrupt while in input() not catchable on Windows 10 In-Reply-To: <1457626725.91.0.992328225706.issue26531@psf.upfronthosting.co.za> Message-ID: <1457630625.25.0.596778504974.issue26531@psf.upfronthosting.co.za> Zachary Ware added the comment: I can reproduce on Windows 10 with Pythons 2.7.11, 3.4.4, and 3.5.1 with the attached script. Examples: E:\>ver Microsoft Windows [Version 10.0.10586] E:\>py ccbug.py 2.7.11 (v2.7.11:6d1b6a68f775, Dec 5 2015, 20:32:19) [MSC v.1500 32 bit (Intel)] Traceback (most recent call last): File "ccbug.py", line 12, in data = input() E:\>py -3.4 ccbug.py 3.4.4 (v3.4.4:737efcadf5a6, Dec 20 2015, 19:28:18) [MSC v.1600 32 bit (Intel)] Traceback (most recent call last): File "ccbug.py", line 12, in E:\>py -3.5 ccbug.py 3.5.1 (v3.5.1:37a07cee5969, Dec 6 2015, 01:54:25) [MSC v.1900 64 bit (AMD64)] Traceback (most recent call last): File "ccbug.py", line 12, in ---------- title: Keyboard Interrupts not caught when used within a class method on Windows 10 -> KeyboardInterrupt while in input() not catchable on Windows 10 versions: +Python 3.5, Python 3.6 Added file: http://bugs.python.org/file42120/ccbug.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 10 12:25:59 2016 From: report at bugs.python.org (Wolfgang Maier) Date: Thu, 10 Mar 2016 17:25:59 +0000 Subject: [issue26506] hex() documentation: mention "%x" % int In-Reply-To: <1457372823.56.0.270827849914.issue26506@psf.upfronthosting.co.za> Message-ID: <1457630759.83.0.924095184001.issue26506@psf.upfronthosting.co.za> Wolfgang Maier added the comment: > Hum, python3 looks faster on this dummy microbenchmark yeah. Who said that Python 3 is slower? :-) If you're alluding to that seemingly endless thread over on python-list, let me say that it is not my motivation to start anything like that here. Sorry also if I sort of hijacked your documentation issue with my performance question. I really only wondered whether there would be any argument for or against any of the two versions (%-interpolation, format-based) other than stylistic ones. That's why I ran the micro-benchmark and, in fact, I was expecting %-interpolation to be faster exactly because it is less flexible. What I am surprised by is not the fact that %-interpolation got faster in Python3, but the fact that format didn't. I was wondering whether %-interpolation maybe takes some fast path in Python3 that simply wasn't implemented for format. If that was the case it could have been rewarding to just optimize format the same way. As I know Victor is working on performance stuff I thought I'd just ask here, but from your answer I gather that things are rather not so simple and that's ok. > I wrote a first article to explain my work on optimization: https://haypo.github.io/pybyteswriter.html Thanks for the link. > str.format(args) was also optimized, but it's still faster than str%args. You mean slower I assume ? > Hum, I don't recall why you started to talk about performance :-D See above. > Why not documenting "%x" % value *and* format(value, 'x')? > I prefer "%x" % value. I never use format(value, ...) but sometimes I use "{0:x}".format(value). I prefer the last version, use the first sometimes, but documenting several ways seems reasonable. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 10 12:37:31 2016 From: report at bugs.python.org (=?utf-8?b?0JDQvdC00YDQtdC5INCR0LDQutGB0LDQu9GP0YA=?=) Date: Thu, 10 Mar 2016 17:37:31 +0000 Subject: [issue12736] Request for python casemapping functions to use full not simple casemaps per Unicode's recommendation In-Reply-To: <1313098784.96.0.996919907442.issue12736@psf.upfronthosting.co.za> Message-ID: <1457631451.63.0.622200308596.issue12736@psf.upfronthosting.co.za> ?????? ???????? added the comment: A same problem with the unicode case mapping is still present in the Python 3.4.3. You can repeat the bug with this code, for instance: '?'.upper().lower() == '?' The case swapping is strangelly leads to character replacement: b'\xce\xb0' ? b'\xcf\x85\xcc\x88\xcc\x81' ---------- nosy: +?????? ???????? versions: +Python 3.4 -Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 10 12:47:35 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 10 Mar 2016 17:47:35 +0000 Subject: [issue26506] hex() documentation: mention "%x" % int In-Reply-To: <1457372823.56.0.270827849914.issue26506@psf.upfronthosting.co.za> Message-ID: <1457632055.73.0.226285535114.issue26506@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: > That's why I ran the micro-benchmark and, in fact, I was expecting %-interpolation to be faster exactly because it is less flexible. Actually %-interpolation is more flexible. >>> '%x' % 123 '7b' >>> '%0X' % 123 '7B' >>> '%#x' % 123 '0x7b' >>> '%04x' % 123 '007b' If document alternatives for hex(), we should also document formatting alternatives for bin(), oct(), repr(), ascii(), str(), chr(), str.ljust(), str.rjust(), str.center(), str.zfill(). ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 10 13:31:34 2016 From: report at bugs.python.org (Erwin Mayer) Date: Thu, 10 Mar 2016 18:31:34 +0000 Subject: [issue26520] asyncio.new_event_loop() hangs In-Reply-To: <1457540530.17.0.125897820678.issue26520@psf.upfronthosting.co.za> Message-ID: <1457634694.42.0.809041251755.issue26520@psf.upfronthosting.co.za> Erwin Mayer added the comment: Thank you Guido; I am now trying to always close a loop explicitly and see if it fixes the issue (so far so good in the last 24h). I could not locate this requirement in the EventLoop documentation page (https://docs.python.org/3/library/asyncio-eventloop.html), however it was indeed mentioned in the "Develop with asyncio" documentation page (https://docs.python.org/3/library/asyncio-dev.html#asyncio-close-transports), saying that otherwise a Resource warning would be emitted (if debug mode was turned on). It could be beneficial to remind the need to close the loop explicitly in the EventLoop page as well. I saw a lot of people posting code snippets not doing it. I'll check how I can submit a patch for that. I agree with your comments on the reproductibility of my issue, I was hoping the stack trace could be enough to pinpoint reasons of why a socket creation could be hanging (and maybe diagnose a bug). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 10 14:05:00 2016 From: report at bugs.python.org (Joshua Cannell) Date: Thu, 10 Mar 2016 19:05:00 +0000 Subject: [issue26531] KeyboardInterrupt while in input() not catchable on Windows 10 In-Reply-To: <1457626725.91.0.992328225706.issue26531@psf.upfronthosting.co.za> Message-ID: <1457636700.13.0.451407439754.issue26531@psf.upfronthosting.co.za> Joshua Cannell added the comment: I can post a script if necessary, but it looks like Zach has already done so. I appreciate you verifying this. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 10 15:02:45 2016 From: report at bugs.python.org (shakur shams Mullick) Date: Thu, 10 Mar 2016 20:02:45 +0000 Subject: [issue26532] build fails with address sanitizer Message-ID: <1457640165.38.0.124294976796.issue26532@psf.upfronthosting.co.za> New submission from shakur shams Mullick: After configuring with address sanitizer like this: $ ./configure --with-address-sanitizer --disable-ipv6 build fails when: $make gcc -pthread -c -fsanitize=address -fno-omit-frame-pointer -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -Werror=declaration-after-statement -I. -IInclude -I./Include -DPy_BUILD_CORE -o Objects/obmalloc.o Objects/obmalloc.c In file included from /usr/include/features.h:364:0, from /usr/include/limits.h:25, from /usr/lib/gcc/x86_64-linux-gnu/5/include-fixed/limits.h:168, from /usr/lib/gcc/x86_64-linux-gnu/5/include-fixed/syslimits.h:7, from /usr/lib/gcc/x86_64-linux-gnu/5/include-fixed/limits.h:34, from Include/Python.h:11, from Objects/obmalloc.c:1: Objects/obmalloc.c: In function ?_PyObject_Realloc?: /usr/include/x86_64-linux-gnu/bits/string3.h:50:1: error: inlining failed in call to always_inline ?memcpy?: function attribute mismatch __NTH (memcpy (void *__restrict __dest, const void *__restrict __src, ^ Objects/obmalloc.c:1668:13: error: called from here memcpy(bp, p, size); ^ Makefile:1538: recipe for target 'Objects/obmalloc.o' failed make: *** [Objects/obmalloc.o] Error 1 ---------- components: Build messages: 261521 nosy: shakur shams Mullick priority: normal severity: normal status: open title: build fails with address sanitizer type: compile error versions: Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 10 15:16:20 2016 From: report at bugs.python.org (SilentGhost) Date: Thu, 10 Mar 2016 20:16:20 +0000 Subject: [issue26532] build fails with address sanitizer In-Reply-To: <1457640165.38.0.124294976796.issue26532@psf.upfronthosting.co.za> Message-ID: <1457640980.19.0.596681821576.issue26532@psf.upfronthosting.co.za> Changes by SilentGhost : ---------- nosy: +benjamin.peterson, haypo, serhiy.storchaka versions: +Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 10 15:21:51 2016 From: report at bugs.python.org (=?utf-8?b?0JDQvdC00YDQtdC5INCR0LDQutGB0LDQu9GP0YA=?=) Date: Thu, 10 Mar 2016 20:21:51 +0000 Subject: [issue12736] Request for python casemapping functions to use full not simple casemaps per Unicode's recommendation In-Reply-To: <1313098784.96.0.996919907442.issue12736@psf.upfronthosting.co.za> Message-ID: <1457641311.63.0.719858067696.issue12736@psf.upfronthosting.co.za> ?????? ???????? added the comment: Interestingly, the bug is still reproducible in version 3.5.1, but fixed in 2.7.6. ---------- versions: +Python 2.7 -Python 3.4 Added file: http://bugs.python.org/file42121/pythonbug.png _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 10 15:42:37 2016 From: report at bugs.python.org (SilentGhost) Date: Thu, 10 Mar 2016 20:42:37 +0000 Subject: [issue12736] Request for python casemapping functions to use full not simple casemaps per Unicode's recommendation In-Reply-To: <1313098784.96.0.996919907442.issue12736@psf.upfronthosting.co.za> Message-ID: <1457642557.5.0.762607517778.issue12736@psf.upfronthosting.co.za> Changes by SilentGhost : ---------- versions: +Python 3.4, Python 3.5, Python 3.6 -Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 10 15:44:03 2016 From: report at bugs.python.org (Guido van Rossum) Date: Thu, 10 Mar 2016 20:44:03 +0000 Subject: [issue12736] Request for python casemapping functions to use full not simple casemaps per Unicode's recommendation In-Reply-To: <1313098784.96.0.996919907442.issue12736@psf.upfronthosting.co.za> Message-ID: <1457642643.04.0.268461281562.issue12736@psf.upfronthosting.co.za> Changes by Guido van Rossum : ---------- nosy: -gvanrossum _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 10 16:12:12 2016 From: report at bugs.python.org (Martin Panter) Date: Thu, 10 Mar 2016 21:12:12 +0000 Subject: [issue26531] KeyboardInterrupt while in input() not catchable on Windows 10 In-Reply-To: <1457626725.91.0.992328225706.issue26531@psf.upfronthosting.co.za> Message-ID: <1457644332.8.0.685101549121.issue26531@psf.upfronthosting.co.za> Martin Panter added the comment: It sounds like you guys might be (re-)discovering existing bugs to do with KeyboardInterrupt in input on Windows: * Issue 18597 (Py 2 & 3): Strange exception handling reading stdin * Issue 10837 (2.7): KeyboardInterrupt deferred reading stdin * Issue 25376 (Py 3): Truncated traceback from input() * Issue 13673 (Py 2 & 3): General traceback truncated if interrupted ---------- nosy: +martin.panter _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 10 16:39:06 2016 From: report at bugs.python.org (Martin Panter) Date: Thu, 10 Mar 2016 21:39:06 +0000 Subject: [issue26528] NameError for built in function open when re-raising stored exception from yielded function In-Reply-To: <1457611797.69.0.202848672993.issue26528@psf.upfronthosting.co.za> Message-ID: <1457645946.66.0.758708730132.issue26528@psf.upfronthosting.co.za> Martin Panter added the comment: Actually I was a bit hasty in my response last night. NameError indicates that the ?open? symbol has been deleted, not just set to None. If you add print(sorted(builtins.__dict__.keys())) inside __exit__() you can verify this is the case. This contradicts my understanding of the finalization process (symbols being deleted rather than being set to None). Maybe the documentation needs fixing? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 10 16:45:02 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 10 Mar 2016 21:45:02 +0000 Subject: [issue26532] build fails with address sanitizer In-Reply-To: <1457640165.38.0.124294976796.issue26532@psf.upfronthosting.co.za> Message-ID: <1457646302.37.0.386910422511.issue26532@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: This is a gcc issue: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65873 . ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 10 17:13:04 2016 From: report at bugs.python.org (Eric Snow) Date: Thu, 10 Mar 2016 22:13:04 +0000 Subject: [issue26495] super() does not work in nested functions, genexps, listcomps, and gives misleading exceptions In-Reply-To: <1457290040.33.0.0538313246288.issue26495@psf.upfronthosting.co.za> Message-ID: <1457647984.66.0.0187426543711.issue26495@psf.upfronthosting.co.za> Changes by Eric Snow : ---------- nosy: +benjamin.peterson, rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 10 17:28:46 2016 From: report at bugs.python.org (Grazfather x) Date: Thu, 10 Mar 2016 22:28:46 +0000 Subject: [issue26533] logging.config does not allow disable_existing_loggers=True Message-ID: <1457648926.18.0.758256853063.issue26533@psf.upfronthosting.co.za> New submission from Grazfather x: logging.config.FileConfig has a kwarg 'disable_existing_loggers' that defaults to False, but when true will allow you to load a config and not disable all other existing loggers. logging.config.listen uses FileConfig, but has no option to provide this keyword to it, which is a problem when a logger hierarchy is build using logger.getLogger(__name__) (which is recommended in the documentation). Proposal: Add kwarg 'disable_existing_loggers' to logging.config.listen which is passed to fileConfig. ---------- components: Library (Lib) messages: 261526 nosy: Grazfather x priority: normal severity: normal status: open title: logging.config does not allow disable_existing_loggers=True 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 Thu Mar 10 17:36:31 2016 From: report at bugs.python.org (Alexander Belopolsky) Date: Thu, 10 Mar 2016 22:36:31 +0000 Subject: [issue26525] Documentation of ord(c) easy to misread In-Reply-To: <1457599892.41.0.987128084347.issue26525@psf.upfronthosting.co.za> Message-ID: <1457649391.63.0.0828580747081.issue26525@psf.upfronthosting.co.za> Alexander Belopolsky added the comment: Wouldn't '\N{SNAKE}' look more pythonic? ? >>> hex(ord('?')) '0x1f40d' ---------- nosy: +belopolsky _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 10 17:42:17 2016 From: report at bugs.python.org (Terry J. Reedy) Date: Thu, 10 Mar 2016 22:42:17 +0000 Subject: [issue23220] Documents input/output effects of how IDLE runs user code In-Reply-To: <1420937687.17.0.885670059147.issue23220@psf.upfronthosting.co.za> Message-ID: <1457649737.5.0.208389225798.issue23220@psf.upfronthosting.co.za> Terry J. Reedy added the comment: Different \r behavior is the gist of https://stackoverflow.com/questions/35895864/what-is-the-difference-between-cmd-and-idle-when-using-tqdm. The new section should have more on the different effect of control characters on different display devices and windows. It should also better differentiate between Python result, which is the string written to stdout, and which is nearly always the same in IDLE and console, and visual display result, which is outside of Python's control. This separation is the point of Serhiy's msg246602. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 10 18:24:04 2016 From: report at bugs.python.org (Terry J. Reedy) Date: Thu, 10 Mar 2016 23:24:04 +0000 Subject: [issue23220] Documents input/output effects of how IDLE runs user code In-Reply-To: <1420937687.17.0.885670059147.issue23220@psf.upfronthosting.co.za> Message-ID: <1457652244.66.0.245861214212.issue23220@psf.upfronthosting.co.za> Terry J. Reedy added the comment: Part of this issue is the difference between typing a character at the keyboard, which produces a key event whose effect is determined by key bindings (some default, some added) and inserting a character into a Text widget, which does not produce an event (except, in some sense, \t and \n). Whether or not a key event results in character insertion depends on key bindings. The visual effect of inserted chars other than \t and \n is determined by the font. (I believe I got the above right.) I believe some terminals treat chars coming over the wire the same as those typed. I am not sure what the Win10 console is doing with control-x keystrokes. >>> import sys; out=sys.stdout.write # use direct write to avoid str(), repr() conversion of control chars >>> out('\x03') 1 # The first char is an empty thin box in my IDLE. >>> # type ^C KeyboardInterrupt ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 10 18:32:02 2016 From: report at bugs.python.org (Ethan Furman) Date: Thu, 10 Mar 2016 23:32:02 +0000 Subject: [issue26521] add `extend_enum` to Enum In-Reply-To: <1457549856.93.0.164722622997.issue26521@psf.upfronthosting.co.za> Message-ID: <1457652722.86.0.189458053344.issue26521@psf.upfronthosting.co.za> Ethan Furman added the comment: Barry: po-tay-to / po-tah-to ;) Serhiy: The set is known and finite, just scattered over different expensive-to-load modules. Decision: Since no one is jumping up and down with anticipation over this feature, I'll let it stay on SO. ---------- resolution: -> rejected stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 10 18:32:38 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 10 Mar 2016 23:32:38 +0000 Subject: [issue23220] Documents input/output effects of how IDLE runs user code In-Reply-To: <1420937687.17.0.885670059147.issue23220@psf.upfronthosting.co.za> Message-ID: <1457652758.45.0.16405205247.issue23220@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: As for StackOverflow question, there is tkinter.ttk.Progressbar. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 10 18:37:38 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 10 Mar 2016 23:37:38 +0000 Subject: [issue26525] Documentation of ord(c) easy to misread In-Reply-To: <1457599892.41.0.987128084347.issue26525@psf.upfronthosting.co.za> Message-ID: <1457653058.52.0.311907505619.issue26525@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: '?' is astral character and not all systems have fonts that support it installed by default. It can be hard to render it in TeX. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 10 18:45:31 2016 From: report at bugs.python.org (Daniel Shaulov) Date: Thu, 10 Mar 2016 23:45:31 +0000 Subject: [issue26534] subprocess.check_output with shell=True ignores the timeout Message-ID: <1457653531.44.0.556796452495.issue26534@psf.upfronthosting.co.za> New submission from Daniel Shaulov: Basically - subprocess.check_output("ping localhost", shell=True, timeout=5) Will hang forever. What happens is that subprocess.run times out on communicate, sends SIGKILL *to the shell* and then calls communicate again without the timeout. But nothing actually closes the "ping" command so the second communicate will never exit. Even if we put a timeout on the second communicate, it won't be good enough because that "ping" will still be "leaked". This SO question is about the fact that kill doesn't work when shell=True, and might be relevant for this issue: http://stackoverflow.com/questions/4789837/how-to-terminate-a-python-subprocess-launched-with-shell-true As a possible fix I propose doing the following: 1. Add killpg to the Popen class. 2. Add an argument to run - "kill_group" that makes run use killpg instead of kill 3. Users can all: subprocess.check_output("ping localhost", shell=True, start_new_session=True, kill_group=True, timeout=5) And have it work fine. This is the best I could come up with, without breaking any existing behavior. Other options to consider: 1. Not have kill_group argument and to implicitly kill by group when start_new_session is True (but this is not really backwards compatible). 2. Having kill_group as an argument for Popen and not run, and when kill is called, it will call killpg if the option was specified. A patch is attached with my proposed solution. ---------- components: Library (Lib) files: killpg.patch keywords: patch messages: 261533 nosy: Daniel Shaulov, astrand priority: normal severity: normal status: open title: subprocess.check_output with shell=True ignores the timeout type: behavior versions: Python 3.5, Python 3.6 Added file: http://bugs.python.org/file42122/killpg.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 10 18:51:23 2016 From: report at bugs.python.org (Martin Panter) Date: Thu, 10 Mar 2016 23:51:23 +0000 Subject: [issue17603] AC_LIBOBJ replacement of fileblocks In-Reply-To: <1364760819.41.0.900154328327.issue17603@psf.upfronthosting.co.za> Message-ID: <1457653883.47.0.636730701052.issue17603@psf.upfronthosting.co.za> Martin Panter added the comment: IMO this is a fault of the autowhatever configuration stuff, not just an enhancement. If configure.ac determines that there is no st_blocks field, it tries to link against a non-existant fileblocks.o file: ./mingw/Makefile:220:LIBOBJS= ${LIBOBJDIR}fileblocks$U.o i486-mingw32-gcc: error: Python/fileblocks.o: No such file or directory I am not really an autoconf or whatever expert, but it seems if you use a lower-level bit of configure.ac code it avoids the problem; see avoid-fileblocks.patch. ---------- components: -Cross-Build nosy: +martin.panter type: enhancement -> compile error Added file: http://bugs.python.org/file42123/avoid-fileblocks.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 10 19:01:03 2016 From: report at bugs.python.org (paul j3) Date: Fri, 11 Mar 2016 00:01:03 +0000 Subject: [issue26510] [argparse] Add required argument to add_subparsers In-Reply-To: <1457445361.5.0.530669445668.issue26510@psf.upfronthosting.co.za> Message-ID: <1457654463.33.0.304362051721.issue26510@psf.upfronthosting.co.za> paul j3 added the comment: This has been raised before. I think http://bugs.python.org/issue9253 is the correct issue. It used to be that 'subparsers' were required. But there was a change in how 'required' arguments were tested, and 'subparsers' fell through the cracks. Now subparsers are optional (at least the parser doesn't raise an error). The temporary fix is to set the 'required' attribute after creation. I proposed that the default be 'required=True', and that we be allowed to set the parameter. But that patch, like many others, has languished. ---------- nosy: +paul.j3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 10 19:27:16 2016 From: report at bugs.python.org (paul j3) Date: Fri, 11 Mar 2016 00:27:16 +0000 Subject: [issue26503] argparse with required field , not having new line separator in -help dispaly In-Reply-To: <1457353096.4.0.167120061283.issue26503@psf.upfronthosting.co.za> Message-ID: <1457656036.14.0.750910917575.issue26503@psf.upfronthosting.co.za> paul j3 added the comment: The usage line formatter needs a major rewrite. Currently it formats usage for all the arguments as one line (two actually, optionals and positionals are handled separately), and then breaks it into 'wrappable parts'. It then compiles the lines from these parts # break usage into wrappable parts part_regexp = r'\(.*?\)+|\[.*?\]+|\S+' So it's keeping things enclosed in brackets together, but allowing the 'required' arguments to be split. Certain characters like [] in the metavars also break this usage. http://bugs.python.org/issue11874 has a patch with a usage rewrite hopefully will take care of this problem. It collects the formatted arguments in a list rather than a concatenated string, so there's no need for this buggy splitter. ---------- nosy: +paul.j3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 10 19:33:16 2016 From: report at bugs.python.org (Ned Deily) Date: Fri, 11 Mar 2016 00:33:16 +0000 Subject: [issue26533] logging.config does not allow disable_existing_loggers=True In-Reply-To: <1457648926.18.0.758256853063.issue26533@psf.upfronthosting.co.za> Message-ID: <1457656396.16.0.185869467772.issue26533@psf.upfronthosting.co.za> Changes by Ned Deily : ---------- nosy: +vinay.sajip _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 10 19:33:25 2016 From: report at bugs.python.org (paul j3) Date: Fri, 11 Mar 2016 00:33:25 +0000 Subject: [issue26394] Have argparse provide ability to require a fallback value be present In-Reply-To: <1455985031.95.0.488150837583.issue26394@psf.upfronthosting.co.za> Message-ID: <1457656405.2.0.654969150174.issue26394@psf.upfronthosting.co.za> Changes by paul j3 : ---------- nosy: +paul.j3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 10 20:25:28 2016 From: report at bugs.python.org (paul j3) Date: Fri, 11 Mar 2016 01:25:28 +0000 Subject: [issue26394] Have argparse provide ability to require a fallback value be present In-Reply-To: <1455985031.95.0.488150837583.issue26394@psf.upfronthosting.co.za> Message-ID: <1457659528.91.0.943311417401.issue26394@psf.upfronthosting.co.za> paul j3 added the comment: I need to study that patch more, but I don't like the fact that it operates at the core of the parsing (e.g. in 'take_action'). That's a dangerous place to add features. Unexpected behaviors and backwards compatibility problems are too likely. It would be better if the enhancement could be made to things that are already being subclassed, like Actions. But I'll have to think more about alternatives. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 10 21:45:19 2016 From: report at bugs.python.org (Antony Lee) Date: Fri, 11 Mar 2016 02:45:19 +0000 Subject: [issue26535] Minor typo in the docs for struct.unpack Message-ID: <1457664319.61.0.475981364973.issue26535@psf.upfronthosting.co.za> New submission from Antony Lee: The docstring of struct.unpack currently reads Unpack from the buffer buffer (presumably packed by pack(fmt, ...)) according to the format string fmt. The result is a tuple even if it contains exactly one item. The buffer must contain exactly the amount of data required by the format (len(bytes) must equal calcsize(fmt)). It should probably read "len(buffer) must equal calcsize(fmt)". ---------- assignee: docs at python components: Documentation messages: 261538 nosy: Antony.Lee, docs at python priority: normal severity: normal status: open title: Minor typo in the docs for struct.unpack versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 10 22:15:28 2016 From: report at bugs.python.org (Daniel Stokes) Date: Fri, 11 Mar 2016 03:15:28 +0000 Subject: [issue26536] Add the SIO_LOOPBACK_FAST_PATH option to socket.ioctl Message-ID: <1457666128.63.0.278319184112.issue26536@psf.upfronthosting.co.za> New submission from Daniel Stokes: Adding the SIO_LOOPBACK_FAST_PATH option to socket.ioctl on Windows allows Windows users to enable the loopback fast path option available on Windows 8+. This allows for much better TCP loopback performance on Windows. For more information on TCP Loopback Fast Path, see: * https://msdn.microsoft.com/en-us/library/windows/desktop/jj841212%28v=vs.85%29.aspx * http://blogs.technet.com/b/wincat/archive/2012/12/05/fast-tcp-loopback-performance-and-low-latency-with-windows-server-2012-tcp-loopback-fast-path.aspx ---------- components: IO files: loopback_fast_path.patch keywords: patch messages: 261539 nosy: Daniel Stokes priority: normal severity: normal status: open title: Add the SIO_LOOPBACK_FAST_PATH option to socket.ioctl type: enhancement versions: Python 3.6 Added file: http://bugs.python.org/file42124/loopback_fast_path.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 10 23:00:44 2016 From: report at bugs.python.org (paul j3) Date: Fri, 11 Mar 2016 04:00:44 +0000 Subject: [issue26394] Have argparse provide ability to require a fallback value be present In-Reply-To: <1455985031.95.0.488150837583.issue26394@psf.upfronthosting.co.za> Message-ID: <1457668844.47.0.267979899923.issue26394@psf.upfronthosting.co.za> paul j3 added the comment: Let's see if I understand the proposed patch Each call to 'take_action' is replaced with a save to a 'action_with_values' dictionary For a flagged (optional) it saves the 'args' and 'option_string'; for positionals it save 'args': - take_action(action, args, option_string) + action_with_values(action)['argument_strings'] = args + action_with_values(action)['option_string'] = option_string Then at the end of the 'consume_optional' and 'consume_positionals' loops, it processes all the deferred 'take_actions' + for action, kwargs in actions_with_values.items(): + take_action(action, **kwargs) It had previously looped through 'parser._actions' and created an entries in 'actions_with_values' with actions and 'fallback_strings' key. In 'take_action', if the action's 'argument_strings' key (in actions_with_values) is None, it uses the 'fallback_strings' instead. ------------------ Has this patch been tested? That is, does it pass all the tests in 'test_argparse.py'? One potential failing is that the order in which 'take_action' occurs can change. In the original, the order of 'take_action' depends on the order of occurrence in the sys.argv list. With this change, the order depends on the hashing order in 'actions_with_values'. In many cases that order does not matter. But there's nothing, in the current code, to prevent order dependence. Even if the user does not define custom Actions, actions like 'append' are execution order dependent. And optionals may occur several times, e.g python prog.py -f one --foo two -f three the namespace could have (foo='three') or (foo=['one','two','three']) depending the Action class. And different arguments can save to the same 'dest'. Deferring 'take_action' like this is too fraught with backward compatibility issues to consider seriously. Parsing is complex enough as it is, without adding the uncertainty of this differed 'take_action'. Other qualms: - On the surface the process of collecting 'fallback_strings' appears to handle the number of arguments correctly (with '_match_argument); but I have feeling it could be buggy. - What if the 'fallback' wants to provide values and objects instead of strings? That's a tricky enough issue when working with the defaults. The example.py had to handle 'false' in a special way. The 'store_const' actions (including 'store_true' and 'store_false') will need special testing. - how will these changes behave with subparsers? That is a big unknown. -------------- An alternative place to apply this kind of 'fallback' is at the end of '_parse_known_args'. At this point the parser has access to 'see_actions' and 'seen_non_default_actions' lists (or sets). It uses those to test for 'required_actions' and required mutually_exclusive_groups. In http://bugs.python.org/issue11588 (Add "necessarily inclusive" groups to argparse) I propose adding a 'hook' at this point that can be used apply more general group tests (not just the current xor, but all the other logical possibilities). This hook could look at which actions were seen (i.e. acted on by take_action), and raise errors if the wrong combination was seen or not seen. The idea is that access to 'see_actions' is more definitive than checking the namespace of 'is None' values. I can imagine a fallback operating as part of this hook, filling in value for required actions that were not seen. This is similar to looking at and modifying the args namespace after parsing, except that it has access to the 'seen_actions' set. By acting at this point, the fallback is not constrained by the action's __call__ or any of its parameters (nargs, type, etc). There are pros and cons to that. ----------------------- I've mentioned else where (including SO questions) that 'ipython' uses argparse along with config. It does so by first reading config, and then populating the parser with arguments derived from the config. That way the user has several ways of setting values - the default config, profile configs, and the commandline. In practice most values come from config, and only a select few get changed via commandline. argparse already as a poor-man's config file mechanism, the 'fromfile_prefix_chars'. This reads strings from a file and splices them into the 'argv' list. if self.fromfile_prefix_chars is not None: arg_strings = self._read_args_from_files(arg_strings) It's not as powerful as config or reading the environment, but it still provides a way of adding strings to those already given in the commandline. In short, I think it best to exhaustively look at alternatives that don't require surgery to the heart of parse_args. A feature like this can only be added if it has absolutely zero chance of modifying the behavior of anyone else's parser. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 10 23:26:54 2016 From: report at bugs.python.org (paul j3) Date: Fri, 11 Mar 2016 04:26:54 +0000 Subject: [issue26394] Have argparse provide ability to require a fallback value be present In-Reply-To: <1455985031.95.0.488150837583.issue26394@psf.upfronthosting.co.za> Message-ID: <1457670414.91.0.41070145465.issue26394@psf.upfronthosting.co.za> paul j3 added the comment: http://stackoverflow.com/a/35144270/901925 dynamically-set-default-value-from-cfg-file-through-argparse-python is my answer to a similar recent (Feb 2015) SO question. I rather like the idea of using collections.ChainMap on the dictionary versions of the namespace and config data. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 01:38:43 2016 From: report at bugs.python.org (STINNER Victor) Date: Fri, 11 Mar 2016 06:38:43 +0000 Subject: [issue26506] hex() documentation: mention "%x" % int In-Reply-To: <1457632055.73.0.226285535114.issue26506@psf.upfronthosting.co.za> Message-ID: STINNER Victor added the comment: Serhiy Storchaka added the comment: > If document alternatives for hex(), we should also document formatting alternatives for bin(), oct(), Ok for these two since they also add a prefix. But I don't see the point of documenting alternatives for the other listed functions. The matter here is the 0x prefix. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 01:40:17 2016 From: report at bugs.python.org (Gereon Kaiping) Date: Fri, 11 Mar 2016 06:40:17 +0000 Subject: [issue26537] ConfigParser has optoinxform, but not sectionxform Message-ID: <1457678417.52.0.410667040467.issue26537@psf.upfronthosting.co.za> New submission from Gereon Kaiping: configparser.ConfigParser (resp. ConfigParser.RawConfigParser for python2) has a optionxform function which converts the option names in a section to lower case by default. A similar function for section titles would be expected (cf. https://github.com/lmaurits/BEASTling/issues/46#issuecomment-195131900), but it does not exist. If ConfigParser called such a function (reasonably named sectionxform), which would default to None (or the identity function) for backward compatibility, that would be nice and consistent. ---------- components: Library (Lib) messages: 261543 nosy: Anaphory priority: normal severity: normal status: open title: ConfigParser has optoinxform, but not sectionxform versions: Python 2.7, Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 01:47:21 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 11 Mar 2016 06:47:21 +0000 Subject: [issue26537] ConfigParser has optionxform, but not sectionxform In-Reply-To: <1457678417.52.0.410667040467.issue26537@psf.upfronthosting.co.za> Message-ID: <1457678841.14.0.241295595875.issue26537@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- title: ConfigParser has optoinxform, but not sectionxform -> ConfigParser has optionxform, but not sectionxform type: -> enhancement versions: -Python 2.7, Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 01:47:37 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 11 Mar 2016 06:47:37 +0000 Subject: [issue26537] ConfigParser has optionxform, but not sectionxform In-Reply-To: <1457678417.52.0.410667040467.issue26537@psf.upfronthosting.co.za> Message-ID: <1457678857.91.0.809481283504.issue26537@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 01:56:51 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 11 Mar 2016 06:56:51 +0000 Subject: [issue26506] hex() documentation: mention "%x" % int In-Reply-To: <1457372823.56.0.270827849914.issue26506@psf.upfronthosting.co.za> Message-ID: <1457679411.47.0.761641049964.issue26506@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: There is no harm if use hex(value)[2:]. It's a matter of taste. We can mention "%x" % value for the case if the user just doesn't know about this alternative. The same is for value.ljust(5) and '%-5s' % value. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 02:04:06 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 11 Mar 2016 07:04:06 +0000 Subject: [issue26535] Minor typo in the docs for struct.unpack In-Reply-To: <1457664319.61.0.475981364973.issue26535@psf.upfronthosting.co.za> Message-ID: <1457679846.36.0.0836503311045.issue26535@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: I would remove "len(bytes) must equal " at all. len() can return a value not equal to the number of bytes contained in the buffer (e.g. for array('I')). ---------- nosy: +martin.panter, serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 02:04:35 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 11 Mar 2016 07:04:35 +0000 Subject: [issue26535] Minor typo in the docs for struct.unpack In-Reply-To: <1457664319.61.0.475981364973.issue26535@psf.upfronthosting.co.za> Message-ID: <1457679875.49.0.2304291418.issue26535@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- nosy: +mark.dickinson, meador.inge _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 02:36:31 2016 From: report at bugs.python.org (Antony Lee) Date: Fri, 11 Mar 2016 07:36:31 +0000 Subject: [issue26535] Minor typo in the docs for struct.unpack In-Reply-To: <1457664319.61.0.475981364973.issue26535@psf.upfronthosting.co.za> Message-ID: <1457681791.47.0.970476132517.issue26535@psf.upfronthosting.co.za> Antony Lee added the comment: I think mentioning calcsize is still helpful, so perhaps something like "The buffer must contain exactly as many bytes (I think this is clearer than "the amount of data") as required by the format (this number can be obtained as `struct.calcsize(fmt)`)"? (and likewise for "unpack_from" and "iter_unpack"). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 02:39:49 2016 From: report at bugs.python.org (Benjamin Peterson) Date: Fri, 11 Mar 2016 07:39:49 +0000 Subject: [issue12736] Request for python casemapping functions to use full not simple casemaps per Unicode's recommendation In-Reply-To: <1313098784.96.0.996919907442.issue12736@psf.upfronthosting.co.za> Message-ID: <1457681989.44.0.262717615816.issue12736@psf.upfronthosting.co.za> Benjamin Peterson added the comment: The full case mappings do not preserve normalization form. >>> for c in '?'.upper().lower(): print(unicodedata.name(c)) ... GREEK SMALL LETTER UPSILON COMBINING DIAERESIS COMBINING ACUTE ACCENT >>> unicodedata.normalize('NFC', '?'.upper().lower()) == '?' True ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 02:59:07 2016 From: report at bugs.python.org (Georg Brandl) Date: Fri, 11 Mar 2016 07:59:07 +0000 Subject: [issue26535] Minor typo in the docs for struct.unpack In-Reply-To: <1457664319.61.0.475981364973.issue26535@psf.upfronthosting.co.za> Message-ID: <1457683147.59.0.378083196655.issue26535@psf.upfronthosting.co.za> Georg Brandl added the comment: That sounds good to me. Maybe without so many parentheses :) ---------- nosy: +georg.brandl _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 03:01:07 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 11 Mar 2016 08:01:07 +0000 Subject: [issue26535] Minor typo in the docs for struct.unpack In-Reply-To: <1457664319.61.0.475981364973.issue26535@psf.upfronthosting.co.za> Message-ID: <1457683267.42.0.955178943956.issue26535@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- stage: -> needs patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 03:37:32 2016 From: report at bugs.python.org (STINNER Victor) Date: Fri, 11 Mar 2016 08:37:32 +0000 Subject: [issue26506] hex() documentation: mention "%x" % int In-Reply-To: <1457372823.56.0.270827849914.issue26506@psf.upfronthosting.co.za> Message-ID: <1457685452.46.0.309954772623.issue26506@psf.upfronthosting.co.za> STINNER Victor added the comment: I opened the issue when I read this change: https://review.openstack.org/#/c/288224/2/neutron/common/utils.py rndstr = hex(...)[2:] # Whether there is a trailing 'L' is a py2/3 incompatibility rndstr = rndstr.rstrip('L') return rndstr.zfill(length) can be simply written return "{0:0{1}x}".format(..., length) It's less readable, but it's more efficient. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 03:44:46 2016 From: report at bugs.python.org (reidfaiv) Date: Fri, 11 Mar 2016 08:44:46 +0000 Subject: [issue26528] NameError for built in function open when re-raising stored exception from yielded function In-Reply-To: <1457611797.69.0.202848672993.issue26528@psf.upfronthosting.co.za> Message-ID: <1457685886.09.0.491177153947.issue26528@psf.upfronthosting.co.za> reidfaiv added the comment: def __exit__(self, type_, value, tb): print('__exit__') # print() is also built-in, but works print(sorted(builtins.__dict__.keys())) f = open('test.log', 'wt') # <-- NameError: name 'open' is not defined f.close() I will get following. Clearly "open" is missing: Traceback (most recent call last): File "gen_err.py", line 56, in run() File "gen_err.py", line 50, in run r() File "gen_err.py", line 36, in b raise ee # <-- re-raising stored exception triggers the issue File "gen_err.py", line 33, in b raise Exception('stored exception') Exception: stored exception __exit__ ['ArithmeticError', 'AssertionError', 'AttributeError', 'BaseException', 'BlockingIOError', 'BrokenPipeError', 'BufferError', 'BytesWarning', 'ChildProcessError', 'ConnectionAbortedError', 'ConnectionError', 'ConnectionRefusedError', 'ConnectionResetError', 'DeprecationWarning', 'EOFError', 'Ellipsis', 'EnvironmentError', 'Exception', 'False', 'FileExistsError', 'FileNotFoundError', 'FloatingPointError', 'FutureWarning', 'GeneratorExit', 'IOError', 'ImportError', 'ImportWarning', 'IndentationError', 'IndexError', 'InterruptedError', 'IsADirectoryError', 'KeyError', 'KeyboardInterrupt', 'LookupError', 'MemoryError', 'NameError', 'None', 'NotADirectoryError', 'NotImplemented', 'NotImplementedError', 'OSError', 'OverflowError', 'PendingDeprecationWarning', 'PermissionError', 'ProcessLookupError', 'RecursionError', 'ReferenceError', 'ResourceWarning', 'RuntimeError', 'RuntimeWarning', 'StopAsyncIteration', 'StopIteration', 'SyntaxError', 'SyntaxWarning', 'SystemError', 'SystemExit', 'TabError', 'TimeoutError', 'True', 'TypeError', 'UnboundLocalError', 'UnicodeDecodeError', 'UnicodeEncodeError', 'UnicodeError', 'UnicodeTranslateError', 'UnicodeWarning', 'UserWarning', 'ValueError', 'Warning', 'WindowsError', 'ZeroDivisionError', '__build_class__', '__debug__', '__doc__', '__import__', '__loader__', '__name__', '__package__', '__spec__', 'abs', 'all', 'any', 'ascii', 'bin', 'bool', 'bytearray', 'bytes', 'callable', 'chr', 'classmethod', 'compile', 'complex', 'delattr', 'dict', 'dir', 'divmod', 'enumerate', 'eval', 'exec', 'filter', 'float', 'format', 'frozenset', 'getattr', 'globals', 'hasattr', 'hash', 'hex', 'id', 'input', 'int', 'isinstance', 'issubclass', 'iter', 'len', 'list', 'locals', 'map', 'max', 'memoryview', 'min', 'next', 'object', 'oct', 'ord', 'pow', 'print', 'property', 'range', 'repr', 'reversed', 'round', 'set', 'setattr', 'slice', 'sorted', 'staticmethod', 'str', 'sum', 'super', 'tuple', 'type', 'vars', 'zip'] Exception ignored in: Traceback (most recent call last): File "gen_err.py", line 42, in event_gen File "gen_err.py", line 18, in __exit__ NameError: name 'open' is not defined ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 03:51:36 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 11 Mar 2016 08:51:36 +0000 Subject: [issue26506] hex() documentation: mention "%x" % int In-Reply-To: <1457372823.56.0.270827849914.issue26506@psf.upfronthosting.co.za> Message-ID: <1457686296.97.0.907974070086.issue26506@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: I agree with you and always prefer formatting strings. Your example shows that at least an alternative to str.zfill() should be mentioned in the educational purposes. With C-style formatting your example can be written more laconically: return "%0*x" % (length, ...) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 04:23:29 2016 From: report at bugs.python.org (Chi Hsuan Yen) Date: Fri, 11 Mar 2016 09:23:29 +0000 Subject: [issue26313] ssl.py _load_windows_store_certs fails if windows cert store is empty In-Reply-To: <1454962188.81.0.985392423363.issue26313@psf.upfronthosting.co.za> Message-ID: <1457688209.76.0.597840791678.issue26313@psf.upfronthosting.co.za> Chi Hsuan Yen added the comment: The same issue is reported at https://github.com/rg3/youtube-dl/issues/8132, too. Empty Windows cert store is uncommon. The only case I found so far is on Wine. Steps to reproduce: 1. On Arch Linux x86_64, install mingw-w64-python2-bin from AUR 2. Run the following command: $ WINEDEBUG=fixme-all PYTHONPATH=/usr/x86_64-w64-mingw32/lib/python27 wine /usr/x86_64-w64-mingw32/bin/python2.exe -c 'import ssl; ssl.create_default_context()' Traceback (most recent call last): File "", line 1, in File "Z:\usr\x86_64-w64-mingw32\lib\python27\ssl.py", line 440, in create_default_context context.load_default_certs(purpose) File "Z:\usr\x86_64-w64-mingw32\lib\python27\ssl.py", line 391, in load_default_certs self._load_windows_store_certs(storename, purpose) File "Z:\usr\x86_64-w64-mingw32\lib\python27\ssl.py", line 383, in _load_windows_store_certs self.load_verify_locations(cadata=certs) ValueError: Empty certificate data ---------- nosy: +Chi Hsuan Yen _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 05:11:48 2016 From: report at bugs.python.org (baji) Date: Fri, 11 Mar 2016 10:11:48 +0000 Subject: [issue26535] Minor typo in the docs for struct.unpack In-Reply-To: <1457664319.61.0.475981364973.issue26535@psf.upfronthosting.co.za> Message-ID: <1457691108.04.0.15619058637.issue26535@psf.upfronthosting.co.za> baji added the comment: Modified as suggested in the comments ---------- keywords: +patch nosy: +baji Added file: http://bugs.python.org/file42125/issue26535.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 05:13:29 2016 From: report at bugs.python.org (Manvi B) Date: Fri, 11 Mar 2016 10:13:29 +0000 Subject: [issue26247] Document Chrome/Chromium for python2.7 In-Reply-To: <1454250201.34.0.379638558981.issue26247@psf.upfronthosting.co.za> Message-ID: <1457691209.71.0.280803916537.issue26247@psf.upfronthosting.co.za> Manvi B added the comment: Made changes according to last comment by Ezio. ---------- Added file: http://bugs.python.org/file42126/issue26247.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 05:18:30 2016 From: report at bugs.python.org (Baji) Date: Fri, 11 Mar 2016 10:18:30 +0000 Subject: [issue26313] ssl.py _load_windows_store_certs fails if windows cert store is empty In-Reply-To: <1454962188.81.0.985392423363.issue26313@psf.upfronthosting.co.za> Message-ID: <1457691510.54.0.421513492936.issue26313@psf.upfronthosting.co.za> Baji added the comment: Protected the certs with if statement ---------- keywords: +patch nosy: +baji Added file: http://bugs.python.org/file42127/issue26313.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 05:25:19 2016 From: report at bugs.python.org (STINNER Victor) Date: Fri, 11 Mar 2016 10:25:19 +0000 Subject: [issue26535] Minor typo in the docs for struct.unpack In-Reply-To: <1457664319.61.0.475981364973.issue26535@psf.upfronthosting.co.za> Message-ID: <1457691919.9.0.356188132034.issue26535@psf.upfronthosting.co.za> STINNER Victor added the comment: Issue title: "Minor typo in the docs for struct.unpack" I can say the same on issue26535.diff: there is a typo ;) ---------- nosy: +haypo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 05:25:41 2016 From: report at bugs.python.org (Anna Koroliuk) Date: Fri, 11 Mar 2016 10:25:41 +0000 Subject: [issue16851] Hint about correct ismethod and isfunction usage In-Reply-To: <1357231289.77.0.0608728593688.issue16851@psf.upfronthosting.co.za> Message-ID: <1457691941.64.0.27601447955.issue16851@psf.upfronthosting.co.za> Anna Koroliuk added the comment: This patch fixes Python 2.7. ---------- nosy: +Anna Koroliuk Added file: http://bugs.python.org/file42128/inspect2.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 05:28:21 2016 From: report at bugs.python.org (Roundup Robot) Date: Fri, 11 Mar 2016 10:28:21 +0000 Subject: [issue16851] Hint about correct ismethod and isfunction usage In-Reply-To: <1357231289.77.0.0608728593688.issue16851@psf.upfronthosting.co.za> Message-ID: <20160311102751.9519.71727@psf.io> Roundup Robot added the comment: New changeset 813a0e0934ce by Victor Stinner in branch '2.7': Fix inspect.ismethod() doc https://hg.python.org/cpython/rev/813a0e0934ce ---------- nosy: +python-dev resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 05:29:10 2016 From: report at bugs.python.org (Baji) Date: Fri, 11 Mar 2016 10:29:10 +0000 Subject: [issue26535] Minor typo in the docs for struct.unpack In-Reply-To: <1457664319.61.0.475981364973.issue26535@psf.upfronthosting.co.za> Message-ID: <1457692150.29.0.34028007688.issue26535@psf.upfronthosting.co.za> Changes by Baji : Added file: http://bugs.python.org/file42129/issue26535.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 05:29:24 2016 From: report at bugs.python.org (Baji) Date: Fri, 11 Mar 2016 10:29:24 +0000 Subject: [issue26535] Minor typo in the docs for struct.unpack In-Reply-To: <1457664319.61.0.475981364973.issue26535@psf.upfronthosting.co.za> Message-ID: <1457692164.46.0.0272771049402.issue26535@psf.upfronthosting.co.za> Changes by Baji : Removed file: http://bugs.python.org/file42125/issue26535.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 05:30:20 2016 From: report at bugs.python.org (STINNER Victor) Date: Fri, 11 Mar 2016 10:30:20 +0000 Subject: [issue16851] Hint about correct ismethod and isfunction usage In-Reply-To: <1357231289.77.0.0608728593688.issue16851@psf.upfronthosting.co.za> Message-ID: <1457692220.22.0.372650540906.issue16851@psf.upfronthosting.co.za> STINNER Victor added the comment: Thanks Anna, I pushed your doc fix. Can you please sign the Python Contributor Agreement? https://www.python.org/psf/contrib/ ---------- nosy: +haypo resolution: fixed -> stage: resolved -> patch review status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 05:32:00 2016 From: report at bugs.python.org (Roundup Robot) Date: Fri, 11 Mar 2016 10:32:00 +0000 Subject: [issue16851] Hint about correct ismethod and isfunction usage In-Reply-To: <1357231289.77.0.0608728593688.issue16851@psf.upfronthosting.co.za> Message-ID: <20160311102846.31083.62868@psf.io> Roundup Robot added the comment: New changeset a90b39aa6af4 by Victor Stinner in branch '2.7': Issue #16851: Add Anna Koroliuk to Misc/ACKS https://hg.python.org/cpython/rev/a90b39aa6af4 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 05:57:28 2016 From: report at bugs.python.org (Susan Sun) Date: Fri, 11 Mar 2016 10:57:28 +0000 Subject: [issue26525] Documentation of ord(c) easy to misread In-Reply-To: <1457599892.41.0.987128084347.issue26525@psf.upfronthosting.co.za> Message-ID: <1457693848.88.0.243974591859.issue26525@psf.upfronthosting.co.za> Susan Sun added the comment: This was changed in the following commit. changeset: 95165:f6c6304c8193 user: Benjamin Peterson date: Tue Mar 24 12:12:44 2015 -0400 summary: change ? to ? for obscure joke reasons https://twitter.com/ncoghlan_dev/status/579173053793353728 ---------- nosy: +Susan Sun, benjamin.peterson, ncoghlan _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 06:44:27 2016 From: report at bugs.python.org (STINNER Victor) Date: Fri, 11 Mar 2016 11:44:27 +0000 Subject: [issue26538] regrtest: setup_tests() must not replace module.__path__ (_NamespacePath) with a simple list // importlib & abspath Message-ID: <1457696667.94.0.108519122037.issue26538@psf.upfronthosting.co.za> New submission from STINNER Victor: Extract of test.libregrtest.setup_tests(): for module in sys.modules.values(): if hasattr(module, '__path__'): module.__path__ = [os.path.abspath(path) for path in module.__path__] if hasattr(module, '__file__'): module.__file__ = os.path.abspath(module.__file__) Because of this code, it's not possible to store test files outside Lib/test/. For the issue #26295 (test_regrtest), I would like to create a temporary directory and then a subdirectory test/ to create temporary test files. Attached patch adds _NamespacePath.__setitem__() method and modify setup_tests() to keep the _NamespacePath type of module.__path__. Maybe we should move this abspath() code somewhere in importlib. The site module already contains similar code, abs_paths() function: for m in set(sys.modules.values()): if (getattr(getattr(m, '__loader__', None), '__module__', None) not in ('_frozen_importlib', '_frozen_importlib_external')): continue # don't mess with a PEP 302-supplied __file__ try: m.__file__ = os.path.abspath(m.__file__) except (AttributeError, OSError): pass try: m.__cached__ = os.path.abspath(m.__cached__) except (AttributeError, OSError): pass Since this code looks to depend on the implementation of importlib (the __loader__ test), IMHO it makes sense to move the code directly somewhere in importlib. ---------- files: libregrtest_module_path.patch keywords: patch messages: 261562 nosy: brett.cannon, haypo priority: normal severity: normal status: open title: regrtest: setup_tests() must not replace module.__path__ (_NamespacePath) with a simple list // importlib & abspath versions: Python 3.6 Added file: http://bugs.python.org/file42130/libregrtest_module_path.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 06:55:23 2016 From: report at bugs.python.org (STINNER Victor) Date: Fri, 11 Mar 2016 11:55:23 +0000 Subject: [issue26295] Random failures when running test suite in parallel (-m test -j0) caused by test_regrtest In-Reply-To: <1454663707.24.0.201658170139.issue26295@psf.upfronthosting.co.za> Message-ID: <1457697323.31.0.80486370128.issue26295@psf.upfronthosting.co.za> STINNER Victor added the comment: Oh ok, I found a bug in the setup_tests() function of libregrtest: issue #26538. Attached patch fixes this issue, it requires the patch of the issue issue #26538. ---------- keywords: +patch Added file: http://bugs.python.org/file42131/test_regrtest_tmpdir.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 07:58:31 2016 From: report at bugs.python.org (Eryk Sun) Date: Fri, 11 Mar 2016 12:58:31 +0000 Subject: [issue18597] On Windows sys.stdin.readline() doesn't handle Ctrl-C properly In-Reply-To: <1375175592.24.0.539816782076.issue18597@psf.upfronthosting.co.za> Message-ID: <1457701111.8.0.559800828392.issue18597@psf.upfronthosting.co.za> Eryk Sun added the comment: This problem has come up in several issues now (see issue 25376 and issue 26531). I'm adding a patch for Python 3.6 to call ReadConsoleA instead of fgets in PyOS_Readline. This fixes Ctrl+C and EOF handling in Windows 10 for both the interactive shell and the built-in input() function. As noted previously, changes to the console in Windows 8 and 10 introduced a bug in ReadFile. It no longer sets the last error to ERROR_OPERATION_ABORTED (995) when a console read is interrupted by Ctrl+C or Ctrl+Break. This is a problem for the current implementation of PyOS_Readline, which calls ReadFile indirectly via C fgets. This bug can be avoided by calling ReadConsoleA instead of fgets when stdin is a console. Note that isatty() is insufficient to detect the console, since it's true for all character devices, such as NUL. I instead call GetConsoleMode to check for a console handle. I'm also looking into modifying Modules/signalmodule.c to set _PyOS_SigintEvent() when SIGBREAK is tripped, which matters when there's a non-default SIGBREAK handler. Also, PyErr_CheckSignals is a logical place to reset the event. Actually, it seems to me that everywhere in signalmodule.c where the signal flag is untripped should reset the event, in which case there should be an untrip_signal() to match trip_signal(). ---------- keywords: +patch Added file: http://bugs.python.org/file42132/issue18597_3_6_0.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 08:02:04 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 11 Mar 2016 13:02:04 +0000 Subject: [issue16465] dict creation performance regression In-Reply-To: <1352823544.31.0.485629860142.issue16465@psf.upfronthosting.co.za> Message-ID: <1457701324.17.0.394476630347.issue16465@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Closed in the favor of issue23601. ---------- resolution: -> out of date stage: patch review -> resolved status: open -> closed superseder: -> use small object allocator for dict key storage _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 08:03:41 2016 From: report at bugs.python.org (Daniel Shaulov) Date: Fri, 11 Mar 2016 13:03:41 +0000 Subject: [issue26539] frozen executables should have an empty path Message-ID: <1457701421.75.0.0409884963304.issue26539@psf.upfronthosting.co.za> New submission from Daniel Shaulov: A frozen python executable should have an empty path, so it doesn't accidentally run something it was not supposed to. The attached file achieves that by setting Py_NoSiteFlag and Py_IsolatedFlag in Python/frozenmain.c It also checks for Py_FrozenFlag in Python/sysmodule.c in makepathobject and just returns an empty list if it is set. I originally tried doing it without changing sysmodule, by calling Py_SetPath as suggested in the comment in getpath.c, but calling Py_SetPath(L"") will leave me with a path that cointains a single empty string. There is no way to set an empty path with Py_SetPath. Other options include allowing Py_SetPath to accept NULL and making sure that NULL results in an empty list, or changing the behavior of makepathobject so an empty string will result in an empty list instead of a list with an empty string. ---------- components: Demos and Tools files: freeze_path.patch keywords: patch messages: 261566 nosy: Daniel Shaulov, twouters priority: normal severity: normal status: open title: frozen executables should have an empty path type: enhancement versions: Python 3.5, Python 3.6 Added file: http://bugs.python.org/file42133/freeze_path.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 08:21:44 2016 From: report at bugs.python.org (Fred L. Drake, Jr.) Date: Fri, 11 Mar 2016 13:21:44 +0000 Subject: [issue26247] Document Chrome/Chromium for python2.7 In-Reply-To: <1454250201.34.0.379638558981.issue26247@psf.upfronthosting.co.za> Message-ID: <1457702504.06.0.694954324521.issue26247@psf.upfronthosting.co.za> Fred L. Drake, Jr. added the comment: The ``versionadded::`` directive should only be used to annotate descriptions of new API entries. While it would be correctly applied to the ``Chrome`` and ``Chromium`` classes, those are not separately documented here, but are only listed in the table. See http://bugs.python.org/issue26366 for further discussion on the use of ``versionadded::``. ---------- nosy: +fdrake _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 08:25:23 2016 From: report at bugs.python.org (Michael Herold) Date: Fri, 11 Mar 2016 13:25:23 +0000 Subject: [issue26394] Have argparse provide ability to require a fallback value be present In-Reply-To: <1455985031.95.0.488150837583.issue26394@psf.upfronthosting.co.za> Message-ID: <1457702723.77.0.96923385935.issue26394@psf.upfronthosting.co.za> Michael Herold added the comment: Thanks so much for looking into my patch! Let me start by outlining that I don't understand how your alternate solutions are coping with the key problem. You are assuming that you get a populated Namespace object. However, `_parse_known_args` is exiting if required arguments are missing. Hence, late hooks or working with Namespaces is just too late. I was thinking about adding an option that suppresses required argument errors, but this again implies that parts of the logic have to be reimplemented outside of argparse. Let me remind you of ConfigArgParse again. It constructs an argument string from configs etc. and appends it to sys.argv before calling argparse. Surprise: This is not rock solid and limits the capabilities. There is almost no other way to attach these functionalities to argparse. ------------------------------------------------------------------------ The `actions_with_values` dict should actually be ordered. My bad. With an ordered dict, the order can only be changed if a fallback is present. The desired behaviour has to be defined in this context. However, without fallbacks the order is identical with an ordered dict. I totally get that backward compatibility is a delicate thing in this context. Unit tests: All passing, up to action='append'. This is related to a design decision to be made for fallbacks in case of multiply supplied arguments. Number of arguments for fallbacks: This part was blind guessing and it worked for my simple test cases. I really didn't dive into this regex part in detail. At least extensive unit tests for fallbacks are required anyways. Values and objects instead of strings: Think there are two aspects. 1. That example.py had to handle bools explicitly is a design decision. How bools can be supplied in configs or env vars should not be hard coded in argparse. This also applies for my [x,y] list syntax etc. 2. Supplying actual objects/values as fallback makes sense. The current implementation (with my example) is such, that you can supply the arguments in the same form as on the command line. If you have interpreted this information already (say, fallback returns `true` instead of `[]`), you don't want the returned fallback to be handled in the usual way [number of arguments differs (it's not even a list), action gets unexpected input]. Maybe the fallback can indicate that by returning an argparse.FinalValue() object or what ever. Subparsers: Yeah, big unknown. But my intuition is, that this can be solved nicely. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 08:31:46 2016 From: report at bugs.python.org (Eryk Sun) Date: Fri, 11 Mar 2016 13:31:46 +0000 Subject: [issue18597] On Windows sys.stdin.readline() doesn't handle Ctrl-C properly In-Reply-To: <1375175592.24.0.539816782076.issue18597@psf.upfronthosting.co.za> Message-ID: <1457703106.3.0.708755021231.issue18597@psf.upfronthosting.co.za> Eryk Sun added the comment: Background Discussion The Windows 10 console uses the condrv.sys device driver, which is set up as follows in the NT namespace: C:\>odir \ -r -n con;con*$;cond* Directory of \ Device ConDrv Driver condrv GLOBAL?? CON -> \Device\ConDrv\Console CONIN$ -> \Device\ConDrv\CurrentIn CONOUT$ -> \Device\ConDrv\CurrentOut Previously the base console API used an NT LPC port to communicate with the attached console process (i.e. an instance of conhost.exe). There wasn't a real console device. Instead, opening "CON", "CONIN$", or "CONOUT$" was special cased to call OpenConsoleW (undocumented). With the new console device driver, opening the DOS "CON" device gets translated to the NT path "\Device\ConDrv\Console", i.e. it opens the file named "Console" on the ConDrv device. Opening the Console file returns a handle for a regular kernel File object. To that end, you may have noticed that console handles in Windows 10 are no longer tagged for routing by setting the lower two bits (e.g. 3, 7, 11, etc). For example: >>> kernel32.GetStdHandle(STD_INPUT_HANDLE) 32 >>> kernel32.DebugBreak() (e1c.e20): Break instruction exception - code 80000003 (first chance) KERNELBASE!DebugBreak+0x2: 00007ffa`60280262 cc int 3 0:000> !handle 32 Handle 32 Type File Previously, all operations on console handles were internally routed to special console functions, such as ReadFile => ReadConsoleA. Thus with the old LPC-based console, a ReadFile basically has the behavior of ReadConsoleA (with the addition of special casing input lines that start with Ctrl+Z). The new design scraps a lot of the special-cased code. For example, reading from a console handle in Windows 10 uses a regular NtReadFile system call. So the error it sets, if any at all, depends on translating the NTSTATUS code that's returned by NtReadFile. Let's see what status the console sets here: C:\Temp>cdb -xi ld python ccbug.py [...] ntdll!LdrpDoDebuggerBreak+0x30: 00007ffb`170de260 cc int 3 0:000> g 3.5.1 (v3.5.1:37a07cee5969, Dec 6 2015, 01:54:25) [MSC v.1900 64 bit (AMD64)] calling DebugBreak... (8d0.62c): Break instruction exception - code 80000003 (first chance) KERNELBASE!DebugBreak+0x2: 00007ffb`13f40262 cc int 3 0:000> bp ntdll!NtReadFile 0:000> g Breakpoint 0 hit ntdll!NtReadFile: 00007ffb`170b35d0 4c8bd1 mov r10,rcx 0:000> pt ntdll!NtReadFile+0xa: 00007ffb`170b35da c3 ret 0:000> r rax rax=0000000000000101 The console weirdly returns a success code, STATUS_ALERTED (0x101, "the delay completed because the thread was alerted"), which is why ReadFile doesn't set an error. STATUS_ALERTED is normally returned when an NT wait function gets alerted by NtAlertThread (note that this is not the same as getting alerted by an asynchronous procedure call). For example: tid = threading.get_ident() h = kernel32.OpenThread(MAXIMUM_ALLOWED, 0, tid) t = threading.Timer(5, ntdll.NtAlertThread, (h,)) delay = LARGE_INTEGER(10 * -10**7) # 10 seconds t.start() r = ntdll.NtDelayExecution(True, byref(delay)) >>> hex(r) '0x101' NtAlertThread is rarely used because WinAPI wait functions (e.g. SleepEx) automatically restart a wait when the underlying NT wait returns STATUS_ALERTED. The ReadConsole implementation has always translated STATUS_ALERTED to ERROR_OPERATION_ABORTED. This still exists in the Windows 10 implementation of ReadConsole. However, the correct error status for this case is STATUS_CANCELLED (0xC0000120, "the I/O request was cancelled"): >>> ntdll.RtlNtStatusToDosError(0xC0000120) 995 Whoever reimplemented the console IPC using a device driver should have updated the console to return STATUS_CANCELLED when an I/O operation is interrupted by Ctrl+C or Ctrl+Break. Then nothing would need to be special cased. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 08:43:40 2016 From: report at bugs.python.org (Varpu Rantala) Date: Fri, 11 Mar 2016 13:43:40 +0000 Subject: [issue25959] tkinter - PhotoImage.zoom() causes segfault In-Reply-To: <1451171771.79.0.252031360467.issue25959@psf.upfronthosting.co.za> Message-ID: <1457703820.4.0.470419438499.issue25959@psf.upfronthosting.co.za> Varpu Rantala added the comment: crashes also with Python 3.5.0 (Mac OS X 10.11.3) when x and y are the following or bigger, but works when they are smaller. Tried it with the mapbe.gif image (size 1000 x 681). 30, 27 31, 26 32, 25 33, 24 34, 24 35, 23 36, 22 37, 22 38, 22 39, 21 40, 20 ---------- nosy: +Varpu Rantala _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 08:46:31 2016 From: report at bugs.python.org (Guido Treutwein) Date: Fri, 11 Mar 2016 13:46:31 +0000 Subject: [issue26156] Bad name into power operator syntax In-Reply-To: <1453214486.32.0.13836493656.issue26156@psf.upfronthosting.co.za> Message-ID: <1457703991.67.0.255531275721.issue26156@psf.upfronthosting.co.za> Guido Treutwein added the comment: Yurys answer and resolution misses the point. Nobody complained about the await operator. Fact is, that in the _power_ operator (chapter 6.5) as base specification now "await" is given. This is likely to be an inadvertent copy of the previous chapter, makes no sense here and should probably be replaced by "u_expr" or similar. ---------- nosy: +Guido Treutwein _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 08:52:39 2016 From: report at bugs.python.org (Manvi B) Date: Fri, 11 Mar 2016 13:52:39 +0000 Subject: [issue26247] Document Chrome/Chromium for python2.7 In-Reply-To: <1454250201.34.0.379638558981.issue26247@psf.upfronthosting.co.za> Message-ID: <1457704359.89.0.9272957614.issue26247@psf.upfronthosting.co.za> Manvi B added the comment: Modified the patch with this directive instead ``versionchanged::``. ---------- Added file: http://bugs.python.org/file42134/issue26247.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 09:26:38 2016 From: report at bugs.python.org (Fred L. Drake, Jr.) Date: Fri, 11 Mar 2016 14:26:38 +0000 Subject: [issue26247] Document Chrome/Chromium for python2.7 In-Reply-To: <1454250201.34.0.379638558981.issue26247@psf.upfronthosting.co.za> Message-ID: <1457706398.28.0.699124187044.issue26247@psf.upfronthosting.co.za> Fred L. Drake, Jr. added the comment: Sorry; I guess I wasn't clear. ``versionadded::`` and ``versionchanged::`` are applied to specific API points (modules, classes, methods, attributes) that are identified structurally in the documentation. That isn't the case for this. While a bit of text noting the addition is less discoverable for documentation processors, I believe it to be sufficient. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 09:50:23 2016 From: report at bugs.python.org (Manvi B) Date: Fri, 11 Mar 2016 14:50:23 +0000 Subject: [issue26247] Document Chrome/Chromium for python2.7 In-Reply-To: <1454250201.34.0.379638558981.issue26247@psf.upfronthosting.co.za> Message-ID: <1457707823.94.0.716211820169.issue26247@psf.upfronthosting.co.za> Manvi B added the comment: @Fred L. Drake, Jr. (fdrake) Is it okay if I can remove ``versionchanged::``. And simply say that, Support for Chrome/Chromium has been added from 2.7.5 version or later. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 10:23:22 2016 From: report at bugs.python.org (Manvi B) Date: Fri, 11 Mar 2016 15:23:22 +0000 Subject: [issue26247] Document Chrome/Chromium for python2.7 In-Reply-To: <1454250201.34.0.379638558981.issue26247@psf.upfronthosting.co.za> Message-ID: <1457709802.36.0.156336278314.issue26247@psf.upfronthosting.co.za> Manvi B added the comment: Submitted the patch with the text noting below the table. ---------- Added file: http://bugs.python.org/file42135/issue26247.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 10:33:52 2016 From: report at bugs.python.org (STINNER Victor) Date: Fri, 11 Mar 2016 15:33:52 +0000 Subject: [issue16465] dict creation performance regression In-Reply-To: <1352823544.31.0.485629860142.issue16465@psf.upfronthosting.co.za> Message-ID: <1457710432.25.0.829178388251.issue16465@psf.upfronthosting.co.za> STINNER Victor added the comment: Serhiy Storchaka: > Closed in the favor of issue23601. Cool! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 10:41:57 2016 From: report at bugs.python.org (Elena Oat) Date: Fri, 11 Mar 2016 15:41:57 +0000 Subject: [issue13305] datetime.strftime("%Y") not consistent for years < 1000 In-Reply-To: <1320091957.61.0.759691422668.issue13305@psf.upfronthosting.co.za> Message-ID: <1457710917.13.0.770592839609.issue13305@psf.upfronthosting.co.za> Elena Oat added the comment: I submitted a patch for documentation changes related to strftime "%Y" directive inconsistencies. I am not sure that specifying the OS is correct, because I haven't tested the inconsistencies on all Linux PCs, Windows versions or OS X. I still left them there though, so let me know what's your opinion on it. ---------- nosy: +Elena.Oat Added file: http://bugs.python.org/file42136/issue13305.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 11:14:12 2016 From: report at bugs.python.org (Joshua Cannell) Date: Fri, 11 Mar 2016 16:14:12 +0000 Subject: [issue26531] KeyboardInterrupt while in input() not catchable on Windows 10 In-Reply-To: <1457626725.91.0.992328225706.issue26531@psf.upfronthosting.co.za> Message-ID: <1457712852.45.0.474558167901.issue26531@psf.upfronthosting.co.za> Joshua Cannell added the comment: Yeah, so this looks like a behavior in Windows in which an EOFError is raised when a Ctrl + C is pressed, followed by a KeyboardInterrupt. This post basically explains how to overcome it: http://stackoverflow.com/questions/31127652/cannot-catch-keyboardinterrupt-in-command-prompt-twice def bing(): try: input() except EOFError: print("Caught an EOFError") try: bing() print("After bing") except KeyboardInterrupt: print("Final KeyboardInterrupt") Sorry for necro-ing an old issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 11:16:48 2016 From: report at bugs.python.org (Fred L. Drake, Jr.) Date: Fri, 11 Mar 2016 16:16:48 +0000 Subject: [issue26247] Document Chrome/Chromium for python2.7 In-Reply-To: <1454250201.34.0.379638558981.issue26247@psf.upfronthosting.co.za> Message-ID: <1457713008.96.0.0654942536956.issue26247@psf.upfronthosting.co.za> Fred L. Drake, Jr. added the comment: LGTM Thanks for getting this documented! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 11:39:21 2016 From: report at bugs.python.org (Nathaniel Smith) Date: Fri, 11 Mar 2016 16:39:21 +0000 Subject: [issue26530] tracemalloc: add C API to manually track/untrack memory allocations In-Reply-To: <1457619430.68.0.0968942184372.issue26530@psf.upfronthosting.co.za> Message-ID: <1457714361.65.0.220229418315.issue26530@psf.upfronthosting.co.za> Nathaniel Smith added the comment: Hi Victor, This is really great, thanks for working on it! What do you think about the richer api I proposed here? http://bugs.python.org/issue18835#msg232221 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 11:46:58 2016 From: report at bugs.python.org (SilentGhost) Date: Fri, 11 Mar 2016 16:46:58 +0000 Subject: [issue26536] Add the SIO_LOOPBACK_FAST_PATH option to socket.ioctl In-Reply-To: <1457666128.63.0.278319184112.issue26536@psf.upfronthosting.co.za> Message-ID: <1457714818.83.0.997614438812.issue26536@psf.upfronthosting.co.za> Changes by SilentGhost : ---------- components: +Windows nosy: +paul.moore, pitrou, steve.dower, tim.golden, zach.ware stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 11:47:35 2016 From: report at bugs.python.org (Brett Cannon) Date: Fri, 11 Mar 2016 16:47:35 +0000 Subject: [issue26532] build fails with address sanitizer In-Reply-To: <1457640165.38.0.124294976796.issue26532@psf.upfronthosting.co.za> Message-ID: <1457714855.42.0.167911240363.issue26532@psf.upfronthosting.co.za> Changes by Brett Cannon : ---------- resolution: -> third party status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 11:56:12 2016 From: report at bugs.python.org (Brett Cannon) Date: Fri, 11 Mar 2016 16:56:12 +0000 Subject: [issue26538] regrtest: setup_tests() must not replace module.__path__ (_NamespacePath) with a simple list // importlib & abspath In-Reply-To: <1457696667.94.0.108519122037.issue26538@psf.upfronthosting.co.za> Message-ID: <1457715372.79.0.990107383571.issue26538@psf.upfronthosting.co.za> Brett Cannon added the comment: I think a more important question is why is test.libregrtest doing what it's doing? Is it simply to guarantee that the `site` code is run? If so it should just import `site`. As for adding the __setitem__() method, I'm fine with it but maybe Eric has an opinion? ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 12:18:22 2016 From: report at bugs.python.org (Devyn Johnson) Date: Fri, 11 Mar 2016 17:18:22 +0000 Subject: [issue26540] Python Macros Message-ID: <1457716702.76.0.922286771482.issue26540@psf.upfronthosting.co.za> New submission from Devyn Johnson: Would it be a good idea to add macros to Python? This would allow developers to test a condition (such as, "is this code running on Linux?" or "is this Python version 3.6?"). Then, the compiled bytecode will already contain the needed code, as opposed to testing the conditions during each execution. ---------- components: Interpreter Core messages: 261582 nosy: Devyn Johnson priority: normal severity: normal status: open title: Python Macros type: enhancement versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 12:25:54 2016 From: report at bugs.python.org (Ethan Furman) Date: Fri, 11 Mar 2016 17:25:54 +0000 Subject: [issue26540] Python Macros In-Reply-To: <1457716702.76.0.922286771482.issue26540@psf.upfronthosting.co.za> Message-ID: <1457717154.18.0.647187111827.issue26540@psf.upfronthosting.co.za> Ethan Furman added the comment: That particular use-case is easily handled by simply creating the correct function/method based on the criterion: if py_ver < 3.6: def fribbletz(): # do something in a 3.0-3.5 compatible way else: def fribbletz(): # otherwise use 3.6 methods One possible up-side would by if macros were able to allow not erroring out when new syntax was used in the False branch; but really, we add new syntax so rarely even that is probably not worth it. ---------- nosy: +ethan.furman _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 12:41:43 2016 From: report at bugs.python.org (Michael Foord) Date: Fri, 11 Mar 2016 17:41:43 +0000 Subject: [issue26323] Add assert_called() and assert_called_once() methods for mock objects In-Reply-To: <1455062445.23.0.2044896551.issue26323@psf.upfronthosting.co.za> Message-ID: <1457718103.59.0.949149543276.issue26323@psf.upfronthosting.co.za> Michael Foord added the comment: Yes, this can go in. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 12:50:14 2016 From: report at bugs.python.org (paul j3) Date: Fri, 11 Mar 2016 17:50:14 +0000 Subject: [issue26394] Have argparse provide ability to require a fallback value be present In-Reply-To: <1455985031.95.0.488150837583.issue26394@psf.upfronthosting.co.za> Message-ID: <1457718614.51.0.440394835879.issue26394@psf.upfronthosting.co.za> paul j3 added the comment: Yes, the use of ordered dictionary would be right. Your code would still reorder actions that have fallback values, but that wouldn't affect others. Yes, a fallback hook at the end of parsing would have to be placed before the 'required' testing, not after as in my 'group' testing. I still haven't absorbed why this patch is superior to the ConfigArgParse approach, or chaining dictionary values after parsing. By the way I like how ConfigArgParse claims to automatically test itself against 'test_argparse.py'. I'd also suggest following its example in published this enhancement in your own repository and pypi. The process of adding features to the main Python distribution is very slow. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 12:52:51 2016 From: report at bugs.python.org (STINNER Victor) Date: Fri, 11 Mar 2016 17:52:51 +0000 Subject: [issue26530] tracemalloc: add C API to manually track/untrack memory allocations In-Reply-To: <1457619430.68.0.0968942184372.issue26530@psf.upfronthosting.co.za> Message-ID: <1457718771.98.0.98972359451.issue26530@psf.upfronthosting.co.za> STINNER Victor added the comment: """ What do you think about the richer api I proposed here? http://bugs.python.org/issue18835#msg232221 """ msg232221: """ For numpy's purposes, I think the best approach would be to add a tracemalloc "escape valve", with an interface like: PyMem_RecordAlloc(const char* domain, void* tag, size_t quantity, PyMem_RecordRealloc(const char* domain, void* old_tag, void* new_tag, size_t new_quantity) PyMem_RecordFree(const char* domain, void* tag) """ I don't plan to store new information in tracemalloc. tracemalloc design is "simple": it stores a trace for each memory block. A memory block is identified by its address (void* pointer) and a trace is a tuple (size, traceback). Extending a trace would increase the memory footprint overhead of tracemalloc. Note: I don't understand what are domain, tag (address of the memory block?) or quantity (size of the memory block?). Storing the C filename and C line number was proposed but rejected in the design of the PEP 445: https://www.python.org/dev/peps/pep-0445/#pass-the-c-filename-and-line-number I'm open to extending tracemalloc, but it requires to discuss the API and how changes will impact the code (tracemalloc, but also users of the tracemalloc API). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 12:55:49 2016 From: report at bugs.python.org (STINNER Victor) Date: Fri, 11 Mar 2016 17:55:49 +0000 Subject: [issue26538] regrtest: setup_tests() must not replace module.__path__ (_NamespacePath) with a simple list // importlib & abspath In-Reply-To: <1457696667.94.0.108519122037.issue26538@psf.upfronthosting.co.za> Message-ID: <1457718949.9.0.00956203082873.issue26538@psf.upfronthosting.co.za> STINNER Victor added the comment: Longer extract of setup_tests(), with the long comment: # Some times __path__ and __file__ are not absolute (e.g. while running from # Lib/) and, if we change the CWD to run the tests in a temporary dir, some # imports might fail. This affects only the modules imported before os.chdir(). # These modules are searched first in sys.path[0] (so '' -- the CWD) and if # they are found in the CWD their __file__ and __path__ will be relative (this # happens before the chdir). All the modules imported after the chdir, are # not found in the CWD, and since the other paths in sys.path[1:] are absolute # (site.py absolutize them), the __file__ and __path__ will be absolute too. # Therefore it is necessary to absolutize manually the __file__ and __path__ of # the packages to prevent later imports to fail when the CWD is different. for module in sys.modules.values(): if hasattr(module, '__path__'): module.__path__ = [os.path.abspath(path) for path in module.__path__] if hasattr(module, '__file__'): module.__file__ = os.path.abspath(module.__file__) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 12:56:37 2016 From: report at bugs.python.org (Memeplex) Date: Fri, 11 Mar 2016 17:56:37 +0000 Subject: [issue26541] Add stop_after parameter to setup() Message-ID: <1457718997.42.0.688813904458.issue26541@psf.upfronthosting.co.za> New submission from Memeplex: The current implementation offers a stop_after parameter for run_setup() but not for setup(). This design has some shortcomings: 1. It couples the possibility to stop setup after some phase to the fact that the setup function resides in another file. But the feature is also useful when directly invoking setup (for example, if you want to tweak the dist before running it). 2. The other parameters to run_setup are already parameters to setup. It would be more consistent to make all three parameters common to both methods. 3. Arguably messy global variable manipulation to communicate run_setup and setup. ---------- components: Distutils messages: 261588 nosy: dstufft, eric.araujo, memeplex priority: normal severity: normal status: open title: Add stop_after parameter to setup() type: enhancement versions: Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 13:14:45 2016 From: report at bugs.python.org (=?utf-8?b?0JDQvdC00YDQtdC5INCd0Y/RhdCw0LnRh9GL0Lo=?=) Date: Fri, 11 Mar 2016 18:14:45 +0000 Subject: [issue14787] pkgutil.walk_packages returns extra modules In-Reply-To: <1336813271.29.0.464157696844.issue14787@psf.upfronthosting.co.za> Message-ID: <1457720085.09.0.333191047322.issue14787@psf.upfronthosting.co.za> ?????? ???????? added the comment: Any hope to add the warning in pkgutil docs about this problem? For example: Warning!!! The walk_packages function uses sys.path to import nested packages for provided paths. It means it walks deeply by relative import for subpackages. If you provide path that is not in sys.path as an argument the result won't be correct. ---------- nosy: +?????? ???????? _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 13:15:06 2016 From: report at bugs.python.org (Barun Parruck) Date: Fri, 11 Mar 2016 18:15:06 +0000 Subject: [issue26448] dis.findlabels ignores EXTENDED_ARG In-Reply-To: <1456545250.68.0.0525262950792.issue26448@psf.upfronthosting.co.za> Message-ID: <1457720106.6.0.463295366523.issue26448@psf.upfronthosting.co.za> Barun Parruck added the comment: Hi! Okay, sorry for disappearing like that(this is becoming rather a habit isn't it!), but with Gsoc applications, I've been insanely busy trying to get patches and bugs accepted for my first Gsoc ever. I do apologize for leaving you hanging, it was not my intention! I'll try my best to give you an update by the end of this week and hopefully be able to keep working on this! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 13:20:27 2016 From: report at bugs.python.org (Dmitry Shachnev) Date: Fri, 11 Mar 2016 18:20:27 +0000 Subject: [issue26542] Wrongly formatted doctest block in difflib documentation Message-ID: <1457720427.82.0.520743466398.issue26542@psf.upfronthosting.co.za> New submission from Dmitry Shachnev: Look at the documentation of difflib.SequenceMatcher.get_opcodes: https://docs.python.org/dev/library/difflib.html#difflib.SequenceMatcher.get_opcodes There, the result part of the example is rendered as plain reStructuredText, separately from the code block itself. The attached patch fixes it. ---------- assignee: docs at python components: Documentation files: doctest.diff keywords: patch messages: 261591 nosy: docs at python, mitya57 priority: normal severity: normal status: open title: Wrongly formatted doctest block in difflib documentation type: enhancement versions: Python 3.5, Python 3.6 Added file: http://bugs.python.org/file42137/doctest.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 14:21:07 2016 From: report at bugs.python.org (Brett Cannon) Date: Fri, 11 Mar 2016 19:21:07 +0000 Subject: [issue26538] regrtest: setup_tests() must not replace module.__path__ (_NamespacePath) with a simple list // importlib & abspath In-Reply-To: <1457696667.94.0.108519122037.issue26538@psf.upfronthosting.co.za> Message-ID: <1457724067.17.0.0511597766948.issue26538@psf.upfronthosting.co.za> Brett Cannon added the comment: Figures. If you do decide to centralize the code then put it in importlib.util and please don't make it public. It's something that should only be done once and not something most people should have to worry about. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 14:32:42 2016 From: report at bugs.python.org (Roundup Robot) Date: Fri, 11 Mar 2016 19:32:42 +0000 Subject: [issue26247] Document Chrome/Chromium for python2.7 In-Reply-To: <1454250201.34.0.379638558981.issue26247@psf.upfronthosting.co.za> Message-ID: <20160311193239.108829.10106@psf.io> Roundup Robot added the comment: New changeset 8ef74c7f3fdc by Ezio Melotti in branch '2.7': #26247: document Chrome/Chromium addition to webbrowser. Patch by Manvi B. https://hg.python.org/cpython/rev/8ef74c7f3fdc ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 14:33:29 2016 From: report at bugs.python.org (Mark Dickinson) Date: Fri, 11 Mar 2016 19:33:29 +0000 Subject: [issue26540] Python Macros In-Reply-To: <1457716702.76.0.922286771482.issue26540@psf.upfronthosting.co.za> Message-ID: <1457724809.41.0.055187737055.issue26540@psf.upfronthosting.co.za> Mark Dickinson added the comment: This is really python-ideas material: you'd need to give a *lot* more details about exactly what you mean by "macros". ---------- nosy: +mark.dickinson _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 14:35:58 2016 From: report at bugs.python.org (Ezio Melotti) Date: Fri, 11 Mar 2016 19:35:58 +0000 Subject: [issue26247] Document Chrome/Chromium for python2.7 In-Reply-To: <1454250201.34.0.379638558981.issue26247@psf.upfronthosting.co.za> Message-ID: <1457724958.09.0.643899595985.issue26247@psf.upfronthosting.co.za> Ezio Melotti added the comment: Fixed, thanks for the patches and reviews! ---------- resolution: -> fixed stage: needs patch -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 14:40:30 2016 From: report at bugs.python.org (Ezio Melotti) Date: Fri, 11 Mar 2016 19:40:30 +0000 Subject: [issue26540] Python Macros In-Reply-To: <1457716702.76.0.922286771482.issue26540@psf.upfronthosting.co.za> Message-ID: <1457725230.82.0.840520798044.issue26540@psf.upfronthosting.co.za> Ezio Melotti added the comment: Agreed, this is python-ideas material. The topic also came up in the past, and there are already threads where this has been discussed and even existing projects that implements macros. ---------- nosy: +ezio.melotti resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 15:21:13 2016 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 11 Mar 2016 20:21:13 +0000 Subject: [issue25959] tkinter - PhotoImage.zoom() causes segfault In-Reply-To: <1451171771.79.0.252031360467.issue25959@psf.upfronthosting.co.za> Message-ID: <1457727673.13.0.474417717592.issue25959@psf.upfronthosting.co.za> Changes by Terry J. Reedy : ---------- assignee: docs at python -> terry.reedy stage: needs patch -> commit review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 15:31:44 2016 From: report at bugs.python.org (Roundup Robot) Date: Fri, 11 Mar 2016 20:31:44 +0000 Subject: [issue25959] tkinter - PhotoImage.zoom() causes segfault In-Reply-To: <1451171771.79.0.252031360467.issue25959@psf.upfronthosting.co.za> Message-ID: <20160311203141.29607.2178@psf.io> Roundup Robot added the comment: New changeset 1e7c388dc3c5 by Terry Jan Reedy in branch '2.7': Issue 25959: Explain in docstring that PhotoImage.zoom arguments are https://hg.python.org/cpython/rev/1e7c388dc3c5 New changeset 7474695874d9 by Terry Jan Reedy in branch '3.5': Issue 25959: Explain in docstring that PhotoImage.zoom arguments are https://hg.python.org/cpython/rev/7474695874d9 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 15:32:28 2016 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 11 Mar 2016 20:32:28 +0000 Subject: [issue25959] tkinter - PhotoImage.zoom() causes segfault In-Reply-To: <1451171771.79.0.252031360467.issue25959@psf.upfronthosting.co.za> Message-ID: <1457728348.94.0.840385090425.issue25959@psf.upfronthosting.co.za> Changes by Terry J. Reedy : ---------- resolution: -> fixed stage: commit review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 15:41:30 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 11 Mar 2016 20:41:30 +0000 Subject: [issue25959] tkinter - PhotoImage.zoom() causes segfault In-Reply-To: <1451171771.79.0.252031360467.issue25959@psf.upfronthosting.co.za> Message-ID: <1457728890.49.0.78562017783.issue25959@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Thanks Terry. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 15:46:13 2016 From: report at bugs.python.org (Michael Herold) Date: Fri, 11 Mar 2016 20:46:13 +0000 Subject: [issue26394] Have argparse provide ability to require a fallback value be present In-Reply-To: <1455985031.95.0.488150837583.issue26394@psf.upfronthosting.co.za> Message-ID: <1457729173.01.0.0727116047132.issue26394@psf.upfronthosting.co.za> Michael Herold added the comment: Yes, a fallback hook at the end of parsing would have to be placed > before the 'required' testing, not after as in my 'group' testing. Just to clarify: Would you suggest that a fallback call returns the parsed value (i.e. the fallback calls the action or alike) or `take_action` is called on fallback values after all the other calls are done? I will try to look into your hook system in detail. Maybe you are right and the ideas can be combined nicely. > I still haven't absorbed why this patch is superior to the > ConfigArgParse approach, or chaining dictionary values after parsing. Problems with ConfigArgParse I found: It ignores config and env vars completely if "--" is used on the command line. Implementing positional arguments supplied via config or env var is impossible. Chaining dictionary would require that all arguments are optional. I think that the "make everything optional" approach bypasses to many features of argparse. > I'd also suggest following its example in published this enhancement > in your own repository and pypi. Thanks for the suggestion. I will surely consider this. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 16:00:55 2016 From: report at bugs.python.org (Martin Panter) Date: Fri, 11 Mar 2016 21:00:55 +0000 Subject: [issue17592] mingw: configure MACHDEP and platform for build In-Reply-To: <1364759010.97.0.879569753757.issue17592@psf.upfronthosting.co.za> Message-ID: <1457730055.18.0.176202930583.issue17592@psf.upfronthosting.co.za> Martin Panter added the comment: There are some spelling errors in the comments. It would also be good to keep the indentation, quoting, layout etc similar to the surrounding code. Regarding the comments, what is the significance of ?runtime platform? vs MACHDEP? Also, what is the significance of sys.platform() when setting _PYTHON_HOST_PLATFORM? Why did you use different types of comments? (# vs dnl) I do not understand the comment ?build must not depend from posix-compatible environment?. Is this just explaining that we are setting ac_sys_system (uname -s) to a dummy generic value that will not trigger any special cases. Should we also set ac_sys_release to an empty string, like the cross-compiling case later on? What?s the go with the two competing ?mingw*)? cases when determining _PYTHON_HOST_PLATFORM? What is the situation where $host matches *-*-mingw*, but $host_os does not match mingw*? ---------- nosy: +martin.panter stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 16:04:33 2016 From: report at bugs.python.org (Mark Lawrence) Date: Fri, 11 Mar 2016 21:04:33 +0000 Subject: [issue14787] pkgutil.walk_packages returns extra modules In-Reply-To: <1336813271.29.0.464157696844.issue14787@psf.upfronthosting.co.za> Message-ID: <1457730273.56.0.899805647201.issue14787@psf.upfronthosting.co.za> Changes by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 16:04:42 2016 From: report at bugs.python.org (Martin Panter) Date: Fri, 11 Mar 2016 21:04:42 +0000 Subject: [issue17605] mingw-meta: build interpeter core In-Reply-To: <1364762524.12.0.901415822586.issue17605@psf.upfronthosting.co.za> Message-ID: <1457730282.17.0.933210947502.issue17605@psf.upfronthosting.co.za> Changes by Martin Panter : ---------- dependencies: +AC_LIBOBJ replacement of fileblocks, mingw: Allow Objects/exceptions.c to include "errmap.h", mingw: add wincrypt.h in Python/random.c, mingw: configure MACHDEP and platform for build, mingw: default sys.path calculations for windows platforms, mingw: defect winsock2 and setup _socket module, mingw: determine if pwdmodule should be used, mingw: init system calls, mingw: translate gcc internal defines to python platform specific defines _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 16:07:40 2016 From: report at bugs.python.org (Roundup Robot) Date: Fri, 11 Mar 2016 21:07:40 +0000 Subject: [issue20589] pathlib.owner() and pathlib.group() raise ImportError on Windows In-Reply-To: <1392089109.39.0.748049843739.issue20589@psf.upfronthosting.co.za> Message-ID: <20160311210737.10726.20403@psf.io> Roundup Robot added the comment: New changeset 8ac695499fa3 by Berker Peksag in branch '3.5': Issue #20589: Invoking Path.owner() and Path.group() on Windows now raise https://hg.python.org/cpython/rev/8ac695499fa3 New changeset 1602fa504e72 by Berker Peksag in branch 'default': Issue #20589: Invoking Path.owner() and Path.group() on Windows now raise https://hg.python.org/cpython/rev/1602fa504e72 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 16:10:51 2016 From: report at bugs.python.org (Martin Panter) Date: Fri, 11 Mar 2016 21:10:51 +0000 Subject: [issue18500] mingw: detect winsock2 and setup _socket module In-Reply-To: <1374179669.42.0.252427857289.issue18500@psf.upfronthosting.co.za> Message-ID: <1457730651.83.0.089039562612.issue18500@psf.upfronthosting.co.za> Changes by Martin Panter : ---------- stage: -> patch review title: mingw: defect winsock2 and setup _socket module -> mingw: detect winsock2 and setup _socket module _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 16:13:35 2016 From: report at bugs.python.org (Berker Peksag) Date: Fri, 11 Mar 2016 21:13:35 +0000 Subject: [issue20589] pathlib.owner() and pathlib.group() raise ImportError on Windows In-Reply-To: <1392089109.39.0.748049843739.issue20589@psf.upfronthosting.co.za> Message-ID: <1457730815.89.0.552374634761.issue20589@psf.upfronthosting.co.za> Berker Peksag added the comment: I've changed the exception to raise NotImplementedError. I'm not sure about using the ctypes solution in the stdlib. Perhaps we should wrap Windows GetSecurity* APIs (similar to what we did for UNIX/POSIX APIs) first then we can use it in pathlib. ---------- nosy: +berker.peksag resolution: -> fixed stage: -> resolved status: open -> closed type: -> behavior versions: +Python 3.5, Python 3.6 -Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 16:19:37 2016 From: report at bugs.python.org (Roundup Robot) Date: Fri, 11 Mar 2016 21:19:37 +0000 Subject: [issue26542] Wrongly formatted doctest block in difflib documentation In-Reply-To: <1457720427.82.0.520743466398.issue26542@psf.upfronthosting.co.za> Message-ID: <20160311211934.10732.36477@psf.io> Roundup Robot added the comment: New changeset ffd0603f5251 by Berker Peksag in branch '3.5': Issue #26542: Fix markup of code example in difflib documentation https://hg.python.org/cpython/rev/ffd0603f5251 New changeset 40d92c92eb6e by Berker Peksag in branch 'default': Issue #26542: Fix markup of code example in difflib documentation https://hg.python.org/cpython/rev/40d92c92eb6e ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 16:20:29 2016 From: report at bugs.python.org (Berker Peksag) Date: Fri, 11 Mar 2016 21:20:29 +0000 Subject: [issue26542] Wrongly formatted doctest block in difflib documentation In-Reply-To: <1457720427.82.0.520743466398.issue26542@psf.upfronthosting.co.za> Message-ID: <1457731229.6.0.0107034702252.issue26542@psf.upfronthosting.co.za> Berker Peksag added the comment: Good catch, Dmitry. Thanks for the patch! ---------- nosy: +berker.peksag resolution: -> fixed stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 16:21:46 2016 From: report at bugs.python.org (Roundup Robot) Date: Fri, 11 Mar 2016 21:21:46 +0000 Subject: [issue26323] Add assert_called() and assert_called_once() methods for mock objects In-Reply-To: <1455062445.23.0.2044896551.issue26323@psf.upfronthosting.co.za> Message-ID: <20160311212144.45764.66872@psf.io> Roundup Robot added the comment: New changeset bd75f8d34f97 by Victor Stinner in branch 'default': Add Mock.assert_called() https://hg.python.org/cpython/rev/bd75f8d34f97 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 16:23:27 2016 From: report at bugs.python.org (STINNER Victor) Date: Fri, 11 Mar 2016 21:23:27 +0000 Subject: [issue26323] Add assert_called() and assert_called_once() methods for mock objects In-Reply-To: <1455062445.23.0.2044896551.issue26323@psf.upfronthosting.co.za> Message-ID: <1457731407.84.0.34236108112.issue26323@psf.upfronthosting.co.za> STINNER Victor added the comment: > Yes, this can go in. Cool. I pushed the latest patch of Amit Saha. I just modified assert_call() doc to add "at least once". Thanks Amit for your contribution! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 16:36:40 2016 From: report at bugs.python.org (Roundup Robot) Date: Fri, 11 Mar 2016 21:36:40 +0000 Subject: [issue13305] datetime.strftime("%Y") not consistent for years < 1000 In-Reply-To: <1320091957.61.0.759691422668.issue13305@psf.upfronthosting.co.za> Message-ID: <20160311213637.9523.28414@psf.io> Roundup Robot added the comment: New changeset 291d47954618 by Victor Stinner in branch 'default': Always test datetime.strftime("%4Y") https://hg.python.org/cpython/rev/291d47954618 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 16:37:44 2016 From: report at bugs.python.org (STINNER Victor) Date: Fri, 11 Mar 2016 21:37:44 +0000 Subject: [issue13305] datetime.strftime("%Y") not consistent for years < 1000 In-Reply-To: <1320091957.61.0.759691422668.issue13305@psf.upfronthosting.co.za> Message-ID: <1457732264.45.0.0761389681961.issue13305@psf.upfronthosting.co.za> STINNER Victor added the comment: About Elena Oat's patch issue13305.diff: I'm not sure that strftime("%4Y") works on all platforms, so I enabled the test on strftime("%4Y"). I will check our buildbots. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 16:43:51 2016 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 11 Mar 2016 21:43:51 +0000 Subject: [issue26483] docs unclear on difference between str.isdigit() and str.isdecimal() In-Reply-To: <1457121897.81.0.495681677897.issue26483@psf.upfronthosting.co.za> Message-ID: <1457732631.48.0.309551386484.issue26483@psf.upfronthosting.co.za> Changes by Terry J. Reedy : ---------- nosy: +terry.reedy versions: -Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 16:43:52 2016 From: report at bugs.python.org (STINNER Victor) Date: Fri, 11 Mar 2016 21:43:52 +0000 Subject: [issue13305] datetime.strftime("%Y") not consistent for years < 1000 In-Reply-To: <1320091957.61.0.759691422668.issue13305@psf.upfronthosting.co.za> Message-ID: <1457732632.1.0.526544157378.issue13305@psf.upfronthosting.co.za> STINNER Victor added the comment: acucci's patch doc.patch suggests to use format "%4Y". Problem: I tried it on Linux, and it looks like it doesn't work. >>> datetime.datetime.strptime("1980", "%Y") datetime.datetime(1980, 1, 1, 0, 0) >>> datetime.datetime.strptime("1980", "%4Y") Traceback (most recent call last): ... ValueError: '4' is a bad directive in format '%4Y' Or maybe I misunderstood the doc change. Do you suggest to use %4Y format with strptime(), with strftime() or with both? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 16:47:48 2016 From: report at bugs.python.org (STINNER Victor) Date: Fri, 11 Mar 2016 21:47:48 +0000 Subject: [issue20589] pathlib.owner() and pathlib.group() raise ImportError on Windows In-Reply-To: <1392089109.39.0.748049843739.issue20589@psf.upfronthosting.co.za> Message-ID: <1457732868.79.0.672097105021.issue20589@psf.upfronthosting.co.za> STINNER Victor added the comment: Tests fail... http://buildbot.python.org/all/builders/x86-64 Ubuntu 15.10 Skylake CPU 3.5/builds/276/ ====================================================================== ERROR: test_group (test.test_pathlib.PureWindowsPathTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/buildarea/3.5.intel-ubuntu-skylake/build/Lib/test/test_pathlib.py", line 1167, in test_group P('c:/').group() AttributeError: 'PureWindowsPath' object has no attribute 'group' ====================================================================== ERROR: test_owner (test.test_pathlib.PureWindowsPathTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/buildarea/3.5.intel-ubuntu-skylake/build/Lib/test/test_pathlib.py", line 1162, in test_owner P('c:/').owner() AttributeError: 'PureWindowsPath' object has no attribute 'owner' ---------- nosy: +haypo resolution: fixed -> status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 16:51:01 2016 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 11 Mar 2016 21:51:01 +0000 Subject: [issue26488] hashlib command line interface In-Reply-To: <1457214866.19.0.989950954277.issue26488@psf.upfronthosting.co.za> Message-ID: <1457733061.08.0.690487792228.issue26488@psf.upfronthosting.co.za> Terry J. Reedy added the comment: This strikes me as a sensible addition. While I did not review the patch in detail, it seems cleanly written and is complete in having a new main() for the code, a new doc section, and a new unittest Test class. ---------- nosy: +terry.reedy stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 16:53:35 2016 From: report at bugs.python.org (Roundup Robot) Date: Fri, 11 Mar 2016 21:53:35 +0000 Subject: [issue20589] pathlib.owner() and pathlib.group() raise ImportError on Windows In-Reply-To: <1392089109.39.0.748049843739.issue20589@psf.upfronthosting.co.za> Message-ID: <20160311215332.26204.25936@psf.io> Roundup Robot added the comment: New changeset 64d45f3d0978 by Victor Stinner in branch '3.5': Issue #20589: Fix test_pathlib https://hg.python.org/cpython/rev/64d45f3d0978 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 17:46:32 2016 From: report at bugs.python.org (STINNER Victor) Date: Fri, 11 Mar 2016 22:46:32 +0000 Subject: [issue26509] spurious ConnectionAbortedError logged on Windows In-Reply-To: <1457412256.22.0.929855467044.issue26509@psf.upfronthosting.co.za> Message-ID: <1457736392.03.0.613212554817.issue26509@psf.upfronthosting.co.za> STINNER Victor added the comment: > Your patch seems to miss the ``_fatal_error`` method in ``proactor_events.py`` (which is actually where the bug happens in my application - it's using ``ProactorEventLoop``). Oops :-) What a shame. It's now fixed. Note: _UnixReadPipeTransport._fatal_error() uses the check: isinstance(exc, OSError and exc.errno == errno.EIO It doesn't use _FATAL_ERROR_IGNORE. ---------- Added file: http://bugs.python.org/file42138/fatal_error_ignore-2.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 18:19:19 2016 From: report at bugs.python.org (Gregory P. Smith) Date: Fri, 11 Mar 2016 23:19:19 +0000 Subject: [issue26314] interned strings are stored in a dict, a set would use less memory In-Reply-To: <1454964166.73.0.652183434251.issue26314@psf.upfronthosting.co.za> Message-ID: <1457738359.49.0.676219725876.issue26314@psf.upfronthosting.co.za> Gregory P. Smith added the comment: updated patch: Don't Py_CLEAR the dummy sentinel value in PySet_Fini. The interned set uses it. Otherwise it causes problems when re-initializing after a Fini as happens in processes the setup and tear down an embedded interpreter multiple times. ---------- Added file: http://bugs.python.org/file42139/interned_set_27-gps02.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 18:23:43 2016 From: report at bugs.python.org (Stephen Evans) Date: Fri, 11 Mar 2016 23:23:43 +0000 Subject: [issue26543] imaplib noop Debug Message-ID: <1457738623.54.0.0867122071018.issue26543@psf.upfronthosting.co.za> New submission from Stephen Evans: With the imaplib.Debug=3 (or greater) imaplib.noop() will crash if there are any untagged responses present. The _dump_ur() function has not been converted to expect bytes in the lambda variable x[1]. An abbreviate example of the 'dict' parameter would be: {'READ-WRITE': [b''], 'FETCH': [b'1 (FLAGS (\\Recent NonJunk))']} This _dump_ur() function needs converting to Python 3.x, say, change the map/lambda line to: l = map(lambda x:'%s: %r' % (x[0], x[1]), l) A sample crash inducing session produced by the attached file (using another email client to produce untagged responses for NOOP): 20:01.23 imaplib version 2.58 20:01.23 new IMAP4 connection, tag=b'LMHB' 20:01.48 CAPABILITIES: ('IMAP4REV1', 'LITERAL+', 'SASL-IR', 'LOGIN-REFERRALS', 'ID', 'ENABLE', 'IDLE', 'NAMESPACE', 'AUTH=PLAIN', 'AUTH=LOGIN') Traceback (most recent call last): File "E:/temp/imap-idle/imaplib-noop.py", line 18, in connection.noop() # Crashes here. File "C:\Python35\lib\imaplib.py", line 656, in noop self._dump_ur(self.untagged_responses) File "C:\Python35\lib\imaplib.py", line 1210, in _dump_ur self._mesg('untagged responses dump:%s%s' % (t, t.join(l))) File "C:\Python35\lib\imaplib.py", line 1209, in l = map(lambda x:'%s: "%s"' % (x[0], x[1][0] and '" "'.join(x[1]) or ''), l) TypeError: sequence item 0: expected str instance, bytes found ---------- components: email files: imaplib-noop.py messages: 261615 nosy: Stephen.Evans, barry, r.david.murray priority: normal severity: normal status: open title: imaplib noop Debug type: crash versions: Python 3.5, Python 3.6 Added file: http://bugs.python.org/file42140/imaplib-noop.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 18:42:38 2016 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 11 Mar 2016 23:42:38 +0000 Subject: [issue24136] document PEP 448: unpacking generalization In-Reply-To: <1430918327.69.0.579699866453.issue24136@psf.upfronthosting.co.za> Message-ID: <1457739758.4.0.0381931173304.issue24136@psf.upfronthosting.co.za> Terry J. Reedy added the comment: It is now 10 months and 2 releases since the rather large code patch. Documenting the extensive changes does not seem easy to me ;-). Certainly, a beginner needs feedback. ---------- nosy: +terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 18:42:45 2016 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 11 Mar 2016 23:42:45 +0000 Subject: [issue2292] Missing *-unpacking generalizations In-Reply-To: <1205595680.3.0.859525264867.issue2292@psf.upfronthosting.co.za> Message-ID: <1457739765.93.0.615354076236.issue2292@psf.upfronthosting.co.za> Terry J. Reedy added the comment: > the docs don't need to be committed in time for beta 1. 10 months and 2 releases after the code patch, the doc patches in #24136 are incomplete (I believe), uncommitted, untouched since July, and forgotten about. The issue needs more help. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 18:50:55 2016 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 11 Mar 2016 23:50:55 +0000 Subject: [issue26500] Document of new star unpacking is missing. In-Reply-To: <1457346135.37.0.589425731268.issue26500@psf.upfronthosting.co.za> Message-ID: <1457740255.1.0.784456339094.issue26500@psf.upfronthosting.co.za> Terry J. Reedy added the comment: #19024 was about adding a general section on the various uses of '*'. This was before the new * unpacking generalizations. It was closed because the then existing uses *are* documented and are indexed in the first, Symbols, section of the index. There are now 4 entries. I think entries for standalone '*' (operator and function defs) should be separated from those for '*identifier'. Entries for new *identifier uses need to be added to the index. Assignment statement *identifier target is in 7.2. Assignment statements. Actually documenting the changes in #2292 is #24136 (untouched since July). ---------- nosy: +terry.reedy resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> document PEP 448: unpacking generalization title: Document of star operator missing. It must be documented for better understanding. -> Document of new star unpacking is missing. versions: +Python 3.5, Python 3.6 -Python 2.7, Python 3.3, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 18:52:00 2016 From: report at bugs.python.org (Martin Panter) Date: Fri, 11 Mar 2016 23:52:00 +0000 Subject: [issue26512] Vocabulary: Using "integral" in library/stdtypes.html In-Reply-To: <1457472244.72.0.113699245831.issue26512@psf.upfronthosting.co.za> Message-ID: <1457740320.93.0.421157375697.issue26512@psf.upfronthosting.co.za> Martin Panter added the comment: I have looked at PEP 3141, the history of the documentation in question, and the documentation of the functions in the ?math? module. It seems that trunc(), floor() and ceil() were all intended to return a numbers.Integral type, but then PEP 3141?s floor() and ceil() were reverted from Python 2 due to compatibility concerns, where they only accept and return float objects. So it would be correct to clarify that Integral means numbers.Integral. The term ?integral float? was added by revision 94eeaeeb3ce9, to mean a Python float() object that represents an integer. This is correct (but hard to understand) for Python 2, but the change is not appropriate for Python 3, where floor() and ceil() follow PEP 3141 instead and do return integers (numbers.Integral). I propose to just point to the proper math.trunc(), round() etc documentation and remove the table (originally added in revision 4f9723d9ca32). Julien: do you think the definitions in are understandable? Also I noticed Python 3?s floor() and ceil() doc strings say int not numbers.Integral. That should probably also be fixed. Julien, if you agree with my suggestion, do you still want to do a patch for this? Otherwise, I could have a go when I get a chance. ---------- stage: -> needs patch versions: +Python 2.7, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 18:58:27 2016 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 11 Mar 2016 23:58:27 +0000 Subject: [issue26511] Add link to id() built-in in comparison operator documentation for "is" In-Reply-To: <1457451562.01.0.849547274402.issue26511@psf.upfronthosting.co.za> Message-ID: <1457740707.74.0.444122607519.issue26511@psf.upfronthosting.co.za> Terry J. Reedy added the comment: There is not 'integer caching in Python'. This is strictly an implementation feature of CPython, and any other implementation that does similarly. "or id(x) == id(y)" should be "(id(x) == id(y))" as the addition is an alternate wording, not an alternate condition. I am not sure that this will always be helpful. ---------- nosy: +terry.reedy stage: -> needs patch versions: +Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 19:18:21 2016 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 12 Mar 2016 00:18:21 +0000 Subject: [issue26525] Documentation of ord(c) easy to misread In-Reply-To: <1457599892.41.0.987128084347.issue26525@psf.upfronthosting.co.za> Message-ID: <1457741901.18.0.833253631202.issue26525@psf.upfronthosting.co.za> Terry J. Reedy added the comment: The easily misread "ord('?')" could be expanded to "ord('?') (Greek nu)" but I agree that "ord('?') (Euro sign)" would be either better for a global doc. (And the return is 8364.) If no objection (Benjamin? Nick?), I am willing to do it for 3.5/6 There is no need to change the 2.7 version "ord(u'\u2020') returns 8224." ---------- nosy: +terry.reedy stage: -> patch review type: -> enhancement versions: +Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 19:27:18 2016 From: report at bugs.python.org (Martin Panter) Date: Sat, 12 Mar 2016 00:27:18 +0000 Subject: [issue26499] http.client.IncompleteRead from HTTPResponse read after part reading file In-Reply-To: <1457345453.59.0.0327827539319.issue26499@psf.upfronthosting.co.za> Message-ID: <1457742438.79.0.0724906853247.issue26499@psf.upfronthosting.co.za> Martin Panter added the comment: To add a second response you would just concatenate it to the existing response. (Your existing test already uses FakeSocket.) The FakeSocket parameter just represents data that would be sent from the server. So: body = ( b"HTTP/1.1 200 OK\r\n" b"Content-Length: 3\r\n" b"\r\n" b"abc" b"HTTP/1.1 408 Next response should not be read yet\r\n" ) In fact, see the BasicTest.test_content_length_sync() case, which literally has "extradata" as that last line. I think we just need to adapt or duplicate this test to cover readline() and read1(), not just read(). Maybe also with read1(100), readline(100) cases as well. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 19:27:31 2016 From: report at bugs.python.org (Amit Saha) Date: Sat, 12 Mar 2016 00:27:31 +0000 Subject: [issue26323] Add assert_called() and assert_called_once() methods for mock objects In-Reply-To: <1455062445.23.0.2044896551.issue26323@psf.upfronthosting.co.za> Message-ID: <1457742451.73.0.317145575519.issue26323@psf.upfronthosting.co.za> Amit Saha added the comment: Thank you Victor. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 19:28:18 2016 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 12 Mar 2016 00:28:18 +0000 Subject: [issue26535] Minor typo in the docs for struct.unpack In-Reply-To: <1457664319.61.0.475981364973.issue26535@psf.upfronthosting.co.za> Message-ID: <1457742498.12.0.948977491105.issue26535@psf.upfronthosting.co.za> Changes by Terry J. Reedy : ---------- nosy: +terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 19:36:03 2016 From: report at bugs.python.org (Thomas Waldmann) Date: Sat, 12 Mar 2016 00:36:03 +0000 Subject: [issue26544] platform.libc_ver() returns incorrect version number Message-ID: <1457742963.17.0.0403505576154.issue26544@psf.upfronthosting.co.za> New submission from Thomas Waldmann: platform.libc_ver() is trivially broken as it uses string comparison internally to determine the maximum libc version number (which is obviously broken as "2.9" > "2.10"). ---------- components: Library (Lib) messages: 261624 nosy: Thomas.Waldmann priority: normal severity: normal status: open title: platform.libc_ver() returns incorrect version number type: behavior versions: Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 19:39:49 2016 From: report at bugs.python.org (Ned Deily) Date: Sat, 12 Mar 2016 00:39:49 +0000 Subject: [issue26544] platform.libc_ver() returns incorrect version number In-Reply-To: <1457742963.17.0.0403505576154.issue26544@psf.upfronthosting.co.za> Message-ID: <1457743189.36.0.417275705331.issue26544@psf.upfronthosting.co.za> Changes by Ned Deily : ---------- nosy: +lemburg _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 19:51:09 2016 From: report at bugs.python.org (Martin Panter) Date: Sat, 12 Mar 2016 00:51:09 +0000 Subject: [issue21910] File protocol should document if writelines must handle generators sensibly In-Reply-To: <1404380309.75.0.473808735546.issue21910@psf.upfronthosting.co.za> Message-ID: <1457743869.41.0.0298767172943.issue21910@psf.upfronthosting.co.za> Changes by Martin Panter : ---------- stage: -> needs patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 19:51:48 2016 From: report at bugs.python.org (Berker Peksag) Date: Sat, 12 Mar 2016 00:51:48 +0000 Subject: [issue20589] pathlib.owner() and pathlib.group() raise ImportError on Windows In-Reply-To: <1392089109.39.0.748049843739.issue20589@psf.upfronthosting.co.za> Message-ID: <1457743908.33.0.137222288766.issue20589@psf.upfronthosting.co.za> Berker Peksag added the comment: Thanks Victor. ---------- resolution: -> fixed status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 19:59:00 2016 From: report at bugs.python.org (Thomas Waldmann) Date: Sat, 12 Mar 2016 00:59:00 +0000 Subject: [issue26545] os.walk is limited by python's recursion limit Message-ID: <1457744340.04.0.931517157669.issue26545@psf.upfronthosting.co.za> New submission from Thomas Waldmann: os.walk calls itself recursively and that limits the directory depth it can "walk" into. On Linux, one can create directory hierarchies deeper than that. For some more details see there: https://github.com/borgbackup/borg/issues/380 ---------- components: Library (Lib) messages: 261626 nosy: Thomas.Waldmann priority: normal severity: normal status: open title: os.walk is limited by python's recursion limit versions: Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 20:07:20 2016 From: report at bugs.python.org (Thomas Waldmann) Date: Sat, 12 Mar 2016 01:07:20 +0000 Subject: [issue26545] os.walk is limited by python's recursion limit In-Reply-To: <1457744340.04.0.931517157669.issue26545@psf.upfronthosting.co.za> Message-ID: <1457744840.67.0.5904343915.issue26545@psf.upfronthosting.co.za> Thomas Waldmann added the comment: Note: similar issues can be seen in other stdlib recursive filesystem-related functions also. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 20:08:34 2016 From: report at bugs.python.org (Berker Peksag) Date: Sat, 12 Mar 2016 01:08:34 +0000 Subject: [issue26323] Add assert_called() and assert_called_once() methods for mock objects In-Reply-To: <1455062445.23.0.2044896551.issue26323@psf.upfronthosting.co.za> Message-ID: <1457744914.17.0.476349299992.issue26323@psf.upfronthosting.co.za> Changes by Berker Peksag : ---------- resolution: -> fixed stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 20:13:51 2016 From: report at bugs.python.org (Martin Panter) Date: Sat, 12 Mar 2016 01:13:51 +0000 Subject: [issue9998] ctypes find_library should search LD_LIBRARY_PATH on linux In-Reply-To: <1285857910.26.0.582948500976.issue9998@psf.upfronthosting.co.za> Message-ID: <1457745231.43.0.802838914676.issue9998@psf.upfronthosting.co.za> Martin Panter added the comment: I tend to agree with the comment at . Find_library() is documented as emulating a build-time linker, not run-time. Build-time linking ignores LD_LIBRARY_PATH. Maybe it would make more sense to pass in an optional list of -L directories to search, but it really depends on what the use cases are. Pau: What is wrong with the more direct CDLL("libspatialindex_c.so") proposal that bypasses find_library()? ---------- nosy: +martin.panter _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 20:27:26 2016 From: report at bugs.python.org (Martin Panter) Date: Sat, 12 Mar 2016 01:27:26 +0000 Subject: [issue17590] mingw: translate gcc internal defines to python platform specific defines In-Reply-To: <1364758799.57.0.261822298653.issue17590@psf.upfronthosting.co.za> Message-ID: <1457746046.65.0.838574334935.issue17590@psf.upfronthosting.co.za> Martin Panter added the comment: Here is a possible alternative patch that moves MS_WINDOWS etc from PC/pyconfig.h to "pyport.h". Not tested with standard Windows build. ---------- components: -Cross-Build Added file: http://bugs.python.org/file42141/MS_WINDOWS-move.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 20:28:51 2016 From: report at bugs.python.org (Nathaniel Smith) Date: Sat, 12 Mar 2016 01:28:51 +0000 Subject: [issue26530] tracemalloc: add C API to manually track/untrack memory allocations In-Reply-To: <1457619430.68.0.0968942184372.issue26530@psf.upfronthosting.co.za> Message-ID: <1457746131.59.0.210887032762.issue26530@psf.upfronthosting.co.za> Nathaniel Smith added the comment: > Note: I don't understand what are domain, tag (address of the memory block?) or quantity (size of the memory block?). Yes, the idea is basically the same as now, except with an extra const char * specifying the "domain", so that one could keep separate track of different kinds of allocations. So PyMem_Malloc would just call PyMem_RecordAlloc("heap", ptr, size) (or act equivalently to something that called that, etc.), but something like PyCuda might do PyMem_RecordAlloc("gpu", ptr, size) to track allocations in GPU memory. All the tracing stuff in tracemalloc would be awesome to have for GPU allocations, and it would hardly require any changes to enable it. Ditto for other leakable resources like file descriptors or shmem segments. > I don't plan to store new information in tracemalloc. tracemalloc design is "simple": it stores a trace for each memory block. A memory block is identified by its address (void* pointer) and a trace is a tuple (size, traceback). > Extending a trace would increase the memory footprint overhead of tracemalloc. I think the extra footprint would be tiny? Logically, you'd index traces by (domain, pointer) instead of (pointer), but since we expect that the number of distinct domains is small (like... 1, in the common case) then the natural implementation strategy would be to replace the current {pointer: trace} mapping with a mapping {domain: {pointer: trace}}. So the total overhead would be basically the overhead of allocating a single additional dict. That said, I think having the domain argument *in the public hookable API* is useful even if the tracemalloc hooks themselves decide to ignore it or just ignore all calls that don't refer to the "heap" domain -- because it's extremely cheap to put this in the API now while we're adding it, and it leaves the door open for someone else to come along later and make an awesome gpu heap tracker or whatever without having to first argue with python-dev and wait for the cpython release cycle. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 20:50:04 2016 From: report at bugs.python.org (Martin Panter) Date: Sat, 12 Mar 2016 01:50:04 +0000 Subject: [issue26535] Minor typo in the docs for struct.unpack In-Reply-To: <1457664319.61.0.475981364973.issue26535@psf.upfronthosting.co.za> Message-ID: <1457747404.9.0.388906550509.issue26535@psf.upfronthosting.co.za> Martin Panter added the comment: The patch looks good to me, though it should be applied to all three unpack functions and Struct methods, and the doc strings (struct.unpack.__doc__ etc). An alternative wording is already used for struct.iter_unpack(): ?the buffer?s size in bytes?. Maybe that is slightly clearer, but it?s no big deal. ---------- stage: needs patch -> patch review versions: +Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 21:30:08 2016 From: report at bugs.python.org (Martin Panter) Date: Sat, 12 Mar 2016 02:30:08 +0000 Subject: [issue17592] mingw: configure MACHDEP and platform for build In-Reply-To: <1364759010.97.0.879569753757.issue17592@psf.upfronthosting.co.za> Message-ID: <1457749808.04.0.335012583311.issue17592@psf.upfronthosting.co.za> Martin Panter added the comment: Here is a modified patch fixing a couple of the spelling & style problems. I moved the comment introducing the ac_sys_ variables up to before the code that sets them. I rearranged the logic for _PYTHON_HOST_PLATFORM so it is clear that $host_os overrides $host, and I combined the cygwin and mingw cases. I suspect the configure.ac logic could be simplified more. ---------- Added file: http://bugs.python.org/file42142/MINGW-MACHDEP.v2.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 21:49:22 2016 From: report at bugs.python.org (Martin Panter) Date: Sat, 12 Mar 2016 02:49:22 +0000 Subject: [issue26511] Add link to id() built-in in comparison operator documentation for "is" In-Reply-To: <1457451562.01.0.849547274402.issue26511@psf.upfronthosting.co.za> Message-ID: <1457750962.57.0.0270722080258.issue26511@psf.upfronthosting.co.za> Martin Panter added the comment: Please don?t use nested brackets like that in English text. Try to rewrite the sentence without brackets (e.g. use a comma or say ?This is equivalent to?) [or use a different kind of bracket if you really must (to make the nesting clearer)]. ---------- nosy: +martin.panter _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 12 00:26:28 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 12 Mar 2016 05:26:28 +0000 Subject: [issue26314] interned strings are stored in a dict, a set would use less memory In-Reply-To: <1454964166.73.0.652183434251.issue26314@psf.upfronthosting.co.za> Message-ID: <1457760388.88.0.344589924105.issue26314@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Dicts are hard optimized for string keys due to using them for globals and attributes lookup. Sets are optimized too, but rather for accident. We can be sure that dicts will be always optimized, but set optimization can be eliminated for the sake of simplification or if it will be proven that special casing strings has enough large negative effect on non-string items. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 12 01:00:33 2016 From: report at bugs.python.org (Martin Panter) Date: Sat, 12 Mar 2016 06:00:33 +0000 Subject: =?utf-8?q?=5Bissue22625=5D_When_cross-compiling=2C_don=E2=80=99t_try_to_e?= =?utf-8?q?xecute_binaries?= In-Reply-To: <1413226219.68.0.732560661241.issue22625@psf.upfronthosting.co.za> Message-ID: <1457762433.87.0.143497109974.issue22625@psf.upfronthosting.co.za> Martin Panter added the comment: In I suggested adding some makefile settings to manually override the pgen and _frozen_importlib programs. I imagine the changes would look something like cross-override.patch. Can someone who does cross compiling see if it is any use, and/or also indicate what commands or process they use to cross compile? ---------- versions: -Python 3.4 Added file: http://bugs.python.org/file42143/cross-override.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 12 01:28:24 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 12 Mar 2016 06:28:24 +0000 Subject: [issue26519] Cython doesn't work anymore on Python 3.6 In-Reply-To: <1457539317.39.0.81348046338.issue26519@psf.upfronthosting.co.za> Message-ID: <1457764104.5.0.923574258901.issue26519@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Stefan, could you please check that this issue is fixed and there are no other cases of pickling or copying unpickleable classes? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 12 01:28:26 2016 From: report at bugs.python.org (Mark Lawrence) Date: Sat, 12 Mar 2016 06:28:26 +0000 Subject: [issue17605] mingw-meta: build interpeter core In-Reply-To: <1364762524.12.0.901415822586.issue17605@psf.upfronthosting.co.za> Message-ID: <1457764106.0.0.304204278183.issue17605@psf.upfronthosting.co.za> Changes by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 12 01:33:03 2016 From: report at bugs.python.org (Ezio Melotti) Date: Sat, 12 Mar 2016 06:33:03 +0000 Subject: [issue13305] datetime.strftime("%Y") not consistent for years < 1000 In-Reply-To: <1320091957.61.0.759691422668.issue13305@psf.upfronthosting.co.za> Message-ID: <1457764383.09.0.22555443673.issue13305@psf.upfronthosting.co.za> Ezio Melotti added the comment: > About Elena Oat's patch issue13305.diff: I'm not sure that > strftime("%4Y") works on all platforms It doesn't, that's what the patch is trying to document. AFAICT it works on my Linux (but not on yours), it gives '4Y' on Mac, and raises an error on Windows. This should depend on the libc used by system, so the same OS can give different results depending on which libc it uses, and the only sure thing is that %4Y is not a portable solution. FWIW the patch LGTM (except a couple minor nits -- zero-pad should be hyphenated and there should be a double space after the dot), but I'm not sure if it's better mentioning platforms at all or just being vague and say that it works on some platforms but not others and leave up to the user figuring out where. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 12 02:10:52 2016 From: report at bugs.python.org (STINNER Victor) Date: Sat, 12 Mar 2016 07:10:52 +0000 Subject: [issue13305] datetime.strftime("%Y") not consistent for years < 1000 In-Reply-To: <1320091957.61.0.759691422668.issue13305@psf.upfronthosting.co.za> Message-ID: <1457766652.43.0.117032983039.issue13305@psf.upfronthosting.co.za> STINNER Victor added the comment: >> About Elena Oat's patch issue13305.diff: I'm not sure that >> strftime("%4Y") works on all platforms > It doesn't, that's what the patch is trying to document. Oh. I confirm: %4Y gives "4Y" for any year on FreeBSD and Mac OS X, it raises ValueError("Invalid format string") on Windows, etc. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 12 02:14:52 2016 From: report at bugs.python.org (STINNER Victor) Date: Sat, 12 Mar 2016 07:14:52 +0000 Subject: [issue13305] datetime.strftime("%Y") not consistent for years < 1000 In-Reply-To: <1320091957.61.0.759691422668.issue13305@psf.upfronthosting.co.za> Message-ID: <1457766892.88.0.426917365236.issue13305@psf.upfronthosting.co.za> STINNER Victor added the comment: Elena's issue13305.diff: "Zero padding can be forced on some platforms by using e.g. ``%4Y``" Sorry, I still doesn't understand the change. %4Y doesn't work with strptime() and it only work with strftime() on very few platforms. Can you explain when %4Y should be used? strftime() and/or strptime()? Which platform? To me, it looks wrong to document %4Y since it almost never works... ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 12 02:17:11 2016 From: report at bugs.python.org (Roundup Robot) Date: Sat, 12 Mar 2016 07:17:11 +0000 Subject: [issue13305] datetime.strftime("%Y") not consistent for years < 1000 In-Reply-To: <1320091957.61.0.759691422668.issue13305@psf.upfronthosting.co.za> Message-ID: <20160312071708.10736.6341@psf.io> Roundup Robot added the comment: New changeset e54224e8d6a9 by Victor Stinner in branch 'default': Revert change 291d47954618 https://hg.python.org/cpython/rev/e54224e8d6a9 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 12 02:28:56 2016 From: report at bugs.python.org (Kwamenichols) Date: Sat, 12 Mar 2016 07:28:56 +0000 Subject: [issue15216] Support setting the encoding on a text stream after creation In-Reply-To: <1340880558.16.0.0136840668667.issue15216@psf.upfronthosting.co.za> Message-ID: <1457767736.63.0.681911663269.issue15216@psf.upfronthosting.co.za> Changes by Kwamenichols : ---------- nosy: +quad type: enhancement -> security _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 12 02:30:09 2016 From: report at bugs.python.org (Kwamenichols) Date: Sat, 12 Mar 2016 07:30:09 +0000 Subject: [issue15216] Support setting the encoding on a text stream after creation In-Reply-To: <1340880558.16.0.0136840668667.issue15216@psf.upfronthosting.co.za> Message-ID: <1457767809.9.0.778463275377.issue15216@psf.upfronthosting.co.za> Changes by Kwamenichols : ---------- components: +2to3 (2.x to 3.x conversion tool) hgrepos: +334 versions: -Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 12 02:33:31 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 12 Mar 2016 07:33:31 +0000 Subject: [issue15216] Support setting the encoding on a text stream after creation In-Reply-To: <1340880558.16.0.0136840668667.issue15216@psf.upfronthosting.co.za> Message-ID: <1457768011.85.0.958571687362.issue15216@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: quad, please don't change issue attributes to unrelated values. ---------- type: security -> enhancement versions: +Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 12 02:33:54 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 12 Mar 2016 07:33:54 +0000 Subject: [issue15216] Support setting the encoding on a text stream after creation In-Reply-To: <1340880558.16.0.0136840668667.issue15216@psf.upfronthosting.co.za> Message-ID: <1457768034.32.0.6871719572.issue15216@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- components: -2to3 (2.x to 3.x conversion tool) _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 12 02:56:09 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 12 Mar 2016 07:56:09 +0000 Subject: [issue25652] collections.UserString.__rmod__() raises NameError In-Reply-To: <1447823769.89.0.495006915909.issue25652@psf.upfronthosting.co.za> Message-ID: <1457769369.5.0.741585532193.issue25652@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- assignee: serhiy.storchaka -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 12 02:56:47 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 12 Mar 2016 07:56:47 +0000 Subject: [issue26491] Defer DECREFs until enum object is in a consistent state for re-entrancy In-Reply-To: <1457264726.34.0.955181545994.issue26491@psf.upfronthosting.co.za> Message-ID: <1457769407.06.0.00504510571556.issue26491@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- assignee: serhiy.storchaka -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 12 03:53:58 2016 From: report at bugs.python.org (Roundup Robot) Date: Sat, 12 Mar 2016 08:53:58 +0000 Subject: [issue23718] strptime() can produce invalid date with negative year day In-Reply-To: <1426851032.32.0.560407728917.issue23718@psf.upfronthosting.co.za> Message-ID: <20160312085355.20927.86791@psf.io> Roundup Robot added the comment: New changeset f03da87a79fa by Serhiy Storchaka in branch '3.5': Issue #23718: Fixed parsing time in week 0 before Jan 1. Original patch by https://hg.python.org/cpython/rev/f03da87a79fa New changeset 4fb167ec3108 by Serhiy Storchaka in branch '2.7': Issue #23718: Fixed parsing time in week 0 before Jan 1. Original patch by https://hg.python.org/cpython/rev/4fb167ec3108 New changeset a7093386efaf by Serhiy Storchaka in branch 'default': Issue #23718: Fixed parsing time in week 0 before Jan 1. Original patch by https://hg.python.org/cpython/rev/a7093386efaf ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 12 03:55:19 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 12 Mar 2016 08:55:19 +0000 Subject: [issue23718] strptime() can produce invalid date with negative year day In-Reply-To: <1426851032.32.0.560407728917.issue23718@psf.upfronthosting.co.za> Message-ID: <1457772919.78.0.540900284633.issue23718@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Thank you Tam?s for your contribution. ---------- resolution: -> fixed stage: commit review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 12 04:29:15 2016 From: report at bugs.python.org (Ezio Melotti) Date: Sat, 12 Mar 2016 09:29:15 +0000 Subject: [issue26226] Various test suite failures on Windows In-Reply-To: <1453940751.65.0.882732529995.issue26226@psf.upfronthosting.co.za> Message-ID: <1457774955.84.0.859698281363.issue26226@psf.upfronthosting.co.za> Changes by Ezio Melotti : ---------- nosy: +ezio.melotti type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 12 04:34:15 2016 From: report at bugs.python.org (Ezio Melotti) Date: Sat, 12 Mar 2016 09:34:15 +0000 Subject: [issue26205] Inconsistency concerning nested scopes In-Reply-To: <1453774587.84.0.143729632402.issue26205@psf.upfronthosting.co.za> Message-ID: <1457775255.38.0.205317714151.issue26205@psf.upfronthosting.co.za> Changes by Ezio Melotti : ---------- nosy: +ezio.melotti type: -> enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 12 06:08:47 2016 From: report at bugs.python.org (Julien) Date: Sat, 12 Mar 2016 11:08:47 +0000 Subject: [issue26512] Vocabulary: Using "integral" in library/stdtypes.html In-Reply-To: <1457472244.72.0.113699245831.issue26512@psf.upfronthosting.co.za> Message-ID: <1457780927.1.0.749707456205.issue26512@psf.upfronthosting.co.za> Julien added the comment: Hi Martin, awesome work you've done here. I was meditating those past days about the subject and came to a similar yet not that good conclusion that the table should have the same definitions than those from [library/math.html](https://docs.python.org/3.5/library/math.html#number-theoretic-and-representation-functions). But your solution is better, copy-paste is wrong, let's just link to the right documentation, in which case, a simple list is enough, there is no need for a table. The definitions in the *library/math.html* and *library/functions.html* (for round) are perfectly clear and understandable, and properly link to number.Integral each time it's used. For the record: math.trunc(x) Return the Real value x truncated to an Integral (usually an integer). Delegates to x.__trunc__(). math.ceil(x) Return the ceiling of x, the smallest integer greater than or equal to x. If x is not a float, delegates to x.__ceil__(), which should return an Integral value. math.floor(x) Return the floor of x, the largest integer less than or equal to x. If x is not a float, delegates to x.__floor__(), which should return an Integral value. round(number[, ndigits]) Return the floating point value number rounded to ndigits digits after the decimal point. If ndigits is omitted, it returns the nearest integer to its input. Delegates to number.__round__(ndigits). For the built-in types supporting round(), values are rounded to the closest multiple of 10 to the power minus ndigits; if two multiples are equally close, rounding is done toward the even choice (so, for example, both round(0.5) and round(-0.5) are 0, and round(1.5) is 2). The return value is an integer if called with one argument, otherwise of the same type as number. Note The behavior of round() for floats can be surprising: for example, round(2.675, 2) gives 2.67 instead of the expected 2.68. This is not a bug: it?s a result of the fact that most decimal fractions can?t be represented exactly as a float. See Floating Point Arithmetic: Issues and Limitations for more information. About the docstrings not being the same as the documentation, is there a "best practice" on how it should be ? Should'nt them always be the same ? Here's a first patch to replace the table with a simple list. ---------- keywords: +patch Added file: http://bugs.python.org/file42144/stdtypes.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 12 06:30:51 2016 From: report at bugs.python.org (HyeSoo Park) Date: Sat, 12 Mar 2016 11:30:51 +0000 Subject: [issue25687] Error during test case and tearDown In-Reply-To: <1448092467.41.0.746674123801.issue25687@psf.upfronthosting.co.za> Message-ID: <1457782251.7.0.0766768555526.issue25687@psf.upfronthosting.co.za> HyeSoo Park added the comment: I added 'additional' and (thus increasing the total number of error counts.) to 'teardown' explanation of the document to make it more clear. ---------- keywords: +patch nosy: +HyeSoo Park Added file: http://bugs.python.org/file42145/issue25687.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 12 06:33:21 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 12 Mar 2016 11:33:21 +0000 Subject: [issue26512] Vocabulary: Using "integral" in library/stdtypes.html In-Reply-To: <1457472244.72.0.113699245831.issue26512@psf.upfronthosting.co.za> Message-ID: <1457782401.77.0.974929542727.issue26512@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- nosy: +jyasskin _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 12 07:42:31 2016 From: report at bugs.python.org (Varpu Rantala) Date: Sat, 12 Mar 2016 12:42:31 +0000 Subject: [issue26250] no document for sqlite3.Cursor.connection In-Reply-To: <1454262712.53.0.251399487214.issue26250@psf.upfronthosting.co.za> Message-ID: <1457786551.51.0.63035534422.issue26250@psf.upfronthosting.co.za> Varpu Rantala added the comment: The sentencing was complicated. I changed the formulation and added an example of connection. ---------- nosy: +Varpu Rantala Added file: http://bugs.python.org/file42146/issue26250.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 12 08:16:49 2016 From: report at bugs.python.org (Elena Oat) Date: Sat, 12 Mar 2016 13:16:49 +0000 Subject: [issue18859] README.valgrind should mention --with-valgrind In-Reply-To: <1377649189.0.0.381916551624.issue18859@psf.upfronthosting.co.za> Message-ID: <1457788609.44.0.0895696858968.issue18859@psf.upfronthosting.co.za> Elena Oat added the comment: I've combined the patch submitted by Sowmya and also added there clarifications from points 1, 2 mentioned by Martin Mokrejs. ---------- nosy: +Elena.Oat _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 12 08:20:01 2016 From: report at bugs.python.org (Elena Oat) Date: Sat, 12 Mar 2016 13:20:01 +0000 Subject: [issue18859] README.valgrind should mention --with-valgrind In-Reply-To: <1377649189.0.0.381916551624.issue18859@psf.upfronthosting.co.za> Message-ID: <1457788801.21.0.924427911419.issue18859@psf.upfronthosting.co.za> Changes by Elena Oat : Added file: http://bugs.python.org/file42147/issue18859.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 12 08:34:39 2016 From: report at bugs.python.org (Marc-Andre Lemburg) Date: Sat, 12 Mar 2016 13:34:39 +0000 Subject: [issue26544] platform.libc_ver() returns incorrect version number In-Reply-To: <1457742963.17.0.0403505576154.issue26544@psf.upfronthosting.co.za> Message-ID: <1457789679.62.0.458293464728.issue26544@psf.upfronthosting.co.za> Marc-Andre Lemburg added the comment: True. At the time the code was written, this was not an issue :-) Is the libc version information documented somewhere ? If so, we could probably add a better parser for it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 12 08:35:18 2016 From: report at bugs.python.org (Marc-Andre Lemburg) Date: Sat, 12 Mar 2016 13:35:18 +0000 Subject: [issue26544] platform.libc_ver() returns incorrect version number In-Reply-To: <1457742963.17.0.0403505576154.issue26544@psf.upfronthosting.co.za> Message-ID: <1457789718.42.0.27791645833.issue26544@psf.upfronthosting.co.za> Marc-Andre Lemburg added the comment: Adding other Python versions as well, since this is a bug. ---------- versions: +Python 2.7, Python 3.4, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 12 08:42:49 2016 From: report at bugs.python.org (HyeSoo Park) Date: Sat, 12 Mar 2016 13:42:49 +0000 Subject: [issue26176] EmailMessage example doesn't work In-Reply-To: <1453427916.73.0.91814079944.issue26176@psf.upfronthosting.co.za> Message-ID: <1457790169.45.0.667741094817.issue26176@psf.upfronthosting.co.za> HyeSoo Park added the comment: Could you please specify which example of the Provisional API among 2 examples of the documentation and how does it not work? Thank you ---------- nosy: +flyjwayur _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 12 08:55:48 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 12 Mar 2016 13:55:48 +0000 Subject: [issue25638] Verify the etree_parse and etree_iterparse benchmarks are working appropriately In-Reply-To: <1447702883.28.0.950037808414.issue25638@psf.upfronthosting.co.za> Message-ID: <1457790948.06.0.711688828128.issue25638@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: I am not able to find the cause of the slowdown. I think this issue can be closed now. The etree_parse and etree_iterparse benchmarks are working appropriately and showing real regression in CPython 3.x. The cause of the regression is not known. ---------- assignee: serhiy.storchaka -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 12 09:42:57 2016 From: report at bugs.python.org (Susan Sun) Date: Sat, 12 Mar 2016 14:42:57 +0000 Subject: [issue26014] Guide users to the newer package install instructions In-Reply-To: <1451999065.99.0.467691766338.issue26014@psf.upfronthosting.co.za> Message-ID: <1457793777.01.0.12058209636.issue26014@psf.upfronthosting.co.za> Susan Sun added the comment: Below two issues are fixed. * add See Also links to the modern docs from the legacy docs * append the (Legacy) suffix in the 2.x docs ---------- keywords: +patch nosy: +Susan Sun, ezio.melotti Added file: http://bugs.python.org/file42148/issue26014.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 12 09:50:06 2016 From: report at bugs.python.org (Anna Koroliuk) Date: Sat, 12 Mar 2016 14:50:06 +0000 Subject: [issue26483] docs unclear on difference between str.isdigit() and str.isdecimal() In-Reply-To: <1457121897.81.0.495681677897.issue26483@psf.upfronthosting.co.za> Message-ID: <1457794206.58.0.230212257345.issue26483@psf.upfronthosting.co.za> Anna Koroliuk added the comment: Hi, all! At Helsinki Python sprint I with the kind help of Ezio found two things. 1) This code gives results which are attached in the file. I will just now show some interesting cases where isdigit() and isdecimal() give different results. for c in map(chr, range(0x10FFFF)): if unicodedata.digit(c, None) is not None: print(c, c.isdigit(), c.isdecimal()) ... 0 True True 1 True True 2 True True ? True False ? True False ? True False ? True False ? True False ? True False ? True False ? True False ? True False ? True False So it's different commands, although for usual digits 0-9 in usual typewriting without those upper indexes etc they give same results. Full file command_comparison.txt is attached. 2) Both commands isdigit() and isdecimal() are traced back that symbol is compared to a certain tables (masks), but masks are different. For isdigit() it is DIGIT_MASK = 0x04 and for isdecimal() is DECIMAL_MASK 0x02. Here is how all the commands are traced to the mask. A) isdecimal() ./Objects/unicodeobject.c: {"isdecimal", (PyCFunction) unicode_isdecimal, METH_NOARGS, isdecimal__doc__}, ./Objects/unicodeobject.c: static PyObject* unicode_isdecimal(PyObject *self) .... if (length == 1) return PyBool_FromLong( Py_UNICODE_ISDECIMAL(PyUnicode_READ(kind, data, 0))); ./Include/unicodeobject.h:#define Py_UNICODE_ISDECIMAL(ch) _PyUnicode_IsDecimalDigit(ch) ./Objects/unicodectype.c: int _PyUnicode_IsDecimalDigit(Py_UCS4 ch) { if (_PyUnicode_ToDecimalDigit(ch) < 0) return 0; return 1; } int _PyUnicode_ToDecimalDigit(Py_UCS4 ch) { const _PyUnicode_TypeRecord *ctype = gettyperecord(ch); return (ctype->flags & DECIMAL_MASK) ? ctype->decimal : -1; } ./Objects/unicodectype.c:#define DECIMAL_MASK 0x02 B) isdigit() ./Objects/unicodeobject.c: {"isdigit", (PyCFunction) unicode_isdigit, METH_NOARGS, isdigit__doc__}, ./Objects/unicodeobject.c: static PyObject* unicode_isdigit(PyObject *self) ... if (length == 1) { const Py_UCS4 ch = PyUnicode_READ(kind, data, 0); return PyBool_FromLong(Py_UNICODE_ISDIGIT(ch)); } ./Include/unicodeobject.h:#define Py_UNICODE_ISDIGIT(ch) _PyUnicode_IsDigit(ch) ./Objects/unicodectype.c: int _PyUnicode_IsDigit(Py_UCS4 ch) { if (_PyUnicode_ToDigit(ch) < 0) return 0; return 1; } int _PyUnicode_ToDigit(Py_UCS4 ch) { const _PyUnicode_TypeRecord *ctype = gettyperecord(ch); return (ctype->flags & DIGIT_MASK) ? ctype->digit : -1; } ./Tools/unicode/makeunicodedata.py:DIGIT_MASK = 0x04 BR, Anna ---------- nosy: +Anna Koroliuk Added file: http://bugs.python.org/file42149/command_comparison.txt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 12 09:50:24 2016 From: report at bugs.python.org (Julien) Date: Sat, 12 Mar 2016 14:50:24 +0000 Subject: [issue26546] Provide translated french translation on docs.python.org Message-ID: <1457794223.79.0.618185263259.issue26546@psf.upfronthosting.co.za> New submission from Julien: Hi, The [french translation of the Python documentation](https://github.com/afpy/python_doc_fr) just hit a 21% coverage in terms of pageviews (According to statistics [nicely provided by EWDurbin](https://github.com/AFPy/python_doc_fr/issues/32#issuecomment-195071379)). (It's 14% of the total strings to translate). I think it may be a good time to push the translation to *docs.python.org*, so french speaking people will be able to find it naturally, and more translators will be aware of it, increasing the translation speed. Also it will probably motivate other translations (http://docs.python.jp/3/, http://docs.python.org.ar/tutorial/3/index.html, others ?) to work in a more standardized ways, and make their translations more discoverable. So there's two discussions to have: The URL, and the "how". # URL I think the only reasonable possibility is *docs.python.org/{country_code}/* Having a CCTLD per translation is near impossible (a LOT or work and highly time consuming) as some domains are unavailable like python.fr and some other have high restrictions like having a physical presence in the country (like python.ca, python.pt.br) or having a commercial relation with a local company like for python.com.tr). Also it allows localization via *docs.python.org/fr_FR/* even if I don't think we need it soon. If you have other ideas, better than *docs.python.org/fr/*, that's why this issue is opened. # How to We have a [Makefile](https://github.com/AFPy/python_doc_fr/blob/master/Makefile) which like [docsbuild-scripts](https://github.com/python/docsbuild-scripts) delegates naturally most of its work to the sphinx Makefile in *Doc/Makefile*, and is capable of building french versions of 2.7, 3.3, 3.4, and 3.5 in a simple invocation of `make build_all MODE=autobuild-stable` (cloning itself from the github repository, applying various patches (typically to configure sphinx to generate french). 3.2 is also possible but not built by default (no autobuild-html in its sphinx Makefile). I think docsbuild-scripts may delegate the french generation by simply cloning/updating our repository and calling our makefile. A patch (attached) will be necessary in docsbuild-scripts to copy generated doc to /fr/ and send purges to the CDN. Finally, once all this is running, we'll start a discussion about cross-linking both documentations, probably reopening https://github.com/sphinx-doc/sphinx/issues/1246. ---------- assignee: docs at python components: Documentation files: build_doc_fr.patch keywords: patch messages: 261654 nosy: benjamin.peterson, docs at python, sizeof priority: normal severity: normal status: open title: Provide translated french translation on docs.python.org type: enhancement Added file: http://bugs.python.org/file42150/build_doc_fr.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 12 09:58:21 2016 From: report at bugs.python.org (Ezio Melotti) Date: Sat, 12 Mar 2016 14:58:21 +0000 Subject: [issue26226] Various test suite failures on Windows In-Reply-To: <1453940751.65.0.882732529995.issue26226@psf.upfronthosting.co.za> Message-ID: <1457794701.55.0.700117439482.issue26226@psf.upfronthosting.co.za> Ezio Melotti added the comment: > I'm surprised by the test_codecencodings_iso2022 failures. Example: ====================================================================== FAIL: test_incrementaldecoder (test.test_codecencodings_iso2022.Test_ISO2022_KR) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\GitHub\cpython\lib\test\multibytecodec_support.py", line 208, in test_incrementaldecoder self.assertEqual(ostream.getvalue(), self.tstring[1]) AssertionError: b'\xe[334 chars]\x80\n\xed\x9a\xa8\xec\x9c\xa8\xec\xa0\x81\xec[1668 chars]4.\n' != b'\xe[334 chars]\x80\r\n\xed\x9a\xa8\xec\x9c\xa8\xec\xa0\x81\x[1682 chars]\r\n' I run into this problem during a sprint, with a machine that was also running Windows and cloned from the git repo. Those bytes are read from txt files in the test/cjkencodings dir, and they are marked as binary files in .hgeol. Since git ignores .hgeol and treats them as text files, it also changes the newline to \r\n causing the failure. The tests pass without problems after cloning with Mercurial. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 12 10:09:18 2016 From: report at bugs.python.org (Ezio Melotti) Date: Sat, 12 Mar 2016 15:09:18 +0000 Subject: [issue25687] Error during test case and tearDown In-Reply-To: <1448092467.41.0.746674123801.issue25687@psf.upfronthosting.co.za> Message-ID: <1457795358.89.0.187531031222.issue25687@psf.upfronthosting.co.za> Changes by Ezio Melotti : ---------- assignee: -> ezio.melotti stage: needs patch -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 12 10:36:22 2016 From: report at bugs.python.org (SilentGhost) Date: Sat, 12 Mar 2016 15:36:22 +0000 Subject: [issue26499] http.client.IncompleteRead from HTTPResponse read after part reading file In-Reply-To: <1457345453.59.0.0327827539319.issue26499@psf.upfronthosting.co.za> Message-ID: <1457796982.44.0.188464698199.issue26499@psf.upfronthosting.co.za> SilentGhost added the comment: OK, here is the patch including the tests that seem to exercise the behaviour. ---------- Added file: http://bugs.python.org/file42151/issue26499_4.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 12 11:08:01 2016 From: report at bugs.python.org (Roundup Robot) Date: Sat, 12 Mar 2016 16:08:01 +0000 Subject: [issue26513] platform.win32_ver() broken in 2.7.11 In-Reply-To: <1457473293.66.0.928061603359.issue26513@psf.upfronthosting.co.za> Message-ID: <20160312160757.2560.88700@psf.io> Roundup Robot added the comment: New changeset 5564cf3ba523 by Steve Dower in branch '3.5': Issue #26513: Fixes platform module detection of Windows Server https://hg.python.org/cpython/rev/5564cf3ba523 New changeset 9db5846f126d by Steve Dower in branch '2.7': Issue #26513: Fixes platform module detection of Windows Server https://hg.python.org/cpython/rev/9db5846f126d New changeset fabbfad67362 by Steve Dower in branch 'default': Issue #26513: Fixes platform module detection of Windows Server https://hg.python.org/cpython/rev/fabbfad67362 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 12 11:08:22 2016 From: report at bugs.python.org (Steve Dower) Date: Sat, 12 Mar 2016 16:08:22 +0000 Subject: [issue26513] platform.win32_ver() broken in 2.7.11 In-Reply-To: <1457473293.66.0.928061603359.issue26513@psf.upfronthosting.co.za> Message-ID: <1457798902.2.0.794115034894.issue26513@psf.upfronthosting.co.za> Changes by Steve Dower : ---------- resolution: -> fixed stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 12 11:10:46 2016 From: report at bugs.python.org (Steve Dower) Date: Sat, 12 Mar 2016 16:10:46 +0000 Subject: [issue19450] Bug in sqlite in Windows binaries In-Reply-To: <1383131558.55.0.853606379194.issue19450@psf.upfronthosting.co.za> Message-ID: <1457799046.84.0.483602284153.issue19450@psf.upfronthosting.co.za> Steve Dower added the comment: Assigning to Benjamin to make the call for 2.7. Either close or assign it back if you want the update. ---------- assignee: steve.dower -> benjamin.peterson versions: -Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 12 11:26:50 2016 From: report at bugs.python.org (Roundup Robot) Date: Sat, 12 Mar 2016 16:26:50 +0000 Subject: [issue23606] ctypes.util.find_library("c") no longer makes sense In-Reply-To: <1425789670.0.0.736264667252.issue23606@psf.upfronthosting.co.za> Message-ID: <20160312162647.45780.86976@psf.io> Roundup Robot added the comment: New changeset f9dc71b566fb by Steve Dower in branch '3.5': Issue #23606: Adds note to ctypes documentation regarding cdll.msvcrt. https://hg.python.org/cpython/rev/f9dc71b566fb New changeset 6d84fe4d8cb0 by Steve Dower in branch 'default': Issue #23606: Adds note to ctypes documentation regarding cdll.msvcrt. https://hg.python.org/cpython/rev/6d84fe4d8cb0 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 12 11:30:06 2016 From: report at bugs.python.org (Steve Dower) Date: Sat, 12 Mar 2016 16:30:06 +0000 Subject: [issue23606] ctypes.util.find_library("c") no longer makes sense In-Reply-To: <1425789670.0.0.736264667252.issue23606@psf.upfronthosting.co.za> Message-ID: <1457800206.16.0.681210502906.issue23606@psf.upfronthosting.co.za> Steve Dower added the comment: That's a bit too much of a tangent for me to note in-place in the docs, but it'd be good content for a "Best practices" section (I seem to recall we had one somewhere, that basically started with "avoid ctypes if possible"...) Given we've heard no feedback about this change (well, I've heard no feedback - if anyone else has please let me know) I'm going to consider this closed. ---------- resolution: -> fixed stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 12 11:39:23 2016 From: report at bugs.python.org (Roundup Robot) Date: Sat, 12 Mar 2016 16:39:23 +0000 Subject: [issue26079] Build with Visual Studio 2015 using PlatformToolset=v120 In-Reply-To: <1452519280.93.0.432725713668.issue26079@psf.upfronthosting.co.za> Message-ID: <20160312163918.10714.65330@psf.io> Roundup Robot added the comment: New changeset 7617f5b3f263 by Steve Dower in branch '3.5': Issue #26079: Fixing the build output folder for tix-8.4.3.6. Patch by Bjoern Thiel. https://hg.python.org/cpython/rev/7617f5b3f263 New changeset f426178c9d6c by Steve Dower in branch 'default': Issue #26079: Fixing the build output folder for tix-8.4.3.6. Patch by Bjoern Thiel. https://hg.python.org/cpython/rev/f426178c9d6c ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 12 11:40:49 2016 From: report at bugs.python.org (Steve Dower) Date: Sat, 12 Mar 2016 16:40:49 +0000 Subject: [issue26079] Build with Visual Studio 2015 using PlatformToolset=v120 In-Reply-To: <1452519280.93.0.432725713668.issue26079@psf.upfronthosting.co.za> Message-ID: <1457800849.42.0.374504912402.issue26079@psf.upfronthosting.co.za> Steve Dower added the comment: Python 2.7 has a different section in its tcltk.props file and doesn't need this fix (yet). Thanks for the patch, Bjoern! ---------- resolution: -> fixed stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 12 12:21:48 2016 From: report at bugs.python.org (Brett Cannon) Date: Sat, 12 Mar 2016 17:21:48 +0000 Subject: [issue25638] Verify the etree_parse and etree_iterparse benchmarks are working appropriately In-Reply-To: <1447702883.28.0.950037808414.issue25638@psf.upfronthosting.co.za> Message-ID: <1457803308.91.0.138484509703.issue25638@psf.upfronthosting.co.za> Changes by Brett Cannon : ---------- resolution: -> not a bug status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 12 16:31:15 2016 From: report at bugs.python.org (Julien) Date: Sat, 12 Mar 2016 21:31:15 +0000 Subject: [issue26483] docs unclear on difference between str.isdigit() and str.isdecimal() In-Reply-To: <1457121897.81.0.495681677897.issue26483@psf.upfronthosting.co.za> Message-ID: <1457818275.65.0.809023061424.issue26483@psf.upfronthosting.co.za> Julien added the comment: To dig further, the DIGIT_MASK and DECIMAL_MASK used in `unicodeobject.c` are from `unicodectype.c` and they match values from `unicodetype_db.h` witch is generated by `Tools/unicode/makeunicodedata.py` which built those masks this way: # decimal digit, integer digit decimal = 0 if record[6]: flags |= DECIMAL_MASK decimal = int(record[6]) digit = 0 if record[7]: flags |= DIGIT_MASK digit = int(record[7]) if record[8]: flags |= NUMERIC_MASK numeric.setdefault(record[8], []).append(char) Those "record"s are documented in ftp://unicode.org/Public/3.2-Update/UnicodeData-3.2.0.html in which fields 6, 7, and 8 are: - 6 Decimal digit value N This is a numeric field. If the character has the decimal digit property, as specified in Chapter 4 of the Unicode Standard, the value of that digit is represented with an integer value in this field - 7 Digit value N This is a numeric field. If the character represents a digit, not necessarily a decimal digit, the value is here. This covers digits which do not form decimal radix forms, such as the compatibility superscript digits - 8 Numeric value N This is a numeric field. If the character has the numeric property, as specified in Chapter 4 of the Unicode Standard, the value of that character is represented with an integer or rational number in this field. This includes fractions as, e.g., "1/5" for U+2155 VULGAR FRACTION ONE FIFTH Also included are numerical values for compatibility characters such as circled numbers. Which is very close of the actual documentation. Yet the documentation is misleading using "This category includes digit characters" in the "isdecimal" documentation. Posssible rewriting: isdecimal: Return true if all characters in the string are decimal characters and there is at least one character, false otherwise. Decimal characters are those that can be used to form decimal-radix numbers, e.g. U+0660, ARABIC-INDIC DIGIT ZERO. Formally a decimal character is a character in the Unicode General Category "Nd". isdigit: Return true if all characters in the string are digits and there is at least one character, false otherwise. Digits include decimal characters and digits that need special handling, such as the compatibility superscript digits. This covers digits which do not form decimal radix forms. Formally, a digit is a character that has the property value Numeric_Type=Digit or Numeric_Type=Decimal. I don't think we can refactor more than this without rewriting documentation for isnumeric which mentions the Unicode standard the same way. ---------- nosy: +sizeof _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 12 16:36:07 2016 From: report at bugs.python.org (Julien) Date: Sat, 12 Mar 2016 21:36:07 +0000 Subject: [issue26176] EmailMessage example doesn't work In-Reply-To: <1453427916.73.0.91814079944.issue26176@psf.upfronthosting.co.za> Message-ID: <1457818567.85.0.969960764192.issue26176@psf.upfronthosting.co.za> Julien added the comment: Is this your bug: Traceback (most recent call last): File "/tmp/email_example.py", line 9, in with open(textfile) as fp: NameError: name 'textfile' is not defined ? If not, can you please provide us the full traceback ? ---------- nosy: +sizeof _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 12 17:23:24 2016 From: report at bugs.python.org (Julien) Date: Sat, 12 Mar 2016 22:23:24 +0000 Subject: [issue26547] Undocumented use of the term dictproxy in vars() documentation Message-ID: <1457821404.83.0.465984707802.issue26547@psf.upfronthosting.co.za> New submission from Julien: I spotted un undocumented term here : https://docs.python.org/3.5/library/functions.html#vars in: "Objects such as modules and instances have an updateable __dict__ attribute; however, other objects may have write restrictions on their __dict__ attributes (for example, classes use a dictproxy to prevent direct dictionary updates)." The term "dictproxy" is not documented anywhere in the documentation, I assume it's a https://docs.python.org/3.4/library/types.html#types.MappingProxyType, which is right: >>> class Foo(): ... pass ... >>> vars(Foo) mappingproxy({'__doc__': None, '__weakref__': , '__dict__': , '__module__': '__main__'}) So I propose a patch to link to it via a :class:`dictproxy `. Should we leave "dictproxy" or change it to "mappingproxy" ? ---------- assignee: docs at python components: Documentation files: dictproxy.patch keywords: patch messages: 261665 nosy: docs at python, sizeof priority: normal severity: normal status: open title: Undocumented use of the term dictproxy in vars() documentation type: enhancement Added file: http://bugs.python.org/file42152/dictproxy.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 12 17:39:30 2016 From: report at bugs.python.org (Eryk Sun) Date: Sat, 12 Mar 2016 22:39:30 +0000 Subject: [issue23606] ctypes.util.find_library("c") no longer makes sense In-Reply-To: <1425789670.0.0.736264667252.issue23606@psf.upfronthosting.co.za> Message-ID: <1457822370.85.0.87042140923.issue23606@psf.upfronthosting.co.za> Eryk Sun added the comment: I occasionally come across code snippets on Stack Overflow, and projects such as win-unicode-console (IIRC), that use ctypes to work with C stdio FILE streams (sometimes for dubious reasons, such as a DLL API that uses FILE streams). Maybe the _ctypes extension module could provide void pointers for the current C stdin, stdout, and stderr -- as well as stdio functions such as fflush, fopen, and freopen. This is already done with _ctypes._memmove_addr and _ctypes._memset_addr. However, getting the current standard stream pointers would need to use a callable or descriptor. > it'd be good content for a "Best practices" section The tutorial itself is outdated in places and doesn't promote best practices. For example, it assigns a ValidHandle function to windll.kernel32.GetModuleHandleA.restype, which would affect every module that uses windll.kernel32. Also, this ValidHandle example is bogus, as is every example in the tutorial that uses GetModuleHandle without setting restype to a pointer type such as c_void_p. It's truncating 64-bit pointers to 32-bit int values. You just need to try a DLL that loads at a high address: >>> kernel32.GetModuleHandleA(b'advapi32') -27590656 >>> def ValidHandle(value): ... if value == 0: ... raise WinError() ... return value ... >>> kernel32.GetModuleHandleA.restype = ValidHandle >>> kernel32.GetModuleHandleA(b'advapi32') -27590656 >>> hex(kernel32.GetModuleHandleA(b'advapi32') & 2**32-1) '0xfe5b0000' >>> kernel32.GetModuleHandleA.restype = c_void_p >>> hex(kernel32.GetModuleHandleA(b'advapi32')) '0x7fefe5b0000' ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 12 17:44:26 2016 From: report at bugs.python.org (Julien) Date: Sat, 12 Mar 2016 22:44:26 +0000 Subject: [issue26548] Probably missing word in a sentence in the doc of bitwise operations on integer types Message-ID: <1457822666.05.0.586831290634.issue26548@psf.upfronthosting.co.za> New submission from Julien: In https://docs.python.org/3.5/library/stdtypes.html#bitwise-operations-on-integer-types the sentence "this assumes a sufficiently large number of bits that no overflow occurs during the operation" looks wrong to me, so I asked on #python and got from @benzrf: "this assumes that there are sufficiently many bits for no overflow to occur during the operation" Which looks better to me. ---------- assignee: docs at python components: Documentation messages: 261667 nosy: docs at python, sizeof priority: normal severity: normal status: open title: Probably missing word in a sentence in the doc of bitwise operations on integer types type: enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 12 17:45:45 2016 From: report at bugs.python.org (Antti Haapala) Date: Sat, 12 Mar 2016 22:45:45 +0000 Subject: [issue26549] co_stacksize is calculated from unoptimized code Message-ID: <1457822745.22.0.972836245522.issue26549@psf.upfronthosting.co.za> New submission from Antti Haapala: When answering a question on StackOverflow, I noticed that a function that only loads a constant tuple to a local variable still has a large `co_stacksize` as if it was built with BUILD_TUPLE. e.g. >>> def foo(): ... a = (1,2,3,4,5,6,7,8,9,10) ... >>> foo.__code__.co_stacksize 10 >>> dis.dis(foo) 2 0 LOAD_CONST 11 ((1, 2, 3, 4, 5, 6, 7, 8, 9, 10)) 3 STORE_FAST 0 (a) 6 LOAD_CONST 0 (None) 9 RETURN_VALUE I suspect it is because in the `makecode` the stack usage is calculated from the unoptimized assembler output instead of the actual optimized bytecode. I do not know if there is any optimization that would increase the stack usage, but perhaps it should be calculated from the resulting output. ---------- components: Interpreter Core messages: 261668 nosy: ztane priority: normal severity: normal status: open title: co_stacksize is calculated from unoptimized code versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 12 19:41:39 2016 From: report at bugs.python.org (Mark Lawrence) Date: Sun, 13 Mar 2016 00:41:39 +0000 Subject: [issue19450] Bug in sqlite in Windows binaries In-Reply-To: <1383131558.55.0.853606379194.issue19450@psf.upfronthosting.co.za> Message-ID: <1457829699.84.0.607565896348.issue19450@psf.upfronthosting.co.za> Changes by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 12 20:24:08 2016 From: report at bugs.python.org (Berker Peksag) Date: Sun, 13 Mar 2016 01:24:08 +0000 Subject: [issue747320] rfc2822 formatdate functionality duplication Message-ID: <1457832248.91.0.756905531097.issue747320@psf.upfronthosting.co.za> Berker Peksag added the comment: - now = time.time() - year, month, day, hh, mm, ss, x, y, z = time.localtime(now) - s = "%02d/%3s/%04d %02d:%02d:%02d" % ( - day, self.monthname[month], year, hh, mm, ss) + s = time.strftime("%d/%b/%Y %H:%M:%S", time.localtime()) This part of the patch is incorrect. time.strftime() will return non-English values for different locales. About deprecations of weekdayname and monthname attributes: I know that they are undocumented, but they are already being used in the wild. For example, see https://github.com/natemago/srv/blob/master/srv.py#L419 Since we don't have any public API for this use case, I'd be +1 to keep them for now. Here is an updated patch. ---------- Added file: http://bugs.python.org/file42153/issue747320_v2.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 00:28:19 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 13 Mar 2016 05:28:19 +0000 Subject: [issue26547] Undocumented use of the term dictproxy in vars() documentation In-Reply-To: <1457821404.83.0.465984707802.issue26547@psf.upfronthosting.co.za> Message-ID: <1457846899.36.0.219691005608.issue26547@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: I would add a space between "dict" and "proxy". ---------- nosy: +martin.panter, serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 00:44:29 2016 From: report at bugs.python.org (Alejandro Soini) Date: Sun, 13 Mar 2016 05:44:29 +0000 Subject: [issue26550] documentation minor issue : "Step back: WSGI" section from "HOWTO Use Python in the web" Message-ID: <1457847869.95.0.52045610793.issue26550@psf.upfronthosting.co.za> New submission from Alejandro Soini: Bad article usage in the following sentence from the WSGI section on HOWTO Use Python in the web (https://docs.python.org/2/howto/webservers.html#wsgi) : "Authentication is another a problem easily solved using existing middleware." suggested change: "Authentication is another problem that is easily solved using existing middleware." ---------- assignee: docs at python components: Documentation messages: 261671 nosy: Alejandro Soini, docs at python priority: normal severity: normal status: open title: documentation minor issue : "Step back: WSGI" section from "HOWTO Use Python in the web" 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 Sun Mar 13 01:02:01 2016 From: report at bugs.python.org (Martin Panter) Date: Sun, 13 Mar 2016 06:02:01 +0000 Subject: [issue23214] BufferedReader.read1(size) signature incompatible with BufferedIOBase.read1(size=-1) In-Reply-To: <1420854382.8.0.44417983014.issue23214@psf.upfronthosting.co.za> Message-ID: <1457848921.52.0.892118922102.issue23214@psf.upfronthosting.co.za> Martin Panter added the comment: Looking at this again, I think a less intrusive way forward would be to: * Document that in 3.6, the required signature is now BufferedIOBase.read1(size). An implementation no longer has to provide a default size, and no longer has to accept negative sizes. * Explicitly document the behaviour of each concrete implementation like GzipFile.read1(-1) etc, if this behaviour is intentional * Fix the BufferedReader error so that ?read length must not be negative? Relaxing the read1() signature would allow wider or easier use of BufferedReader, e.g. to implement HTTPResponse as I suggested in Issue 26499. The advantage would be using existing code that is well tested, used, optimized, etc, rather than a custom BufferedIOBase implementation which for the HTTP case is buggy. ---------- versions: +Python 3.6 -Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 01:08:19 2016 From: report at bugs.python.org (Martin Panter) Date: Sun, 13 Mar 2016 06:08:19 +0000 Subject: [issue26499] http.client.IncompleteRead from HTTPResponse read after part reading file In-Reply-To: <1457345453.59.0.0327827539319.issue26499@psf.upfronthosting.co.za> Message-ID: <1457849299.72.0.803992499791.issue26499@psf.upfronthosting.co.za> Martin Panter added the comment: Thanks Silent Ghost, this patch looks pretty good. I did leave a couple more comments. Also I just realized that HTTPResponse.readline() and read1() are not really documented. The BufferedIOBase support was meant to be added in 3.5, although readline() was supposed to be supported earlier for urlopen() compatibility. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 01:40:20 2016 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 13 Mar 2016 06:40:20 +0000 Subject: [issue26314] interned strings are stored in a dict, a set would use less memory In-Reply-To: <1454964166.73.0.652183434251.issue26314@psf.upfronthosting.co.za> Message-ID: <1457851220.92.0.286957591362.issue26314@psf.upfronthosting.co.za> Raymond Hettinger added the comment: I agree with Serhiy that this should not be done. IIRC, there were some discussions on python-dev or python-ideas about using sets for interning and the judgment was the dicts are conceptually the right type and that using sets would be hack. The other thought was that while a set is generally two-thirds the size of dict, the bulk of the space is for the interned strings themselves. ---------- assignee: -> rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 01:48:48 2016 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 13 Mar 2016 06:48:48 +0000 Subject: [issue26548] Probably missing word in a sentence in the doc of bitwise operations on integer types In-Reply-To: <1457822666.05.0.586831290634.issue26548@psf.upfronthosting.co.za> Message-ID: <1457851728.49.0.509328223625.issue26548@psf.upfronthosting.co.za> Changes by Raymond Hettinger : ---------- assignee: docs at python -> rhettinger nosy: +rhettinger priority: normal -> low _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 01:58:54 2016 From: report at bugs.python.org (Roundup Robot) Date: Sun, 13 Mar 2016 06:58:54 +0000 Subject: [issue26548] Probably missing word in a sentence in the doc of bitwise operations on integer types In-Reply-To: <1457822666.05.0.586831290634.issue26548@psf.upfronthosting.co.za> Message-ID: <20160313065850.118695.73657@psf.io> Roundup Robot added the comment: New changeset b9256d5f1ab4 by Raymond Hettinger in branch '3.5': Issue #26548: Minor fix to awkward wording in docs https://hg.python.org/cpython/rev/b9256d5f1ab4 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 01:59:42 2016 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 13 Mar 2016 06:59:42 +0000 Subject: [issue26548] Probably missing word in a sentence in the doc of bitwise operations on integer types In-Reply-To: <1457822666.05.0.586831290634.issue26548@psf.upfronthosting.co.za> Message-ID: <1457852382.49.0.448294997792.issue26548@psf.upfronthosting.co.za> Changes by Raymond Hettinger : ---------- resolution: -> fixed status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 03:02:52 2016 From: report at bugs.python.org (Gregory P. Smith) Date: Sun, 13 Mar 2016 07:02:52 +0000 Subject: [issue26314] interned strings are stored in a dict, a set would use less memory In-Reply-To: <1454964166.73.0.652183434251.issue26314@psf.upfronthosting.co.za> Message-ID: <1457852572.28.0.0518632075181.issue26314@psf.upfronthosting.co.za> Gregory P. Smith added the comment: The space for the strings is a fixed cost, the structure used to store them for efficient lookup is the only overhead that can be trimmed and is all in one contiguous allocation. regardless, i agree, this isn't a large savings. priority low, feel free to drop if it you want. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 03:09:02 2016 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 13 Mar 2016 07:09:02 +0000 Subject: [issue26512] Vocabulary: Using "integral" in library/stdtypes.html In-Reply-To: <1457472244.72.0.113699245831.issue26512@psf.upfronthosting.co.za> Message-ID: <1457852942.05.0.318807562542.issue26512@psf.upfronthosting.co.za> Raymond Hettinger added the comment: I don't think taking the table out makes the docs better. It just removes a source of information just because the OP stumbled on the word "integral" which has both a standard (albeit erudite) meaning in Engligh and a precise meaning in the context of PEP-3141. I recommend leaving the table as-is and linking to the PEP or to the numbers module so that an interested person can delved deeper if needed. The table communicates a central concept that there are differences in the several ways to convert a float to an integer. ---------- assignee: docs at python -> rhettinger nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 03:12:50 2016 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 13 Mar 2016 07:12:50 +0000 Subject: [issue26511] Add link to id() built-in in comparison operator documentation for "is" In-Reply-To: <1457451562.01.0.849547274402.issue26511@psf.upfronthosting.co.za> Message-ID: <1457853170.39.0.815534240563.issue26511@psf.upfronthosting.co.za> Raymond Hettinger added the comment: I agree with the OP that is would be useful to link to id(). I also concur with Terry that integer caching is to remain an undocumented implementation specific detail (just an optimization). Also, Martin is correct that the proposed wording doesn't read well. ---------- assignee: docs at python -> rhettinger nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 03:14:56 2016 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 13 Mar 2016 07:14:56 +0000 Subject: [issue26535] Minor typo in the docs for struct.unpack In-Reply-To: <1457664319.61.0.475981364973.issue26535@psf.upfronthosting.co.za> Message-ID: <1457853296.33.0.347107126841.issue26535@psf.upfronthosting.co.za> Raymond Hettinger added the comment: The proposed wording looks fine. ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 03:17:06 2016 From: report at bugs.python.org (Ezio Melotti) Date: Sun, 13 Mar 2016 07:17:06 +0000 Subject: [issue26511] Add link to id() built-in in comparison operator documentation for "is" In-Reply-To: <1457451562.01.0.849547274402.issue26511@psf.upfronthosting.co.za> Message-ID: <1457853426.51.0.503541594163.issue26511@psf.upfronthosting.co.za> Changes by Ezio Melotti : ---------- keywords: +easy nosy: +ezio.melotti _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 03:21:42 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 13 Mar 2016 07:21:42 +0000 Subject: [issue26314] interned strings are stored in a dict, a set would use less memory In-Reply-To: <1454964166.73.0.652183434251.issue26314@psf.upfronthosting.co.za> Message-ID: <1457853702.72.0.186108460083.issue26314@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Since interned strings table can only grow and contains exact strings, other data structure may be more appropriate (for example Modules/hashtable.c). But for now status quo is good to me. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 03:22:27 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 13 Mar 2016 07:22:27 +0000 Subject: [issue26535] Minor typo in the docs for struct.unpack In-Reply-To: <1457664319.61.0.475981364973.issue26535@psf.upfronthosting.co.za> Message-ID: <1457853747.1.0.426834542787.issue26535@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- nosy: +pitrou _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 03:22:35 2016 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 13 Mar 2016 07:22:35 +0000 Subject: [issue26545] os.walk is limited by python's recursion limit In-Reply-To: <1457744340.04.0.931517157669.issue26545@psf.upfronthosting.co.za> Message-ID: <1457853755.27.0.710279856241.issue26545@psf.upfronthosting.co.za> Raymond Hettinger added the comment: I think the code should be left as-is (we've used some variation of recursion for walking a very long time with no reported real-world problems). Perhaps a documentation note can be added to the effect that the there is a recursion limit and that it can be changed by the user if needed. ---------- assignee: -> docs at python components: +Documentation -Library (Lib) nosy: +docs at python, rhettinger priority: normal -> low _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 03:23:07 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 13 Mar 2016 07:23:07 +0000 Subject: [issue26535] Minor typo in the docs for struct.unpack In-Reply-To: <1457664319.61.0.475981364973.issue26535@psf.upfronthosting.co.za> Message-ID: <1457853787.52.0.873298938746.issue26535@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- stage: patch review -> needs patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 03:24:51 2016 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 13 Mar 2016 07:24:51 +0000 Subject: [issue26525] Documentation of ord(c) easy to misread In-Reply-To: <1457599892.41.0.987128084347.issue26525@psf.upfronthosting.co.za> Message-ID: <1457853891.17.0.102138693749.issue26525@psf.upfronthosting.co.za> Raymond Hettinger added the comment: I concur that the Euro sign would be best (more recognizable and more likely to be renderable in a given font). ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 03:27:36 2016 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 13 Mar 2016 07:27:36 +0000 Subject: [issue26495] super() does not work in nested functions, genexps, listcomps, and gives misleading exceptions In-Reply-To: <1457290649.73.0.734693015263.issue26495@psf.upfronthosting.co.za> Message-ID: <1457854056.55.0.158943534129.issue26495@psf.upfronthosting.co.za> Changes by Raymond Hettinger : ---------- Removed message: http://bugs.python.org/msg261264 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 03:42:56 2016 From: report at bugs.python.org (Roundup Robot) Date: Sun, 13 Mar 2016 07:42:56 +0000 Subject: [issue25687] Error during test case and tearDown In-Reply-To: <1448092467.41.0.746674123801.issue25687@psf.upfronthosting.co.za> Message-ID: <20160313074252.45762.29651@psf.io> Roundup Robot added the comment: New changeset cecd39887faa by Ezio Melotti in branch '3.5': #25687: clarify that errors in tearDown increase the total number of reported errors. Initial patch by HyeSoo Park. https://hg.python.org/cpython/rev/cecd39887faa New changeset d5f5a6f514f2 by Ezio Melotti in branch 'default': #25687: merge with 3.5. https://hg.python.org/cpython/rev/d5f5a6f514f2 New changeset 5e64ffe576a9 by Ezio Melotti in branch '2.7': #25687: clarify that errors in tearDown increase the total number of reported errors. Initial patch by HyeSoo Park. https://hg.python.org/cpython/rev/5e64ffe576a9 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 03:44:00 2016 From: report at bugs.python.org (Ezio Melotti) Date: Sun, 13 Mar 2016 07:44:00 +0000 Subject: [issue25687] Error during test case and tearDown In-Reply-To: <1448092467.41.0.746674123801.issue25687@psf.upfronthosting.co.za> Message-ID: <1457855040.7.0.122118573996.issue25687@psf.upfronthosting.co.za> Ezio Melotti added the comment: Fixed, thanks for the report and the patch! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 03:44:24 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 13 Mar 2016 07:44:24 +0000 Subject: [issue23214] BufferedReader.read1(size) signature incompatible with BufferedIOBase.read1(size=-1) In-Reply-To: <1420854382.8.0.44417983014.issue23214@psf.upfronthosting.co.za> Message-ID: <1457855064.14.0.134037475462.issue23214@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Shouldn't read1(-1) be the same as read1(sys.maxsize)? I.e. read from a buffer without limit. ---------- nosy: +benjamin.peterson, pitrou, serhiy.storchaka, stutzbach _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 03:56:10 2016 From: report at bugs.python.org (Martin Panter) Date: Sun, 13 Mar 2016 07:56:10 +0000 Subject: [issue26547] Undocumented use of the term dictproxy in vars() documentation In-Reply-To: <1457821404.83.0.465984707802.issue26547@psf.upfronthosting.co.za> Message-ID: <1457855770.11.0.525324959146.issue26547@psf.upfronthosting.co.za> Martin Panter added the comment: In Python 2, the class was called ?dictproxy?, the repr() used ?dict_proxy? with an underscore, and it is exposed as types.DictProxyType. So I guess that is where the term comes from. In Python 3.3, Issue 14386 renamed the class and repr() to ?mappingproxy?, and re-introduced it to types as MappingProxyType. (DictProxyType was previously removed in revision 15649aef2db5.) So in Python 3 I would probably change it from ?dictproxy? to a types.MappingProxyType link. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 04:58:31 2016 From: report at bugs.python.org (Martin Panter) Date: Sun, 13 Mar 2016 08:58:31 +0000 Subject: [issue26512] Vocabulary: Using "integral" in library/stdtypes.html In-Reply-To: <1457472244.72.0.113699245831.issue26512@psf.upfronthosting.co.za> Message-ID: <1457859511.12.0.638923782831.issue26512@psf.upfronthosting.co.za> Martin Panter added the comment: Julien: I tend to keep doc strings rather concise. Just mention the main points, not all the obscure corner cases or examples. In this case I would probably just change ?int? to ?integer? (lowercase) or ?numbers.Integral? if you want to be specific. You might also want to change ?integral value? ? ?integer?. Raymond: If you want to keep the table, please also fix the ?integral float? references in Python 3 as well. Also see footnote (3) for the previous table, which also covers rounding. I would still suggest to remove the empty ?Notes? column. If there are any details worthy of footnotes, they should be added to the main documentation, not this table. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 05:43:04 2016 From: report at bugs.python.org (Roundup Robot) Date: Sun, 13 Mar 2016 09:43:04 +0000 Subject: [issue24918] Docs layout bug In-Reply-To: <1440361207.71.0.0873906255469.issue24918@psf.upfronthosting.co.za> Message-ID: <20160313094300.20929.67854@psf.io> Roundup Robot added the comment: New changeset 78e9c18d3e5b by Ezio Melotti in branch '3.5': #24918: fix CSS for code blocks when a side box is present. Patch by Manvi B. https://hg.python.org/cpython/rev/78e9c18d3e5b New changeset 444d80ae123e by Ezio Melotti in branch 'default': #24918: merge with 3.5. https://hg.python.org/cpython/rev/444d80ae123e New changeset e3833106f612 by Ezio Melotti in branch '2.7': #24918: fix CSS for code blocks when a side box is present. Patch by Manvi B. https://hg.python.org/cpython/rev/e3833106f612 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 05:44:42 2016 From: report at bugs.python.org (Ezio Melotti) Date: Sun, 13 Mar 2016 09:44:42 +0000 Subject: [issue24918] Docs layout bug In-Reply-To: <1440361207.71.0.0873906255469.issue24918@psf.upfronthosting.co.za> Message-ID: <1457862282.09.0.215497485592.issue24918@psf.upfronthosting.co.za> Ezio Melotti added the comment: Fixed, thanks for the report and the patch(es)! ---------- assignee: docs at python -> ezio.melotti resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 05:55:40 2016 From: report at bugs.python.org (Ezio Melotti) Date: Sun, 13 Mar 2016 09:55:40 +0000 Subject: [issue26176] EmailMessage example doesn't work In-Reply-To: <1453427916.73.0.91814079944.issue26176@psf.upfronthosting.co.za> Message-ID: <1457862940.84.0.195226804475.issue26176@psf.upfronthosting.co.za> Ezio Melotti added the comment: #26426 has been marked as duplicate of this, and contains more information about the error. ---------- nosy: +ezio.melotti stage: -> needs patch versions: +Python 3.5, Python 3.6 -Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 05:58:06 2016 From: report at bugs.python.org (Ezio Melotti) Date: Sun, 13 Mar 2016 09:58:06 +0000 Subject: [issue26250] no document for sqlite3.Cursor.connection In-Reply-To: <1454262712.53.0.251399487214.issue26250@psf.upfronthosting.co.za> Message-ID: <1457863086.58.0.982226263701.issue26250@psf.upfronthosting.co.za> Changes by Ezio Melotti : ---------- assignee: docs at python -> ezio.melotti nosy: +ezio.melotti stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 06:03:21 2016 From: report at bugs.python.org (STINNER Victor) Date: Sun, 13 Mar 2016 10:03:21 +0000 Subject: [issue26314] interned strings are stored in a dict, a set would use less memory In-Reply-To: <1457853702.72.0.186108460083.issue26314@psf.upfronthosting.co.za> Message-ID: STINNER Victor added the comment: Serhiy Storchaka added the comment: > > Since interned strings table can only grow and contains exact strings, > other data structure may be more appropriate (for example > Modules/hashtable.c). > FYI this module is not well optimized. I took code and then adapted it for my needs in tracemalloc. If you want to use it outside, you should check again that parameters like used buckets/total buckets ratio are well chosen. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 06:15:14 2016 From: report at bugs.python.org (Alan Mislove) Date: Sun, 13 Mar 2016 10:15:14 +0000 Subject: [issue26551] Regex.finditer infinite loops with certain input Message-ID: <1457864114.42.0.685788531788.issue26551@psf.upfronthosting.co.za> New submission from Alan Mislove: I found a regex and input that causes re.finditer() to appear to get into an infinite loop. Please see the attached minimal python script that triggers the behavior. I've verified the bug exists on 2.7.6, 3.4.0, and 3.5.1; I haven't yet be able to test whether it also exists in the latest 3.6. ---------- components: Regular Expressions files: bug.py messages: 261692 nosy: Alan Mislove, ezio.melotti, mrabarnett priority: normal severity: normal status: open title: Regex.finditer infinite loops with certain input type: crash versions: Python 2.7, Python 3.4, Python 3.5 Added file: http://bugs.python.org/file42154/bug.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 06:36:51 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 13 Mar 2016 10:36:51 +0000 Subject: [issue26551] Regex.finditer infinite loops with certain input In-Reply-To: <1457864114.42.0.685788531788.issue26551@psf.upfronthosting.co.za> Message-ID: <1457865411.36.0.534439380804.issue26551@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: This is finite loop. Your script just needs too much time to finish. ---------- nosy: +serhiy.storchaka resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 06:45:52 2016 From: report at bugs.python.org (Alan Mislove) Date: Sun, 13 Mar 2016 10:45:52 +0000 Subject: [issue26551] Regex.finditer infinite loops with certain input In-Reply-To: <1457864114.42.0.685788531788.issue26551@psf.upfronthosting.co.za> Message-ID: <1457865952.14.0.427974227578.issue26551@psf.upfronthosting.co.za> Alan Mislove added the comment: Thanks for the quick reply, Serhiy! You're right -- after letting it run for even longer, it does complete. Sorry for the trouble. I have two quick followup questions: 1. Would this be considered a performance bug? On my machine, it runs for over 20 seconds before completing. 2. This regex was a much-simplified version of a larger one (I was trying to isolate the problem for the bug report). When running the larger regex on the same input, it ran for multiple days without completing. Should I send the larger regex along, or is this issue out of scope? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 07:38:45 2016 From: report at bugs.python.org (SilentGhost) Date: Sun, 13 Mar 2016 11:38:45 +0000 Subject: [issue26499] http.client.IncompleteRead from HTTPResponse read after part reading file In-Reply-To: <1457345453.59.0.0327827539319.issue26499@psf.upfronthosting.co.za> Message-ID: <1457869125.74.0.83550446353.issue26499@psf.upfronthosting.co.za> SilentGhost added the comment: Updated patch addresses the rietveld comments. ---------- Added file: http://bugs.python.org/file42155/issue26499_5.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 07:46:10 2016 From: report at bugs.python.org (Damien Nicolas) Date: Sun, 13 Mar 2016 11:46:10 +0000 Subject: [issue26552] Failing ensure_future still creates a Task Message-ID: <1457869570.39.0.866858008064.issue26552@psf.upfronthosting.co.za> New submission from Damien Nicolas: When calling asyncio.ensure_future() on a coroutine, and if the loop is closed, ensure_future() will raise a RuntimeError. However, it still creates a Task, which will generate a RuntimeWarning that we can?t fix since there is no way to cancel the Task. Here is the code to reproduce the bug: import asyncio l = asyncio.get_event_loop() l.close() async def foo(): pass try: # Since the exception raises here, fut is never set # so we can't call fut.cancel() fut = asyncio.ensure_future(foo()) except RuntimeError: pass # stderr: # aio.py:12: RuntimeWarning: coroutine 'foo' was never awaited # pass ---------- components: asyncio messages: 261696 nosy: gordon, gvanrossum, haypo, yselivanov priority: normal severity: normal status: open title: Failing ensure_future still creates a Task type: behavior versions: Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 07:51:35 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 13 Mar 2016 11:51:35 +0000 Subject: [issue26551] Regex.finditer infinite loops with certain input In-Reply-To: <1457864114.42.0.685788531788.issue26551@psf.upfronthosting.co.za> Message-ID: <1457869895.26.0.377351622038.issue26551@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: This is known issue. Some regular expressions has quadratic or even exponential complexity. Existing implementation can't be easy fixed. You can try an regular expressions engine that use completely different algorithms, i.e. re2 (https://pypi.python.org/pypi/re2). Or rewrite your regular expression. You can ask for help on the comp.lang.python newsgroup (news:comp.lang.python). It is also accessible as a mailing list (https://mail.python.org/mailman/listinfo/python-list). There is a Web-interface (http://dir.gmane.org/gmane.comp.python.general). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 08:01:15 2016 From: report at bugs.python.org (Martin Panter) Date: Sun, 13 Mar 2016 12:01:15 +0000 Subject: [issue23214] BufferedReader.read1(size) signature incompatible with BufferedIOBase.read1(size=-1) In-Reply-To: <1420854382.8.0.44417983014.issue23214@psf.upfronthosting.co.za> Message-ID: <1457870475.72.0.380033906207.issue23214@psf.upfronthosting.co.za> Martin Panter added the comment: Calling BufferedReader.read1(sys.maxsize) gives me a MemoryError. Making read1(-1) equivalent to read1(sys.maxsize) only makes sense where the return value already has a predetermined size, and only a limited buffer needs to be allocated. Another interpretation is to return an arbitrary, modest buffer size. This is what I ended up doing with LZMAFile.read1() in Issue 23529: return no more than 8 KiB. It is not equivalent to sys.maxsize because more than 8 KiB is possible if you ask for it. HTTPResponse (for non-chunked responses) is similar, but uses a default of 16 KiB. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 11:48:39 2016 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 13 Mar 2016 15:48:39 +0000 Subject: [issue26314] interned strings are stored in a dict, a set would use less memory In-Reply-To: <1454964166.73.0.652183434251.issue26314@psf.upfronthosting.co.za> Message-ID: <1457884119.98.0.623513298448.issue26314@psf.upfronthosting.co.za> Raymond Hettinger added the comment: GPS: priority low, feel free to drop if it you want. SS: But for now status quo is good to me. Marking as closed. Feel free to open a separate tracker item if you want to pursue the use of Modules/hashtable.c. ---------- resolution: -> rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 12:02:52 2016 From: report at bugs.python.org (SilentGhost) Date: Sun, 13 Mar 2016 16:02:52 +0000 Subject: [issue26549] co_stacksize is calculated from unoptimized code In-Reply-To: <1457822745.22.0.972836245522.issue26549@psf.upfronthosting.co.za> Message-ID: <1457884972.04.0.931225763569.issue26549@psf.upfronthosting.co.za> Changes by SilentGhost : ---------- nosy: +benjamin.peterson, brett.cannon, georg.brandl, ncoghlan, yselivanov _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 13:36:44 2016 From: report at bugs.python.org (Brett Cannon) Date: Sun, 13 Mar 2016 17:36:44 +0000 Subject: [issue26549] co_stacksize is calculated from unoptimized code In-Reply-To: <1457822745.22.0.972836245522.issue26549@psf.upfronthosting.co.za> Message-ID: <1457890604.98.0.835387413084.issue26549@psf.upfronthosting.co.za> Brett Cannon added the comment: I also suspect you're right, Antti, that the stack size is calculated prior to the bytecode being passed to through the peepholer which would have made the built tuple a value in the const array. Off the top of my head I don't remember where the stack size calculation is made, but my suspicion is it's in the AT -> bytecode step, which would mean making it work from bytecode would mean re-implementing that calculation to work from the bytecode itself (assuming I'm right). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 13:40:30 2016 From: report at bugs.python.org (Guido van Rossum) Date: Sun, 13 Mar 2016 17:40:30 +0000 Subject: [issue26552] Failing ensure_future still creates a Task In-Reply-To: <1457869570.39.0.866858008064.issue26552@psf.upfronthosting.co.za> Message-ID: <1457890830.0.0.218491423938.issue26552@psf.upfronthosting.co.za> Guido van Rossum added the comment: Sounds like an easy fix. Could you submit a patch? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 14:23:07 2016 From: report at bugs.python.org (Julien) Date: Sun, 13 Mar 2016 18:23:07 +0000 Subject: [issue26512] Vocabulary: Using "integral" in library/stdtypes.html In-Reply-To: <1457472244.72.0.113699245831.issue26512@psf.upfronthosting.co.za> Message-ID: <1457893387.64.0.794753103981.issue26512@psf.upfronthosting.co.za> Julien added the comment: Daily meditations: - This table is nice to show that there's various operations common to int and float (and does it well), not to list rounding methods (it happen to have only rounding methods, but that's a coincidence). - A coma separated list like ":func:`math.trunc`, :func:`round`, :func:`math.floor`, and :func:`math.ceil`." are enough to list them and to show they contain various rounding methods which is clear about the fact they are a bit different. - Yet we have to be both readable for everybody and ultra precise about implementation for those implementing their own __floor__, and the math module does it really nicely. But we can keep the table without the empty "Notes" column, leaving place to explain them with more words, so they can be more readable, approaching this way the readability of the math module ? Finally, the problem is the conciseness of the result column (which make me think a link is better than a too-concise explanation). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 14:38:21 2016 From: report at bugs.python.org (Antoine Pitrou) Date: Sun, 13 Mar 2016 18:38:21 +0000 Subject: [issue23214] BufferedReader.read1(size) signature incompatible with BufferedIOBase.read1(size=-1) In-Reply-To: <1420854382.8.0.44417983014.issue23214@psf.upfronthosting.co.za> Message-ID: <1457894301.84.0.784479366162.issue23214@psf.upfronthosting.co.za> Antoine Pitrou added the comment: > Define BufferedIOBase.read1(-1) to read and return an arbitrary number > of bytes, more than zero unless none are available due to EOF or > non-blocking mode. Maybe suggest that it would return the current > buffered data or try to read a full buffer of data (with one call) and > return it if applicable. This sounds reasonable to me. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 15:03:11 2016 From: report at bugs.python.org (Brandon Milam) Date: Sun, 13 Mar 2016 19:03:11 +0000 Subject: [issue8232] webbrowser.open incomplete on Windows In-Reply-To: <1269541962.46.0.762619344208.issue8232@psf.upfronthosting.co.za> Message-ID: <1457895791.0.0.839362226608.issue8232@psf.upfronthosting.co.za> Brandon Milam added the comment: I've tested the new patch and it is still able to properly find both chrome and firefox and is able to differentiate between new window and new tab for those two browsers so it is still working. Would someone review the patch? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 21:05:11 2016 From: report at bugs.python.org (Robert Collins) Date: Mon, 14 Mar 2016 01:05:11 +0000 Subject: =?utf-8?q?=5Bissue22625=5D_When_cross-compiling=2C_don=E2=80=99t_try_to_e?= =?utf-8?q?xecute_binaries?= In-Reply-To: <1413226219.68.0.732560661241.issue22625@psf.upfronthosting.co.za> Message-ID: <1457917511.02.0.185151432192.issue22625@psf.upfronthosting.co.za> Robert Collins added the comment: So in general: https://www.gnu.org/software/autoconf/manual/autoconf-2.69/html_node/System-Type.html#System-Type and https://www.gnu.org/software/autoconf/manual/autoconf-2.69/html_node/Hosts-and-Cross_002dCompilation.html There are three platforms in play: target, host, build. Host is the platform where what you build should run on. build is the platform we are building on. target is the platform where the *output* of the build thing itself should run on. Baby steps though: lets assume target==host always. Now, the pathological case of building things is the canadian cross - https://en.wikipedia.org/wiki/Cross_compiler#Canadian_Cross Note here that you actually build multiple different entire compilers, - and thats what we need here. We need to build two python's. One, for build, which pgen and _freeze_importlib can depend on. One, for host, which is the output, and can depend on the output of running pgen and _freeze_importlib I don't have examples of Makefile parameterisation to support this offhand, but gcc would be the obvious (if perhaps overwhelming) place to look at it. The key things I'd expect are that: - when host==build, the dependencies and outputs are identical, so we only build one copy of Python and everything else. - when host!=build, we get a chain - the host Python -> pgenoutput -> pgen -> build Python -> pgenoutput ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 21:27:23 2016 From: report at bugs.python.org (Robert Collins) Date: Mon, 14 Mar 2016 01:27:23 +0000 Subject: [issue25900] unittest ignores the first ctrl-c when it shouldn't In-Reply-To: <1450428509.62.0.620097682631.issue25900@psf.upfronthosting.co.za> Message-ID: <1457918843.3.0.122154288947.issue25900@psf.upfronthosting.co.za> Robert Collins added the comment: I'd rather make this super simple: just terminate the test run immediately. We can catch KeyBoardInterrupt in the UI layer to still permit outputting summary information. That removes one more source of global state that makes testing fragile. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 21:35:28 2016 From: report at bugs.python.org (Robert Collins) Date: Mon, 14 Mar 2016 01:35:28 +0000 Subject: [issue26481] unittest discovery process not working without .py source files In-Reply-To: <1457111372.53.0.54879325378.issue26481@psf.upfronthosting.co.za> Message-ID: <1457919328.48.0.706134529681.issue26481@psf.upfronthosting.co.za> Robert Collins added the comment: Python has stopped supporting .pyc-only distributions - see https://www.python.org/dev/peps/pep-3147/#case-3-pycache-foo-magic-pyc-with-no-source - and so, while what you are seeing is inconsistent with import in some older python's, it is not a bug in newer Python's, and I don't see any benefit in doing a backport-only fix for it. ---------- resolution: -> not a bug stage: -> resolved status: open -> closed type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 21:38:47 2016 From: report at bugs.python.org (Robert Collins) Date: Mon, 14 Mar 2016 01:38:47 +0000 Subject: [issue26481] unittest discovery process not working without .py source files In-Reply-To: <1457111372.53.0.54879325378.issue26481@psf.upfronthosting.co.za> Message-ID: <1457919527.7.0.912929002836.issue26481@psf.upfronthosting.co.za> Robert Collins added the comment: Sorry, I missed the little footnote on case 4 about still supporting source-less distributions. I guess in that context we do still need to support this. However - please check that this does indeed happen on Python master - 3.6. unittest does evolve and if you're testing on 2.7 or something your bug is perhaps already fixed. ---------- resolution: not a bug -> stage: resolved -> test needed status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 22:02:50 2016 From: report at bugs.python.org (Robert Collins) Date: Mon, 14 Mar 2016 02:02:50 +0000 Subject: [issue24294] DeprecationWarnings should be visible by default in the interactive REPL In-Reply-To: <1432713990.67.0.935342603332.issue24294@psf.upfronthosting.co.za> Message-ID: <1457920970.5.0.122467621015.issue24294@psf.upfronthosting.co.za> Robert Collins added the comment: @mbussonn - I don't see an updated non-tty-checking patch from you? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 22:03:00 2016 From: report at bugs.python.org (Martin Panter) Date: Mon, 14 Mar 2016 02:03:00 +0000 Subject: =?utf-8?q?=5Bissue22625=5D_When_cross-compiling=2C_don=E2=80=99t_try_to_e?= =?utf-8?q?xecute_binaries?= In-Reply-To: <1413226219.68.0.732560661241.issue22625@psf.upfronthosting.co.za> Message-ID: <1457920980.8.0.131436277041.issue22625@psf.upfronthosting.co.za> Martin Panter added the comment: Thanks Robert. Russell also pointed out on python-dev that the patches at Issue 23670 show how he is doing cross compilation, via a new high-level iOS/Makefile file. Here is a cut-down version of the parts that I find relevant: # Build for the native build host host/bin/python*: make -C .. distclean cd .. && ./configure --prefix=host ... make -C .. Programs/_freeze_importlib # Main makefile is patched to use this copy (3.5+ only): cp ../Programs/_freeze_importlib . make -C .. install tar czf host.tar.gz host && rm -rf host # Build for a foreign target host ios-%.tar.gz: host/bin/python* make -C .. distclean tar xzf host.tar.gz cd .. && PATH=host/bin:$(PATH) ./configure \ --host=%-apple-ios --build=$(BUILD_OS_ID) CC=% LD=% \ --prefix=$* ... PATH=host/bin:$(PATH) make -C .. install tar czf $*.tar.gz $* && rm -rf $* Something I just realized is that the output of pgen is actually committed to the Mercurial repository. It seems that Russell?s cross-compilation was relying on this to avoid rerunning pgen. Same with the output of _freeze_importlib, except Russell is working around that differently. It does not seem right to have files in the repository that are also generated by the normal build process. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 22:15:15 2016 From: report at bugs.python.org (Robert Collins) Date: Mon, 14 Mar 2016 02:15:15 +0000 Subject: [issue21159] configparser.InterpolationMissingOptionError is not very intuitive In-Reply-To: <1396694112.28.0.289974893208.issue21159@psf.upfronthosting.co.za> Message-ID: <1457921715.59.0.337686622023.issue21159@psf.upfronthosting.co.za> Robert Collins added the comment: I think we should close this again: if you subclass something you need to implement the full public API. raw has been in that API since 2010!. It's a shame that folk have been implementing just-enough, rather than the actual API, but I don't see that has all that much bearing on the go-forward. Rolling it back out of 3.4 could be done - but since the problematic subclasses are fixing themselves now 3.5 is out, that should take care of issues on 3.4 too. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 22:17:46 2016 From: report at bugs.python.org (Robert Collins) Date: Mon, 14 Mar 2016 02:17:46 +0000 Subject: [issue19217] Calling assertEquals for moderately long list takes too long In-Reply-To: <1381410286.72.0.514206486634.issue19217@psf.upfronthosting.co.za> Message-ID: <1457921866.68.0.625424706257.issue19217@psf.upfronthosting.co.za> Robert Collins added the comment: The new output seems ok to me? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 22:28:06 2016 From: report at bugs.python.org (Robert Collins) Date: Mon, 14 Mar 2016 02:28:06 +0000 Subject: [issue24780] unittest assertEqual difference output foiled by newlines In-Reply-To: <1438534169.3.0.814109265012.issue24780@psf.upfronthosting.co.za> Message-ID: <1457922486.56.0.56828010746.issue24780@psf.upfronthosting.co.za> Robert Collins added the comment: Thanks for the patch; reviewed in rietvald. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 22:31:17 2016 From: report at bugs.python.org (Robert Collins) Date: Mon, 14 Mar 2016 02:31:17 +0000 Subject: [issue25690] Replacement for unittest.mock.mock_open In-Reply-To: <1448122983.8.0.049241542179.issue25690@psf.upfronthosting.co.za> Message-ID: <1457922677.87.0.437268428924.issue25690@psf.upfronthosting.co.za> Robert Collins added the comment: Hmm, I haven't looked closely, but some high level thoughts. I'm worried about making mock too complex here. We already say folk should use a VFS for complex file based tests, and there's quite a chunk of code you're adding - perhaps better to just use a VFS? I don't like mock importing mock_open and mock_open importing mock: please keep this in a single mock.py at this point. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 22:34:57 2016 From: report at bugs.python.org (Robert Collins) Date: Mon, 14 Mar 2016 02:34:57 +0000 Subject: [issue25783] test_traceback.test_walk_stack() fails when run directly (without regrtest) In-Reply-To: <1449078273.26.0.535537969115.issue25783@psf.upfronthosting.co.za> Message-ID: <1457922897.26.0.792815000391.issue25783@psf.upfronthosting.co.za> Robert Collins added the comment: Can we just stop running the test suite directly? python -m unittest test.test_traceback should work fine and as quickly, ... I'd like to delete all the __main__ in the test suite as cruft TBH. The patch would be ok if ugly, its a bit of a magic number there. What the test really should do is create a recursive function of some depth, and then introspect the result of calling the function at the bottom of that recursion. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 22:37:06 2016 From: report at bugs.python.org (Robert Collins) Date: Mon, 14 Mar 2016 02:37:06 +0000 Subject: [issue25520] unittest load_tests protocol not working as documented In-Reply-To: <1446239702.03.0.964231995407.issue25520@psf.upfronthosting.co.za> Message-ID: <1457923026.34.0.2055466669.issue25520@psf.upfronthosting.co.za> Robert Collins added the comment: What version of python are you testing with? unittest 2.7 has a number of bugs vis-a-vis namespaces and discovery. If you're testing with less than 3.5, or perhaps 3.6, please try with unittest2, which has the same fixes as the stdlib unittest. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 22:38:00 2016 From: report at bugs.python.org (Robert Collins) Date: Mon, 14 Mar 2016 02:38:00 +0000 Subject: [issue20556] Use specific asserts in threading tests In-Reply-To: <1391808878.85.0.661174932104.issue20556@psf.upfronthosting.co.za> Message-ID: <1457923080.2.0.979105366314.issue20556@psf.upfronthosting.co.za> Robert Collins added the comment: @Serhiy care to commit it? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 23:04:03 2016 From: report at bugs.python.org (Robert Collins) Date: Mon, 14 Mar 2016 03:04:03 +0000 Subject: [issue24922] assertWarnsRegex doesn't allow multiple warning messages In-Reply-To: <1440425748.63.0.780438690591.issue24922@psf.upfronthosting.co.za> Message-ID: <1457924643.14.0.246602844898.issue24922@psf.upfronthosting.co.za> Robert Collins added the comment: The context manager errors if *nothing* matches, not if *everything* matches, which is very different to catch_warnings because the filters are used to *exclude* warnings, and excess warnings are errors there. Because of that, there's little if any reason to add support for multiple regexes - just nest two context managers. That said... The lineno is already not-fully-informative - its the first matching warnings lineno. Right now, the definition in the code is: for warnings in (the warning item-or-tuple) if the regex matches, done if none of the warnings match, error. If we allow the tuple of warnings to be a tuple of (warning, regex) items, we could do that compatibly, with some introspection. If the patch is fairly small, It might be ok, for all that I don't see a need for it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 23:07:09 2016 From: report at bugs.python.org (Robert Collins) Date: Mon, 14 Mar 2016 03:07:09 +0000 Subject: [issue24959] unittest swallows part of stack trace when raising AssertionError in a TestCase In-Reply-To: <1440864914.24.0.799928607113.issue24959@psf.upfronthosting.co.za> Message-ID: <1457924829.84.0.361422651501.issue24959@psf.upfronthosting.co.za> Robert Collins added the comment: Hmm, this is a little surprising, but - why are you raising AssertionError like that - thats what assertRaises is for. ---------- stage: -> needs patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 23:10:29 2016 From: report at bugs.python.org (Robert Collins) Date: Mon, 14 Mar 2016 03:10:29 +0000 Subject: [issue23890] assertRaises increases reference counter In-Reply-To: <1428518225.53.0.665360255509.issue23890@psf.upfronthosting.co.za> Message-ID: <1457925029.7.0.791930241613.issue23890@psf.upfronthosting.co.za> Robert Collins added the comment: I don't think we make any guarantees for or against references, but - we attempt to free references already (see how we call clear_frames), so this is a bug, pure and simple. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 23:47:46 2016 From: report at bugs.python.org (Roundup Robot) Date: Mon, 14 Mar 2016 03:47:46 +0000 Subject: [issue16181] cookielib.http2time raises ValueError for invalid date. In-Reply-To: <1349813212.28.0.59101014442.issue16181@psf.upfronthosting.co.za> Message-ID: <20160314034743.10718.81689@psf.io> Roundup Robot added the comment: New changeset 838f68a76ea1 by Berker Peksag in branch '3.5': Issue #16181: cookiejar.http2time() now returns None if year is higher than datetime.MAXYEAR https://hg.python.org/cpython/rev/838f68a76ea1 New changeset 8b7de03261f5 by Berker Peksag in branch 'default': Issue #16181: cookiejar.http2time() now returns None if year is higher than datetime.MAXYEAR https://hg.python.org/cpython/rev/8b7de03261f5 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 23:49:11 2016 From: report at bugs.python.org (Berker Peksag) Date: Mon, 14 Mar 2016 03:49:11 +0000 Subject: [issue16181] cookielib.http2time raises ValueError for invalid date. In-Reply-To: <1349813212.28.0.59101014442.issue16181@psf.upfronthosting.co.za> Message-ID: <1457927351.36.0.670913251092.issue16181@psf.upfronthosting.co.za> Changes by Berker Peksag : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.6 -Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 00:05:20 2016 From: report at bugs.python.org (Roundup Robot) Date: Mon, 14 Mar 2016 04:05:20 +0000 Subject: [issue747320] rfc2822 formatdate functionality duplication Message-ID: <20160314040516.26194.30148@psf.io> Roundup Robot added the comment: New changeset ee64faffd46a by Berker Peksag in branch 'default': Issue #747320: Use email.utils.formatdate() to avoid code duplication https://hg.python.org/cpython/rev/ee64faffd46a ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 00:06:13 2016 From: report at bugs.python.org (Berker Peksag) Date: Mon, 14 Mar 2016 04:06:13 +0000 Subject: [issue747320] rfc2822 formatdate functionality duplication Message-ID: <1457928373.94.0.639912704143.issue747320@psf.upfronthosting.co.za> Changes by Berker Peksag : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 00:12:27 2016 From: report at bugs.python.org (Martin Panter) Date: Mon, 14 Mar 2016 04:12:27 +0000 Subject: [issue22854] Documentation/implementation out of sync for IO In-Reply-To: <1415804787.06.0.347049835041.issue22854@psf.upfronthosting.co.za> Message-ID: <1457928747.56.0.198442684069.issue22854@psf.upfronthosting.co.za> Changes by Martin Panter : ---------- stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 00:44:15 2016 From: report at bugs.python.org (Martin Panter) Date: Mon, 14 Mar 2016 04:44:15 +0000 Subject: [issue5505] sys.stdin.read() doesn't return after first EOF on Windows In-Reply-To: <1237368034.29.0.0565107663013.issue5505@psf.upfronthosting.co.za> Message-ID: <1457930655.89.0.326355674778.issue5505@psf.upfronthosting.co.za> Martin Panter added the comment: Since this was apparenly only a bug in 3.2, can we close it as being out of date? ---------- nosy: +martin.panter _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 01:33:43 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 14 Mar 2016 05:33:43 +0000 Subject: [issue25783] test_traceback.test_walk_stack() fails when run directly (without regrtest) In-Reply-To: <1449078273.26.0.535537969115.issue25783@psf.upfronthosting.co.za> Message-ID: <1457933623.79.0.249368474579.issue25783@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: I would use different test, not depending on outer stack depth. ---------- keywords: +patch nosy: +serhiy.storchaka stage: -> patch review type: -> behavior Added file: http://bugs.python.org/file42156/test_walk_stack.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 02:23:18 2016 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 14 Mar 2016 06:23:18 +0000 Subject: [issue26512] Vocabulary: Using "integral" in library/stdtypes.html In-Reply-To: <1457472244.72.0.113699245831.issue26512@psf.upfronthosting.co.za> Message-ID: <1457936598.3.0.928413720941.issue26512@psf.upfronthosting.co.za> Raymond Hettinger added the comment: Julian, I don't see a bug here and think you've ventured too far into stylistic micro-rewordings. If there is something unintelligible, we'll fix it, but this tracker item has lost focus and isn't using people's time efficiently (i.e. this isn't a forum for "daily meditations"). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 02:23:33 2016 From: report at bugs.python.org (Sudheer Satyanarayana) Date: Mon, 14 Mar 2016 06:23:33 +0000 Subject: [issue26553] Write HTTP in uppercase Message-ID: <1457936613.19.0.773642660577.issue26553@psf.upfronthosting.co.za> New submission from Sudheer Satyanarayana: "The Requests package is recommended for a higher-level http client interface." Change 'http' to uppercase. https://docs.python.org/2/library/httplib.html https://docs.python.org/2/library/urllib.html https://docs.python.org/3/library/http.client.html ---------- assignee: docs at python components: Documentation messages: 261726 nosy: Sudheer Satyanarayana, docs at python priority: normal severity: normal status: open title: Write HTTP in uppercase _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 02:27:13 2016 From: report at bugs.python.org (Julien) Date: Mon, 14 Mar 2016 06:27:13 +0000 Subject: [issue26512] Vocabulary: Using "integral" in library/stdtypes.html In-Reply-To: <1457472244.72.0.113699245831.issue26512@psf.upfronthosting.co.za> Message-ID: <1457936833.95.0.323534740452.issue26512@psf.upfronthosting.co.za> Julien added the comment: I completely agree we're consuming too much time for what it is, sry for that. Let's just link to numbers.Integral and close it. I attached a simple patch for it. ---------- Added file: http://bugs.python.org/file42157/stdtypes-integral.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 03:33:21 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 14 Mar 2016 07:33:21 +0000 Subject: [issue22854] Documentation/implementation out of sync for IO In-Reply-To: <1415804787.06.0.347049835041.issue22854@psf.upfronthosting.co.za> Message-ID: <1457940801.18.0.430787201908.issue22854@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Nice patch. But it isn't applied cleanly on current tip (perhaps due to Argument Clinic). Added comments and questions on Rietveld. ---------- nosy: +benjamin.peterson, pitrou, serhiy.storchaka, stutzbach versions: +Python 3.5, Python 3.6 -Python 3.2, Python 3.3, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 03:46:44 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 14 Mar 2016 07:46:44 +0000 Subject: [issue26512] Vocabulary: Using "integral" in library/stdtypes.html In-Reply-To: <1457472244.72.0.113699245831.issue26512@psf.upfronthosting.co.za> Message-ID: <1457941604.96.0.269054348063.issue26512@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Georg, is it possible to make a link from formatted text ``math.trunc(x)`` to the math.trunc() function? ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 03:49:23 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 14 Mar 2016 07:49:23 +0000 Subject: [issue26553] Write HTTP in uppercase In-Reply-To: <1457936613.19.0.773642660577.issue26553@psf.upfronthosting.co.za> Message-ID: <1457941763.87.0.116746016994.issue26553@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Could you provide a patch Sudheer? ---------- keywords: +easy nosy: +serhiy.storchaka stage: -> needs patch versions: +Python 2.7, Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 04:22:02 2016 From: report at bugs.python.org (Vinay Sajip) Date: Mon, 14 Mar 2016 08:22:02 +0000 Subject: [issue9998] ctypes find_library should search LD_LIBRARY_PATH on linux In-Reply-To: <1285857910.26.0.582948500976.issue9998@psf.upfronthosting.co.za> Message-ID: <1457943722.81.0.575385248475.issue9998@psf.upfronthosting.co.za> Vinay Sajip added the comment: > find_library() is documented as emulating a build-time linker, not run-time It may be documented as that, but is emulating a build-time linker the most useful thing? In the context of Python binding to external libraries, why is build-time linking behaviour better than run-time linking behaviour? This is an enhancement request, not a bug request: so if a change was to be applied, the documentation could be updated to indicate any change in behaviour. The use case is that a shared library needed by a Python extension is available on LD_LIBRARY_PATH such that a non-ctypes linking operation would find it, but ctypes.util.find_library() won't, so a user of the extension (who may not be its developer) can't load the extension easily. See also my comment http://bugs.python.org/issue9998#msg165806 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 04:40:45 2016 From: report at bugs.python.org (Roundup Robot) Date: Mon, 14 Mar 2016 08:40:45 +0000 Subject: [issue20556] Use specific asserts in threading tests In-Reply-To: <1391808878.85.0.661174932104.issue20556@psf.upfronthosting.co.za> Message-ID: <20160314084042.29607.32111@psf.io> Roundup Robot added the comment: New changeset 791d7ef006d3 by Serhiy Storchaka in branch '3.5': Issue #20556: Used specific assert methods in threading tests. https://hg.python.org/cpython/rev/791d7ef006d3 New changeset 9f8db4d1e149 by Serhiy Storchaka in branch '2.7': Issue #20556: Used specific assert methods in threading tests. https://hg.python.org/cpython/rev/9f8db4d1e149 New changeset b11acba0b785 by Serhiy Storchaka in branch 'default': Issue #20556: Used specific assert methods in threading tests. https://hg.python.org/cpython/rev/b11acba0b785 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 04:42:33 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 14 Mar 2016 08:42:33 +0000 Subject: [issue20556] Use specific asserts in threading tests In-Reply-To: <1391808878.85.0.661174932104.issue20556@psf.upfronthosting.co.za> Message-ID: <1457944953.26.0.88785594617.issue20556@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Thank you all for your reviews. ---------- assignee: -> serhiy.storchaka resolution: -> fixed stage: commit review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 04:47:02 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 14 Mar 2016 08:47:02 +0000 Subject: [issue26523] multiprocessing ThreadPool is untested In-Reply-To: <1457555830.32.0.570545129367.issue26523@psf.upfronthosting.co.za> Message-ID: <1457945222.59.0.621602230398.issue26523@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- assignee: -> pitrou stage: patch review -> commit review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 04:58:40 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 14 Mar 2016 08:58:40 +0000 Subject: [issue26494] Double deallocation on iterator exhausting In-Reply-To: <1457288764.94.0.168287313304.issue26494@psf.upfronthosting.co.za> Message-ID: <1457945920.63.0.127884531533.issue26494@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Could anyone please look at the patch? I'm not sure about organizing tests. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 05:06:53 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 14 Mar 2016 09:06:53 +0000 Subject: [issue25911] Regression: os.walk now using os.scandir() breaks bytes filenames on windows In-Reply-To: <1450539578.39.0.976654454489.issue25911@psf.upfronthosting.co.za> Message-ID: <1457946413.73.0.812516732596.issue25911@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Deprecation warnings are suppressed, but my attempt to fix test failures failed. http://buildbot.python.org/all/builders/AMD64%20Windows8%203.x/builds/1832/steps/test/logs/stdio ====================================================================== FAIL: test_walk_bottom_up (test.test_os.BytesWalkTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "D:\buildarea\3.x.bolen-windows8\build\lib\test\test_os.py", line 894, in test_walk_bottom_up self.sub2_tree) AssertionError: Tuples differ: ('@test_4060_tmp\\TEST1\\SUB2', ['broken_link', 'link'], ['tmp3']) != ('@test_4060_tmp\\TEST1\\SUB2', ['link'], ['broken_link', 'tmp3']) First differing element 1: ['broken_link', 'link'] ['link'] - ('@test_4060_tmp\\TEST1\\SUB2', ['broken_link', 'link'], ['tmp3']) ? ---------- + ('@test_4060_tmp\\TEST1\\SUB2', ['link'], ['broken_link', 'tmp3']) ? ++++++++++ ====================================================================== FAIL: test_walk_prune (test.test_os.BytesWalkTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "D:\buildarea\3.x.bolen-windows8\build\lib\test\test_os.py", line 874, in test_walk_prune self.assertEqual(all[1], self.sub2_tree) AssertionError: Tuples differ: ('@test_4060_tmp\\TEST1\\SUB2', ['broken_link', 'link'], ['tmp3']) != ('@test_4060_tmp\\TEST1\\SUB2', ['link'], ['broken_link', 'tmp3']) First differing element 1: ['broken_link', 'link'] ['link'] - ('@test_4060_tmp\\TEST1\\SUB2', ['broken_link', 'link'], ['tmp3']) ? ---------- + ('@test_4060_tmp\\TEST1\\SUB2', ['link'], ['broken_link', 'tmp3']) ? ++++++++++ ---------------------------------------------------------------------- In some cases a broken link is considered as a link to regular file, but in other cases is considered as a link to directory. It is hard to fix this Windows issue without Windows. Needed a help of Windows experts. ---------- assignee: serhiy.storchaka -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 05:07:23 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 14 Mar 2016 09:07:23 +0000 Subject: [issue25911] Regression: os.walk now using os.scandir() breaks bytes filenames on windows In-Reply-To: <1450539578.39.0.976654454489.issue25911@psf.upfronthosting.co.za> Message-ID: <1457946443.47.0.498039265901.issue25911@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- stage: patch review -> needs patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 05:21:28 2016 From: report at bugs.python.org (Alex Willmer) Date: Mon, 14 Mar 2016 09:21:28 +0000 Subject: =?utf-8?q?=5Bissue22625=5D_When_cross-compiling=2C_don=E2=80=99t_try_to_e?= =?utf-8?q?xecute_binaries?= In-Reply-To: <1457917511.02.0.185151432192.issue22625@psf.upfronthosting.co.za> Message-ID: Alex Willmer added the comment: On 14 March 2016 at 01:05, Robert Collins wrote: > There are three platforms in play: target, host, build. > > Host is the platform where what you build should run on. > build is the platform we are building on. > target is the platform where the *output* of the build thing itself should run on. Baby steps though: lets assume target==host always. To be 100% explicit: CPython doesn't need to worry about the third one, the target platform. That only matters when the thing being compiled, will itself cross-compile/process binaries at runtime e.g. gcc, binutils. So if - I'm on Linux and - I want to compile a gcc that runs on BeOS - that in turn compiles binaries for TempleOS only then would target matter. ---------- nosy: +moreati _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 06:01:41 2016 From: report at bugs.python.org (maddin200) Date: Mon, 14 Mar 2016 10:01:41 +0000 Subject: [issue26554] Missing fclose Message-ID: <1457949701.38.0.834751371072.issue26554@psf.upfronthosting.co.za> New submission from maddin200: cpython\PC\bdist_wininst\install.c line 2542 missing fclose(logfile); ---------- components: Windows messages: 261737 nosy: maddin200, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: Missing fclose _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 06:28:59 2016 From: report at bugs.python.org (Akira Li) Date: Mon, 14 Mar 2016 10:28:59 +0000 Subject: [issue23220] Documents input/output effects of how IDLE runs user code In-Reply-To: <1420937687.17.0.885670059147.issue23220@psf.upfronthosting.co.za> Message-ID: <1457951339.35.0.230460841099.issue23220@psf.upfronthosting.co.za> Akira Li added the comment: IDLE can implement functionality similar to what colorama [1] module does on Windows: translate ANSI escape character sequences into corresponding GUI method calls. For example, \b might be implemented using a .delete() call, \r using .mark_set(), etc. [1] https://pypi.python.org/pypi/colorama ---------- nosy: +akira _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 06:29:53 2016 From: report at bugs.python.org (Marco Sulla) Date: Mon, 14 Mar 2016 10:29:53 +0000 Subject: [issue26555] string.format(bytes) raise warning Message-ID: <1457951393.78.0.559454400626.issue26555@psf.upfronthosting.co.za> New submission from Marco Sulla: Steps to reproduce 1. create a format_bytes.py with: "Hello {}".format(b"World") 2. launch it with python3 -bb format_bytes.py Result: Traceback (most recent call last): File "format_bytes.py", line 1, in "Hello {}".format(b"World") BytesWarning: str() on a bytes instance Expected: No warning ---------- components: Interpreter Core messages: 261739 nosy: marco.sulla priority: normal severity: normal status: open title: string.format(bytes) raise warning versions: Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 06:31:13 2016 From: report at bugs.python.org (Marco Sulla) Date: Mon, 14 Mar 2016 10:31:13 +0000 Subject: [issue26555] string.format(bytes) raise warning In-Reply-To: <1457951393.78.0.559454400626.issue26555@psf.upfronthosting.co.za> Message-ID: <1457951473.05.0.58631150541.issue26555@psf.upfronthosting.co.za> Marco Sulla added the comment: I want to clarify more: I do not want to suppress the warning, I would that the format minilanguage will convert bytes to string properly. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 06:31:35 2016 From: report at bugs.python.org (Christian Heimes) Date: Mon, 14 Mar 2016 10:31:35 +0000 Subject: [issue26556] Update expat to 2.2.1 Message-ID: <1457951495.3.0.910401967595.issue26556@psf.upfronthosting.co.za> New submission from Christian Heimes: A new version of expat has been released. 2.2.1 addressed CVE-2015-1283. ---------- components: Extension Modules, XML messages: 261741 nosy: benjamin.peterson, christian.heimes, georg.brandl, larry priority: release blocker severity: normal stage: needs patch status: open title: Update expat to 2.2.1 type: security versions: Python 2.7, Python 3.3, Python 3.4, Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 06:35:51 2016 From: report at bugs.python.org (STINNER Victor) Date: Mon, 14 Mar 2016 10:35:51 +0000 Subject: [issue26555] string.format(bytes) raise warning In-Reply-To: <1457951393.78.0.559454400626.issue26555@psf.upfronthosting.co.za> Message-ID: <1457951751.76.0.846872215369.issue26555@psf.upfronthosting.co.za> STINNER Victor added the comment: > I would that the format minilanguage will convert bytes to string properly. Sorry, nope, Python 3 doesn't guess the encoding of byte strings anymore. You have to decode manually. Example: "Hello {}".format(b"World".decode('ascii')) Or format to bytes: b"Hello {}".format(b"World") It's not a bug. It's a feature. ---------- nosy: +haypo resolution: -> not a bug status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 06:38:23 2016 From: report at bugs.python.org (STINNER Victor) Date: Mon, 14 Mar 2016 10:38:23 +0000 Subject: [issue26555] string.format(bytes) raise warning In-Reply-To: <1457951393.78.0.559454400626.issue26555@psf.upfronthosting.co.za> Message-ID: <1457951903.56.0.0310669232647.issue26555@psf.upfronthosting.co.za> STINNER Victor added the comment: More about Unicode: * https://docs.python.org/dev/howto/unicode.html * http://unicodebook.readthedocs.org/ * etc. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 07:19:00 2016 From: report at bugs.python.org (Michael Crouch) Date: Mon, 14 Mar 2016 11:19:00 +0000 Subject: [issue26557] dictviews methods not present on shelve objects Message-ID: <1457954340.57.0.630883947605.issue26557@psf.upfronthosting.co.za> New submission from Michael Crouch: Shelve types in Python 2.7 don't implement the 'viewkeys', 'viewvalues', and 'viewitems' methods. Section 11.4 of the Python Standard Library documentation says that "Shelf objects support all methods supported by dictionaries." If those methods can't be added to shelves, the documentation should be clarified. The use case for this was that I wanted an iterator on a shelf that didn't try to materialize the entire list (since the shelf is very large and I'd prefer to leave most of it on disk). ---------- components: Library (Lib) messages: 261744 nosy: Michael Crouch priority: normal severity: normal status: open title: dictviews methods not present on shelve objects versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 07:27:11 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 14 Mar 2016 11:27:11 +0000 Subject: [issue26557] dictviews methods not present on shelve objects In-Reply-To: <1457954340.57.0.630883947605.issue26557@psf.upfronthosting.co.za> Message-ID: <1457954831.88.0.652494062589.issue26557@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: The shelve object inherits its dict-like methods from UserDict.DictMixin. The documentation for UserDict.DictMixin should be updated too. ---------- assignee: -> docs at python components: +Documentation -Library (Lib) keywords: +easy nosy: +docs at python, serhiy.storchaka stage: -> needs patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 08:41:28 2016 From: report at bugs.python.org (Roundup Robot) Date: Mon, 14 Mar 2016 12:41:28 +0000 Subject: [issue26516] Add PYTHONMALLOC env var and add support for malloc debug hooks in release mode In-Reply-To: <1457522115.12.0.78692190259.issue26516@psf.upfronthosting.co.za> Message-ID: <20160314124113.108833.80822@psf.io> Roundup Robot added the comment: New changeset aa280432e9c7 by Victor Stinner in branch 'default': Add PYTHONMALLOC env var https://hg.python.org/cpython/rev/aa280432e9c7 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 08:45:59 2016 From: report at bugs.python.org (STINNER Victor) Date: Mon, 14 Mar 2016 12:45:59 +0000 Subject: [issue26516] Add PYTHONMALLOC env var and add support for malloc debug hooks in release mode In-Reply-To: <1457522115.12.0.78692190259.issue26516@psf.upfronthosting.co.za> Message-ID: <1457959559.01.0.708625380584.issue26516@psf.upfronthosting.co.za> STINNER Victor added the comment: I reworked my patch before pushing it: * it now respects -E and -I command line options * I documented changes in Doc/, Misc/NEWS, What's New in Python 3.6, Misc/README.valgrind, etc. * Debug hooks are now also installed when Python is compiled in debug mode without pymalloc * PYTHONMALLOCSTATS is now ignored if the allocator if pymalloc is not used * PYTHONMALLOC is ignored if it's an empty string ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 08:56:07 2016 From: report at bugs.python.org (STINNER Victor) Date: Mon, 14 Mar 2016 12:56:07 +0000 Subject: [issue26516] Add PYTHONMALLOC env var and add support for malloc debug hooks in release mode In-Reply-To: <1457522115.12.0.78692190259.issue26516@psf.upfronthosting.co.za> Message-ID: <1457960167.77.0.231203290511.issue26516@psf.upfronthosting.co.za> STINNER Victor added the comment: Note: I just checked PYTHONMALLOCSTATS=1 with -X tracemalloc. It looks like it works as expected. Tracemalloc hooks are unregistered before stats are displayed at exit, _Pymem_PymallocEnabled() returns 1 as expected. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 08:58:16 2016 From: report at bugs.python.org (STINNER Victor) Date: Mon, 14 Mar 2016 12:58:16 +0000 Subject: [issue26249] Change PyMem_Malloc to use pymalloc allocator In-Reply-To: <1454262504.41.0.628053130208.issue26249@psf.upfronthosting.co.za> Message-ID: <1457960296.13.0.956409653443.issue26249@psf.upfronthosting.co.za> STINNER Victor added the comment: pymalloc.patch: Updated patch. ---------- Added file: http://bugs.python.org/file42158/pymalloc.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 09:16:41 2016 From: report at bugs.python.org (STINNER Victor) Date: Mon, 14 Mar 2016 13:16:41 +0000 Subject: [issue26558] Fix PyGILState_Check() with _testcapi.run_in_subinterp() Message-ID: <1457961401.7.0.508641923687.issue26558@psf.upfronthosting.co.za> New submission from STINNER Victor: assert(PyGILState_Check()) cannot be used in functions called by Py_NewInterpreter(): the assertion fails. I propose to add a flag to disable PyGILState_Check() while Py_NewInterpreter() is run to be able to add assertions in these functions. The assertion helps to detect complex bugs like race condition in multithreaded applications. ---------- messages: 261750 nosy: haypo priority: normal severity: normal status: open title: Fix PyGILState_Check() with _testcapi.run_in_subinterp() versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 09:19:30 2016 From: report at bugs.python.org (Marco Sulla) Date: Mon, 14 Mar 2016 13:19:30 +0000 Subject: [issue26555] string.format(bytes) raise warning In-Reply-To: <1457951393.78.0.559454400626.issue26555@psf.upfronthosting.co.za> Message-ID: <1457961570.17.0.243710149961.issue26555@psf.upfronthosting.co.za> Marco Sulla added the comment: > Python 3 doesn't guess the encoding of byte strings anymore And I agree, but I think format minilanguage could convert it by default to utf8, and if something goes wrong raise an error (or try str()). More simple to use and robust at the same time. My 2 cents. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 09:20:39 2016 From: report at bugs.python.org (STINNER Victor) Date: Mon, 14 Mar 2016 13:20:39 +0000 Subject: [issue26555] string.format(bytes) raise warning In-Reply-To: <1457951393.78.0.559454400626.issue26555@psf.upfronthosting.co.za> Message-ID: <1457961639.37.0.256303231416.issue26555@psf.upfronthosting.co.za> STINNER Victor added the comment: >> Python 3 doesn't guess the encoding of byte strings anymore > And I agree, but I think format minilanguage could convert it by default to utf8, .. Using utf8 means guessing the encoding of a byte string. Python 3 doesn't do that anymore, there is no more exception. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 09:31:51 2016 From: report at bugs.python.org (Marco Sulla) Date: Mon, 14 Mar 2016 13:31:51 +0000 Subject: [issue26555] string.format(bytes) raise warning In-Reply-To: <1457951393.78.0.559454400626.issue26555@psf.upfronthosting.co.za> Message-ID: <1457962311.92.0.118975944485.issue26555@psf.upfronthosting.co.za> Marco Sulla added the comment: > Using utf8 means guessing the encoding Well, it's not what format() is doing now, using str()? :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 10:18:37 2016 From: report at bugs.python.org (Sebastien Bourdeauducq) Date: Mon, 14 Mar 2016 14:18:37 +0000 Subject: [issue26509] spurious ConnectionAbortedError logged on Windows In-Reply-To: <1457412256.22.0.929855467044.issue26509@psf.upfronthosting.co.za> Message-ID: <1457965117.18.0.497352730412.issue26509@psf.upfronthosting.co.za> Sebastien Bourdeauducq added the comment: Tested it, that works, thanks! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 10:33:28 2016 From: report at bugs.python.org (STINNER Victor) Date: Mon, 14 Mar 2016 14:33:28 +0000 Subject: [issue26555] string.format(bytes) raise warning In-Reply-To: <1457951393.78.0.559454400626.issue26555@psf.upfronthosting.co.za> Message-ID: <1457966008.38.0.44915906515.issue26555@psf.upfronthosting.co.za> STINNER Victor added the comment: > Well, it's not what format() is doing now, using str()? :) Hum, are you sure that you tried Python 3, and not Python 2? str(bytes) on Python 3 is well defined: >>> print(str(b'hello')) b'hello' >>> print(str('h\xe9llo'.encode('utf8'))) b'h\xc3\xa9llo' I'm not sure that you expect the b'...' format. Non-ASCII characters are escaped as \xHH format. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 10:42:03 2016 From: report at bugs.python.org (Anish Shah) Date: Mon, 14 Mar 2016 14:42:03 +0000 Subject: [issue26553] Write HTTP in uppercase In-Reply-To: <1457936613.19.0.773642660577.issue26553@psf.upfronthosting.co.za> Message-ID: <1457966523.48.0.537950577369.issue26553@psf.upfronthosting.co.za> Anish Shah added the comment: Patch for urllib and httplib in Python 2 ---------- keywords: +patch nosy: +anish.shah Added file: http://bugs.python.org/file42159/issue26553.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 10:42:30 2016 From: report at bugs.python.org (Anish Shah) Date: Mon, 14 Mar 2016 14:42:30 +0000 Subject: [issue26553] Write HTTP in uppercase In-Reply-To: <1457936613.19.0.773642660577.issue26553@psf.upfronthosting.co.za> Message-ID: <1457966550.13.0.965179679106.issue26553@psf.upfronthosting.co.za> Anish Shah added the comment: Patch for http.client in Python3 ---------- Added file: http://bugs.python.org/file42160/issue26553-python3.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 10:56:27 2016 From: report at bugs.python.org (STINNER Victor) Date: Mon, 14 Mar 2016 14:56:27 +0000 Subject: [issue26558] Fix PyGILState_Check() with _testcapi.run_in_subinterp() In-Reply-To: <1457961401.7.0.508641923687.issue26558@psf.upfronthosting.co.za> Message-ID: <1457967387.03.0.175563838796.issue26558@psf.upfronthosting.co.za> STINNER Victor added the comment: gil_check.patch: add more checks on the GIL * PyGILState_Check() now returns 1 (success) before the creation of the GIL and after the destruction of the GIL * Add a flag to disable PyGILState_Check(). Disable PyGILState_Check() when Py_NewInterpreter() is called * Add assert(PyGILState_Check()) to: - _Py_dup() - _Py_fstat() - _Py_read() - _Py_write() - PyObject_Malloc() - PyObject_Calloc() - PyObject_Realloc() - PyObject_Free() ---------- keywords: +patch Added file: http://bugs.python.org/file42161/gil_check.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 11:06:12 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 14 Mar 2016 15:06:12 +0000 Subject: [issue26553] Write HTTP in uppercase In-Reply-To: <1457936613.19.0.773642660577.issue26553@psf.upfronthosting.co.za> Message-ID: <1457967972.07.0.271728883746.issue26553@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: There are occurrences of "http" in lower case in docstrings and comments. The same for https and ftp (and may be other abbreviations). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 11:09:34 2016 From: report at bugs.python.org (STINNER Victor) Date: Mon, 14 Mar 2016 15:09:34 +0000 Subject: [issue26558] Fix PyGILState_Check() with _testcapi.run_in_subinterp() In-Reply-To: <1457961401.7.0.508641923687.issue26558@psf.upfronthosting.co.za> Message-ID: <1457968174.07.0.868383478017.issue26558@psf.upfronthosting.co.za> STINNER Victor added the comment: I created this issue while working on the issue #26249 "Change PyMem_Malloc to use pymalloc allocator". I would like to check that application call PyObject_Malloc() and PyMem_Malloc() with the GIL held. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 11:11:07 2016 From: report at bugs.python.org (STINNER Victor) Date: Mon, 14 Mar 2016 15:11:07 +0000 Subject: [issue26516] Add PYTHONMALLOC env var and add support for malloc debug hooks in release mode In-Reply-To: <1457522115.12.0.78692190259.issue26516@psf.upfronthosting.co.za> Message-ID: <1457968267.26.0.896932924844.issue26516@psf.upfronthosting.co.za> STINNER Victor added the comment: test_capi fails on Windows: http://buildbot.python.org/all/builders/AMD64%20Windows7%20SP1%203.x/builds/7348/steps/test/logs/stdio Probably a issue with newline characters. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 12:00:11 2016 From: report at bugs.python.org (STINNER Victor) Date: Mon, 14 Mar 2016 16:00:11 +0000 Subject: [issue26558] Fix PyGILState_Check() with _testcapi.run_in_subinterp() In-Reply-To: <1457961401.7.0.508641923687.issue26558@psf.upfronthosting.co.za> Message-ID: <1457971211.61.0.287094576395.issue26558@psf.upfronthosting.co.za> STINNER Victor added the comment: Hum, in fact I prefer to implement GIL check in debug hooks of Python memory allocators. So it becomes to get these checks on Python compiled in debug mode. Patch 2: Don't touch Python memory allocators. Instead of I wrote a second patch, pymem_gil_check.patch (based on gil_check-2.patch). -- Oh, I forgot to mention that the gil_check patch changes PyThreadState_DeleteCurrent(): I reordered instructions to be able call PyObject_Free() with the GIL check. ---------- Added file: http://bugs.python.org/file42162/gil_check-2.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 12:00:23 2016 From: report at bugs.python.org (STINNER Victor) Date: Mon, 14 Mar 2016 16:00:23 +0000 Subject: [issue26558] Fix PyGILState_Check() with _testcapi.run_in_subinterp() In-Reply-To: <1457961401.7.0.508641923687.issue26558@psf.upfronthosting.co.za> Message-ID: <1457971223.13.0.558073597221.issue26558@psf.upfronthosting.co.za> Changes by STINNER Victor : Added file: http://bugs.python.org/file42163/pymem_gil_check.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 12:01:02 2016 From: report at bugs.python.org (Roundup Robot) Date: Mon, 14 Mar 2016 16:01:02 +0000 Subject: [issue26558] Fix PyGILState_Check() with _testcapi.run_in_subinterp() In-Reply-To: <1457961401.7.0.508641923687.issue26558@psf.upfronthosting.co.za> Message-ID: <20160314160042.108833.27131@psf.io> Roundup Robot added the comment: New changeset c24630367767 by Victor Stinner in branch 'default': Fix Py_FatalError() if called without the GIL https://hg.python.org/cpython/rev/c24630367767 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 12:02:09 2016 From: report at bugs.python.org (Roundup Robot) Date: Mon, 14 Mar 2016 16:02:09 +0000 Subject: [issue26558] Fix PyGILState_Check() with _testcapi.run_in_subinterp() In-Reply-To: <1457961401.7.0.508641923687.issue26558@psf.upfronthosting.co.za> Message-ID: <20160314160207.9515.28990@psf.io> Roundup Robot added the comment: New changeset 8a5a0e223559 by Victor Stinner in branch 'default': Issue #26558: Remove useless check in tracemalloc https://hg.python.org/cpython/rev/8a5a0e223559 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 12:10:58 2016 From: report at bugs.python.org (Roundup Robot) Date: Mon, 14 Mar 2016 16:10:58 +0000 Subject: [issue26516] Add PYTHONMALLOC env var and add support for malloc debug hooks in release mode In-Reply-To: <1457522115.12.0.78692190259.issue26516@psf.upfronthosting.co.za> Message-ID: <20160314161056.29611.85272@psf.io> Roundup Robot added the comment: New changeset 3c3df33f2655 by Victor Stinner in branch 'default': Issue #26516: Fix test_capi on Windows https://hg.python.org/cpython/rev/3c3df33f2655 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 12:12:33 2016 From: report at bugs.python.org (STINNER Victor) Date: Mon, 14 Mar 2016 16:12:33 +0000 Subject: [issue26249] Change PyMem_Malloc to use pymalloc allocator In-Reply-To: <1454262504.41.0.628053130208.issue26249@psf.upfronthosting.co.za> Message-ID: <1457971953.68.0.019895209735.issue26249@psf.upfronthosting.co.za> STINNER Victor added the comment: > Using the issue #26516 (PYTHONMALLOC=debug), we can check PyGILState_Check() at runtime, but there is currently an issue related to sub-interpreters. The assertion fails in support.run_in_subinterp(), function used by test_threading and test_capi for example. I created #26558 to implement GIL checks in PyMem_Malloc() and PyObject_Malloc(). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 12:16:08 2016 From: report at bugs.python.org (STINNER Victor) Date: Mon, 14 Mar 2016 16:16:08 +0000 Subject: [issue26558] Fix PyGILState_Check() with _testcapi.run_in_subinterp() In-Reply-To: <1457961401.7.0.508641923687.issue26558@psf.upfronthosting.co.za> Message-ID: <1457972168.57.0.127592913191.issue26558@psf.upfronthosting.co.za> STINNER Victor added the comment: See also issues: * #10915: Make the PyGILState API compatible with multiple interpreters * #15751: Support subinterpreters in the GIL state API This issue contains is a compromise: it's a workaround until the root issue is solve. Since #10915 is open since 2011, I'm not sure that it's possible to fix the issue, nor that it's worth :-) To me, subinterpreters still looks like an experimental feature. ---------- nosy: +pitrou _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 12:20:08 2016 From: report at bugs.python.org (STINNER Victor) Date: Mon, 14 Mar 2016 16:20:08 +0000 Subject: [issue26558] Disable PyGILState_Check() when Py_NewInterpreter() is called and add more checks on the GIL In-Reply-To: <1457961401.7.0.508641923687.issue26558@psf.upfronthosting.co.za> Message-ID: <1457972408.66.0.0777461134016.issue26558@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- title: Fix PyGILState_Check() with _testcapi.run_in_subinterp() -> Disable PyGILState_Check() when Py_NewInterpreter() is called and add more checks on the GIL _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 12:48:45 2016 From: report at bugs.python.org (Roundup Robot) Date: Mon, 14 Mar 2016 16:48:45 +0000 Subject: [issue17758] test_site fails when the user does not have a home directory In-Reply-To: <1366120279.38.0.306129828747.issue17758@psf.upfronthosting.co.za> Message-ID: <20160314164747.45766.76344@psf.io> Roundup Robot added the comment: New changeset 0a583e60c406 by Victor Stinner in branch '3.5': Skip test_site if USER_SITE cannot be created https://hg.python.org/cpython/rev/0a583e60c406 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 12:48:46 2016 From: report at bugs.python.org (Roundup Robot) Date: Mon, 14 Mar 2016 16:48:46 +0000 Subject: [issue26516] Add PYTHONMALLOC env var and add support for malloc debug hooks in release mode In-Reply-To: <1457522115.12.0.78692190259.issue26516@psf.upfronthosting.co.za> Message-ID: <20160314164209.118671.53138@psf.io> Roundup Robot added the comment: New changeset d8d6ec1333e6 by Victor Stinner in branch 'default': Issue #26516: Fix test_capi on 32-bit system https://hg.python.org/cpython/rev/d8d6ec1333e6 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 12:50:12 2016 From: report at bugs.python.org (Roundup Robot) Date: Mon, 14 Mar 2016 16:50:12 +0000 Subject: [issue17758] test_site fails when the user does not have a home directory In-Reply-To: <1366120279.38.0.306129828747.issue17758@psf.upfronthosting.co.za> Message-ID: <20160314164952.2576.10580@psf.io> Roundup Robot added the comment: New changeset 1a40ee2bad6a by Victor Stinner in branch '2.7': Skip test_site if USER_SITE cannot be created https://hg.python.org/cpython/rev/1a40ee2bad6a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 12:51:25 2016 From: report at bugs.python.org (STINNER Victor) Date: Mon, 14 Mar 2016 16:51:25 +0000 Subject: [issue17758] test_site fails when the user does not have a home directory In-Reply-To: <1366120279.38.0.306129828747.issue17758@psf.upfronthosting.co.za> Message-ID: <1457974285.25.0.382571324536.issue17758@psf.upfronthosting.co.za> STINNER Victor added the comment: "Unfixed for 2 years. How about skipping the test if os.makedirs(site.USER_SITE) fails?" Let's do that ;-) @Christian: Feel free to open a new issue if you have a solution to not write outside temporary directories in test_site ;-) @doko: Thanks for the bug report! Sorry for the delay :-/ I recall this issue because I just saw it on some FreeBSD buildbots. ---------- nosy: +haypo resolution: -> fixed status: open -> closed versions: +Python 3.5, Python 3.6 -Python 3.3, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 14:01:46 2016 From: report at bugs.python.org (David Escott) Date: Mon, 14 Mar 2016 18:01:46 +0000 Subject: [issue26559] logging.handlers.MemoryHandler flushes on shutdown but not removal Message-ID: <1457978506.77.0.246614135279.issue26559@psf.upfronthosting.co.za> New submission from David Escott: The documentation suggests using a MemoryHandler object to buffer log messages and conditionally output them. https://docs.python.org/3/howto/logging-cookbook.html#buffering-logging-messages-and-outputting-them-conditionally However the documentation does not make clear that this only works because of the call to super(MemoryHandler, handler).flush() prior to logger.removeHandler(handler). A direct call to handler.flush(), or simply leaving the handler unflushed until process shutdown will result in the messages still being printed, when the MemoryHandler calls self.flush() during its shutdown routines. To be honest this behavior of MemoryHandler doesn't make much sense to me, since the MemoryHandler is in fact flushing when flush_level has not been satisfied. I would suggest adding an option to the MemoryHandler "flush_on_close" defaulting to True, and then simply constructing the MemoryHandler with that option set to False. That would not affect the existing users of the handler, but it would result in a tool which would actually match the only example I have come across of a MemoryHandler in use online. ---------- components: Library (Lib) messages: 261772 nosy: David Escott priority: normal severity: normal status: open title: logging.handlers.MemoryHandler flushes on shutdown but not removal type: behavior versions: Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 14:11:47 2016 From: report at bugs.python.org (Peter Inglesby) Date: Mon, 14 Mar 2016 18:11:47 +0000 Subject: [issue26560] Error in assertion in wsgiref.handlers.BaseHandler.start_response Message-ID: <1457979107.59.0.709846628148.issue26560@psf.upfronthosting.co.za> New submission from Peter Inglesby: The line: assert int(status[:3]),"Status message must begin w/3-digit code" should be something like: assert status[:3].isnumeric(), "Status message must begin w/3-digit code" ---------- components: Library (Lib) messages: 261773 nosy: inglesp priority: normal severity: normal status: open title: Error in assertion in wsgiref.handlers.BaseHandler.start_response _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 14:31:43 2016 From: report at bugs.python.org (Brian Tom) Date: Mon, 14 Mar 2016 18:31:43 +0000 Subject: [issue26561] exec function fails to properly assign scope to dict like object Message-ID: <1457980303.17.0.703803860627.issue26561@psf.upfronthosting.co.za> Changes by Brian Tom : ---------- nosy: btomtom5 priority: normal severity: normal status: open title: exec function fails to properly assign scope to dict like object type: behavior versions: Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 14:32:58 2016 From: report at bugs.python.org (Brian Tom) Date: Mon, 14 Mar 2016 18:32:58 +0000 Subject: [issue26561] exec function fails to properly assign scope to dict like object Message-ID: <1457980378.1.0.255243508787.issue26561@psf.upfronthosting.co.za> New submission from Brian Tom: http://stackoverflow.com/questions/35993869/passing-a-dictionary-like-object-to-exec-instead-of-dict-object-changes-scope-of ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 15:24:42 2016 From: report at bugs.python.org (Xavier de Gaye) Date: Mon, 14 Mar 2016 19:24:42 +0000 Subject: [issue22359] Remove incorrect uses of recursive make In-Reply-To: <1410165869.76.0.203082844365.issue22359@psf.upfronthosting.co.za> Message-ID: <1457983482.87.0.636132859663.issue22359@psf.upfronthosting.co.za> Xavier de Gaye added the comment: This patch improves changeset c2a53aa27cad by allowing cross-compilation: The following checks have been made: * successfull cross-compilation of python3.4 after retrofiting changeset c2a53aa27cad to python3.4 since I don't have a working cross-compilation setup for python3.6 at the moment * successfull native compilation of python3.6 (default branch) * Python/graminit.c is re-generated after touching Parser/pgenmain.c on a native build ---------- nosy: +xdegaye Added file: http://bugs.python.org/file42164/cross-chgeset-c2a53aa27cad.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 15:54:18 2016 From: report at bugs.python.org (Alexander Belopolsky) Date: Mon, 14 Mar 2016 19:54:18 +0000 Subject: [issue26561] exec function fails to properly assign scope to dict like object In-Reply-To: <1457980378.1.0.255243508787.issue26561@psf.upfronthosting.co.za> Message-ID: <1457985258.83.0.398369995487.issue26561@psf.upfronthosting.co.za> Alexander Belopolsky added the comment: The SO example works for me with Python 3.5.1: Python 3.5.1 (default, Mar 8 2016, 12:33:47) [GCC 4.2.1 Compatible Apple LLVM 7.0.2 (clang-700.1.81)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> global_function = """ ... x = "Hello World" ... def print_global_x(): ... print(x) ... print_global_x() ... """ >>> import builtins >>> class TestEnvironment(dict): ... def __init__(self, *args): ... super().__init__(*args) ... >>> global_env = TestEnvironment() >>> global_env['__builtins__'] = builtins >>> exec(global_function, global_env) Hello World btomtom5 - a bug report that consists only of an SO link is likely to be treated as spam by many issue tracker subscribers. In the future, please try to make your reports self-contained. ---------- nosy: +belopolsky resolution: -> works for me status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 15:54:32 2016 From: report at bugs.python.org (Alexander Belopolsky) Date: Mon, 14 Mar 2016 19:54:32 +0000 Subject: [issue26561] exec function fails to properly assign scope to dict like object In-Reply-To: <1457980378.1.0.255243508787.issue26561@psf.upfronthosting.co.za> Message-ID: <1457985272.69.0.837974435078.issue26561@psf.upfronthosting.co.za> Changes by Alexander Belopolsky : ---------- stage: -> resolved _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 16:58:35 2016 From: report at bugs.python.org (Roundup Robot) Date: Mon, 14 Mar 2016 20:58:35 +0000 Subject: [issue26516] Add PYTHONMALLOC env var and add support for malloc debug hooks in release mode In-Reply-To: <1457522115.12.0.78692190259.issue26516@psf.upfronthosting.co.za> Message-ID: <20160314205826.45770.37615@psf.io> Roundup Robot added the comment: New changeset 7534eb7bd57e by Victor Stinner in branch 'default': Issue #26516: Fix test_capi on AIX https://hg.python.org/cpython/rev/7534eb7bd57e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 17:50:02 2016 From: report at bugs.python.org (Roundup Robot) Date: Mon, 14 Mar 2016 21:50:02 +0000 Subject: [issue10915] Make the PyGILState API compatible with multiple interpreters In-Reply-To: <1295103161.75.0.771875465176.issue10915@psf.upfronthosting.co.za> Message-ID: <20160314214958.118691.40603@psf.io> Roundup Robot added the comment: New changeset e590c632c9fa by Victor Stinner in branch 'default': Add more checks on the GIL https://hg.python.org/cpython/rev/e590c632c9fa ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 17:50:02 2016 From: report at bugs.python.org (Roundup Robot) Date: Mon, 14 Mar 2016 21:50:02 +0000 Subject: [issue15751] Support subinterpreters in the GIL state API In-Reply-To: <1345526301.75.0.455071650321.issue15751@psf.upfronthosting.co.za> Message-ID: <20160314214958.118691.47829@psf.io> Roundup Robot added the comment: New changeset e590c632c9fa by Victor Stinner in branch 'default': Add more checks on the GIL https://hg.python.org/cpython/rev/e590c632c9fa ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 17:50:03 2016 From: report at bugs.python.org (Roundup Robot) Date: Mon, 14 Mar 2016 21:50:03 +0000 Subject: [issue26558] Disable PyGILState_Check() when Py_NewInterpreter() is called and add more checks on the GIL In-Reply-To: <1457961401.7.0.508641923687.issue26558@psf.upfronthosting.co.za> Message-ID: <20160314214958.118691.80907@psf.io> Roundup Robot added the comment: New changeset e590c632c9fa by Victor Stinner in branch 'default': Add more checks on the GIL https://hg.python.org/cpython/rev/e590c632c9fa New changeset cde3d986da00 by Victor Stinner in branch 'default': Check the GIL in PyObject_Malloc() https://hg.python.org/cpython/rev/cde3d986da00 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 17:52:23 2016 From: report at bugs.python.org (Berker Peksag) Date: Mon, 14 Mar 2016 21:52:23 +0000 Subject: [issue5505] sys.stdin.read() doesn't return after first EOF on Windows In-Reply-To: <1237368034.29.0.0565107663013.issue5505@psf.upfronthosting.co.za> Message-ID: <1457992343.89.0.206551596162.issue5505@psf.upfronthosting.co.za> Changes by Berker Peksag : ---------- resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 17:54:12 2016 From: report at bugs.python.org (Damian Myerscough) Date: Mon, 14 Mar 2016 21:54:12 +0000 Subject: [issue26562] Large Involuntary context switches during oom-killer Message-ID: <1457992452.77.0.650639243294.issue26562@psf.upfronthosting.co.za> New submission from Damian Myerscough: I have been running a simple script inside a Docker container to cause the container to trigger oom-killer. >>> mem = {} >>> for i in range(65535): ... mem[i] = "A" * 65535 When oom-killer is trigger I see a large number of involuntary context switches and major page faults which causes a spike in CPU and disk. # /usr/bin/time --verbose python Python 2.7.9 (default, Mar 1 2015, 12:57:24) [GCC 4.9.2] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> mem = {} >>> for i in range(65535): ... mem[i] = "A" * 65535 ... Command terminated by signal 9 Command being timed: "python" User time (seconds): 0.13 System time (seconds): 3.83 Percent of CPU this job got: 17% Elapsed (wall clock) time (h:mm:ss or m:ss): 0:22.94 Average shared text size (kbytes): 0 Average unshared data size (kbytes): 0 Average stack size (kbytes): 0 Average total size (kbytes): 0 Maximum resident set size (kbytes): 2096516 Average resident set size (kbytes): 0 Major (requiring I/O) page faults: 33536 Minor (reclaiming a frame) page faults: 524545 Voluntary context switches: 30706 Involuntary context switches: 137852 Swaps: 0 File system inputs: 8499072 File system outputs: 0 Socket messages sent: 0 Socket messages received: 0 Signals delivered: 0 Page size (bytes): 4096 Exit status: 0 I tried the same test using NodeJS/C++ and I could see a lot less involuntary context switches and major page faults which indicates this could be a Python issue. # /usr/bin/time --verbose ./alloc_forever 1024 5 524288000 initial_alloc_amount: 1024, sleep_duration: 5, alloc_amount: 524288000 memory: 501.07MB memory: 1001.29MB memory: 1501.19MB memory: 2001.09MB Command terminated by signal 9 Command being timed: "./alloc_forever 1024 5 524288000" User time (seconds): 0.63 System time (seconds): 0.97 Percent of CPU this job got: 7% Elapsed (wall clock) time (h:mm:ss or m:ss): 0:21.61 Average shared text size (kbytes): 0 Average unshared data size (kbytes): 0 Average stack size (kbytes): 0 Average total size (kbytes): 0 Maximum resident set size (kbytes): 2096536 Average resident set size (kbytes): 0 Major (requiring I/O) page faults: 11 Minor (reclaiming a frame) page faults: 524178 Voluntary context switches: 17 Involuntary context switches: 284 Swaps: 0 File system inputs: 336 File system outputs: 0 Socket messages sent: 0 Socket messages received: 0 Signals delivered: 0 Page size (bytes): 4096 Exit status: 0 ---------- messages: 261781 nosy: DamianMyerscough priority: normal severity: normal status: open title: Large Involuntary context switches during oom-killer type: resource usage versions: Python 2.7, Python 3.2, Python 3.3, Python 3.4, Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 18:00:54 2016 From: report at bugs.python.org (STINNER Victor) Date: Mon, 14 Mar 2016 22:00:54 +0000 Subject: [issue26562] Large Involuntary context switches during oom-killer In-Reply-To: <1457992452.77.0.650639243294.issue26562@psf.upfronthosting.co.za> Message-ID: <1457992854.69.0.805726225241.issue26562@psf.upfronthosting.co.za> STINNER Victor added the comment: I don't understand this issue... I don't see how Python can avoid context switches when writing data to memory... ---------- nosy: +haypo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 18:21:15 2016 From: report at bugs.python.org (Robert Collins) Date: Mon, 14 Mar 2016 22:21:15 +0000 Subject: [issue26562] Large Involuntary context switches during oom-killer In-Reply-To: <1457992452.77.0.650639243294.issue26562@psf.upfronthosting.co.za> Message-ID: <1457994075.16.0.284252021959.issue26562@psf.upfronthosting.co.za> Robert Collins added the comment: So this test script is making a 65K entry dict, and each item is a new, separate 65K string. The strings are allocated in single chunks, so we should expect couple hundred reference count writes total. AIUI involuntary context switches occur when there is CPU contention. What else do you have running? Notable Python is taking 3.83 seconds of system time, much more than your other tests. You may get some insight from strace -c. ---------- nosy: +rbcollins _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 18:22:15 2016 From: report at bugs.python.org (Robert Collins) Date: Mon, 14 Mar 2016 22:22:15 +0000 Subject: [issue25783] test_traceback.test_walk_stack() fails when run directly (without regrtest) In-Reply-To: <1449078273.26.0.535537969115.issue25783@psf.upfronthosting.co.za> Message-ID: <1457994135.9.0.727254636041.issue25783@psf.upfronthosting.co.za> Robert Collins added the comment: @serhiy, how is that different to what I said? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 18:24:40 2016 From: report at bugs.python.org (Garrett Birkel) Date: Mon, 14 Mar 2016 22:24:40 +0000 Subject: [issue17088] ElementTree incorrectly refuses to write attributes without namespaces when default_namespace is used In-Reply-To: <1359599707.26.0.771342463799.issue17088@psf.upfronthosting.co.za> Message-ID: <1457994280.37.0.93755083419.issue17088@psf.upfronthosting.co.za> Garrett Birkel added the comment: Just hit up against this namespace bug. Has this patch been abandoned?? ---------- nosy: +Garrett Birkel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 18:27:50 2016 From: report at bugs.python.org (Martin Panter) Date: Mon, 14 Mar 2016 22:27:50 +0000 Subject: [issue22359] Remove incorrect uses of recursive make In-Reply-To: <1410165869.76.0.203082844365.issue22359@psf.upfronthosting.co.za> Message-ID: <1457994470.23.0.376584165415.issue22359@psf.upfronthosting.co.za> Martin Panter added the comment: Thanks for you work Xavier. Making it conditional on cross compilation is another approach I hadn?t thought of. But I am a bit worried at the new makefile syntax [ifeq directive and $(findstring) function]. I suspect it is Gnu specific, and that Python tries to support other versions of Make as well. Koobs: does Free BSD accept this makefile syntax? Much as I hate the configure.ac stuff, I guess it could be used to enable and disable conditional stuff in the makefile, so that might be another option. Whatever the end solution is, I think we need a big comment in the makefile pointing out the quirks and different people?s interests: * Reliable way to update generated files when necessary * Shared prerequisites unsafe with recursive concurrent $(MAKE) * Reasons to avoid regenerating files (not out of date, cross compilation, less build steps and prerequisites; see python-dev) * Building with read-only sources (see revision 67ed8a6905c3, then r87558) ---------- keywords: -easy stage: -> patch review versions: -Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 18:52:53 2016 From: report at bugs.python.org (STINNER Victor) Date: Mon, 14 Mar 2016 22:52:53 +0000 Subject: [issue26563] PyMem_Malloc(): check that the GIL is held in debug hooks Message-ID: <1457995973.59.0.0490877458577.issue26563@psf.upfronthosting.co.za> New submission from STINNER Victor: With the issue #26558, debug hooks of PyObject_Malloc() now checks that the GIL is hold. I left PyMem_Malloc() unchanged, because I am not 100% sure that it's ok yet to implement the same check in PyMem_Malloc(). So I opened this issue. Python 3 doc explicitly asks that the GIL is hold to call PyMem_Malloc(): https://docs.python.org/dev/c-api/memory.html#memory-interface Python 2 doc doesn't say anything about the GIL: https://docs.python.org/2/c-api/memory.html#memory-interface Usually, functions prefixed by "Py" require the GIL to be hold. In practice, currently PyMem_Malloc() is implemented with malloc() which is thread-safe. In the issue #26249, I tested numpy, lxml, Pillow and cryptography with all debug hooks enabled, including GIL checks in PyMem_Malloc() and PyObject_Malloc(). I only found one bug in numpy: https://github.com/numpy/numpy/pull/7404 Attached patch changes debug hooks on PyMem_Malloc() to ensure that the GIL is hold. ---------- files: pymem_gil.patch keywords: patch messages: 261787 nosy: haypo priority: normal severity: normal status: open title: PyMem_Malloc(): check that the GIL is held in debug hooks versions: Python 3.6 Added file: http://bugs.python.org/file42165/pymem_gil.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 18:54:38 2016 From: report at bugs.python.org (STINNER Victor) Date: Mon, 14 Mar 2016 22:54:38 +0000 Subject: [issue26563] PyMem_Malloc(): check that the GIL is hold in debug hooks In-Reply-To: <1457995973.59.0.0490877458577.issue26563@psf.upfronthosting.co.za> Message-ID: <1457996078.46.0.413793272447.issue26563@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- title: PyMem_Malloc(): check that the GIL is held in debug hooks -> PyMem_Malloc(): check that the GIL is hold in debug hooks _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 18:54:44 2016 From: report at bugs.python.org (STINNER Victor) Date: Mon, 14 Mar 2016 22:54:44 +0000 Subject: [issue26249] Change PyMem_Malloc to use pymalloc allocator In-Reply-To: <1454262504.41.0.628053130208.issue26249@psf.upfronthosting.co.za> Message-ID: <1457996084.18.0.954693768519.issue26249@psf.upfronthosting.co.za> STINNER Victor added the comment: I created the issue #26563 "PyMem_Malloc(): check that the GIL is hold in debug hooks". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 18:57:11 2016 From: report at bugs.python.org (Jeff Allen) Date: Mon, 14 Mar 2016 22:57:11 +0000 Subject: [issue26040] Improve coverage and rigour of test.test_math In-Reply-To: <1452181282.79.0.203850145541.issue26040@psf.upfronthosting.co.za> Message-ID: <1457996231.43.0.715566748988.issue26040@psf.upfronthosting.co.za> Jeff Allen added the comment: Here is a patch that improves coverage and addresses the uneven accuracy. Required accuracy is now specified in ulps. Mostly, I have choses 1 ulp, since this passed for me on an x86 architecture (and also ARM), but this may be too ambitious. I have also responded to the comment relating to erfc: # XXX Would be better to weaken this test only # for large x, instead of for all x." I found I could not contribute the code I used to generate the additional test cases in Tools/scripts without failing test_tools. (It complained of a missing dependency. The generator uses mpmath.) ---------- keywords: +patch Added file: http://bugs.python.org/file42166/iss26040.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 20:32:34 2016 From: report at bugs.python.org (Roundup Robot) Date: Tue, 15 Mar 2016 00:32:34 +0000 Subject: [issue25320] unittest loader.py TypeError when code directory contains a socket In-Reply-To: <1444063424.79.0.244583020203.issue25320@psf.upfronthosting.co.za> Message-ID: <20160315003227.108803.7880@psf.io> Roundup Robot added the comment: New changeset efc9836e0c83 by Robert Collins in branch '3.5': #25320: Handle sockets in directories unittest discovery is scanning. https://hg.python.org/cpython/rev/efc9836e0c83 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 20:33:40 2016 From: report at bugs.python.org (Roundup Robot) Date: Tue, 15 Mar 2016 00:33:40 +0000 Subject: [issue25320] unittest loader.py TypeError when code directory contains a socket In-Reply-To: <1444063424.79.0.244583020203.issue25320@psf.upfronthosting.co.za> Message-ID: <20160315003338.20945.98487@psf.io> Roundup Robot added the comment: New changeset 1d72402c1c91 by Robert Collins in branch 'default': #25320: Handle sockets in directories unittest discovery is scanning. https://hg.python.org/cpython/rev/1d72402c1c91 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 20:37:01 2016 From: report at bugs.python.org (Robert Collins) Date: Tue, 15 Mar 2016 00:37:01 +0000 Subject: [issue25320] unittest loader.py TypeError when code directory contains a socket In-Reply-To: <1444063424.79.0.244583020203.issue25320@psf.upfronthosting.co.za> Message-ID: <1458002221.96.0.796604934837.issue25320@psf.upfronthosting.co.za> Robert Collins added the comment: Thanks for the patch; the test may be redundant but not enough to matter for now - and the bug really doth need fixing, so I've applied it as-is. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 20:39:56 2016 From: report at bugs.python.org (STINNER Victor) Date: Tue, 15 Mar 2016 00:39:56 +0000 Subject: [issue26564] Malloc debug hooks: display memory block traceback on error Message-ID: <1458002396.02.0.186265116381.issue26564@psf.upfronthosting.co.za> New submission from STINNER Victor: Python implements debug hooks on Python memory allocators: https://docs.python.org/dev/c-api/memory.html#c.PyMem_SetupDebugHooks Problem: buffer understand and buffer overflow are only detected when a memory block is released, which may occur far from the code responsible to create the buffer. Attached patch dumps the traceback where a memory block was allocated on error in malloc debug hooks. The feature requires to enable tracemalloc to record tracebacks. test.py used in below example: ---- import _testcapi def f(): _testcapi.pymem_buffer_overflow() f() ---- Example: --- haypo at selma$ ./python -X tracemalloc=5 test.py Debug memory block at address p=0x22e8be0: API 'm' 16 bytes originally requested The 7 pad bytes at p-7 are FORBIDDENBYTE, as expected. The 8 pad bytes at tail=0x22e8bf0 are not all FORBIDDENBYTE (0xfb): at tail+0: 0x78 *** OUCH ... The block was made by call #37240 to debug malloc/realloc. Data at p: cb cb cb cb cb cb cb cb cb cb cb cb cb cb cb cb Memory block traceback (most recent call first): File "test.py", line 4 File "test.py", line 6 Fatal Python error: bad trailing pad byte Current thread 0x00007f4a93d9c700 (most recent call first): File "test.py", line 4 in f File "test.py", line 6 in Abandon (core dumped) --- The patch adds the "Memory block traceback" section. ---------- files: pymem_tb.patch keywords: patch messages: 261793 nosy: haypo priority: normal severity: normal status: open title: Malloc debug hooks: display memory block traceback on error type: enhancement versions: Python 3.6 Added file: http://bugs.python.org/file42167/pymem_tb.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 22:02:09 2016 From: report at bugs.python.org (Memeplex) Date: Tue, 15 Mar 2016 02:02:09 +0000 Subject: [issue26565] [ctypes] Add value attribute to non basic pointers. Message-ID: <1458007329.36.0.71536825947.issue26565@psf.upfronthosting.co.za> New submission from Memeplex: I know one can do addressof(p.contents), but it's a bit inconsistent that c_void_p and c_char_p contain the same information in the value attribute. ---------- components: ctypes messages: 261794 nosy: memeplex priority: normal severity: normal status: open title: [ctypes] Add value attribute to non basic pointers. type: enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 22:32:21 2016 From: report at bugs.python.org (Damian Myerscough) Date: Tue, 15 Mar 2016 02:32:21 +0000 Subject: [issue26562] Large Involuntary context switches during oom-killer In-Reply-To: <1457992452.77.0.650639243294.issue26562@psf.upfronthosting.co.za> Message-ID: <1458009141.35.0.778107139469.issue26562@psf.upfronthosting.co.za> Damian Myerscough added the comment: @rbcollins there is nothing else running in the Docker container other than the python interpreter. I did an `strace` of the process mmap(NULL, 3149824, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7effc2d0c000 munmap(0x7effc300d000, 790528) = 0 @haypo, this only with Python when it is killed by oom-killer. NodeJS/C++ dont show nearly as many involuntary context switches or page faults. I logged the bug to see if anyone else has encountered this. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 22:41:58 2016 From: report at bugs.python.org (Ned Deily) Date: Tue, 15 Mar 2016 02:41:58 +0000 Subject: [issue26559] logging.handlers.MemoryHandler flushes on shutdown but not removal In-Reply-To: <1457978506.77.0.246614135279.issue26559@psf.upfronthosting.co.za> Message-ID: <1458009718.98.0.0166151368903.issue26559@psf.upfronthosting.co.za> Changes by Ned Deily : ---------- nosy: +vinay.sajip _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 00:18:02 2016 From: report at bugs.python.org (Nick Coghlan) Date: Tue, 15 Mar 2016 04:18:02 +0000 Subject: [issue23857] Make default HTTPS certificate verification setting configurable In-Reply-To: <1428057486.92.0.857087998573.issue23857@psf.upfronthosting.co.za> Message-ID: <1458015482.06.0.716841254842.issue23857@psf.upfronthosting.co.za> Nick Coghlan added the comment: Explicitly noting for anyone considering backporting this change (together with PEP 466 & 476) to a long term support release: watch out for https://bugs.python.org/issue22438 The RHEL/CentOS backport includes a reimplementation of sslwrap: * https://git.centos.org/blob/rpms!python.git/f63228654ecef84a78c552dac832f4cd939cf584/SPECS!python.spec#L989 * https://git.centos.org/blob/rpms!python.git/f63228654ecef84a78c552dac832f4cd939cf584/SOURCES!00221-pep466-backport-sslwrap-c-ssl.patch ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 00:21:16 2016 From: report at bugs.python.org (Nick Coghlan) Date: Tue, 15 Mar 2016 04:21:16 +0000 Subject: [issue22438] eventlet broke by python 2.7.x In-Reply-To: <1411075272.39.0.133162978572.issue22438@psf.upfronthosting.co.za> Message-ID: <1458015676.71.0.876160867022.issue22438@psf.upfronthosting.co.za> Nick Coghlan added the comment: Just noting that if we decided to reconsider addressing this upstream for the benefit of folks backporting PEP 493, Robert Kuska wrote a patch to restore sslwrap for the RHEL/CentOS PEP 466 backport: * https://git.centos.org/blob/rpms!python.git/f63228654ecef84a78c552dac832f4cd939cf584/SPECS!python.spec#L989 * https://git.centos.org/blob/rpms!python.git/f63228654ecef84a78c552dac832f4cd939cf584/SOURCES!00221-pep466-backport-sslwrap-c-ssl.patch ---------- nosy: +ncoghlan, rkuska _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 00:40:04 2016 From: report at bugs.python.org (Patrick Egan) Date: Tue, 15 Mar 2016 04:40:04 +0000 Subject: [issue26533] logging.config does not allow disable_existing_loggers=True In-Reply-To: <1457648926.18.0.758256853063.issue26533@psf.upfronthosting.co.za> Message-ID: <1458016804.5.0.292551422348.issue26533@psf.upfronthosting.co.za> Patrick Egan added the comment: Used proposed method to solve this bug and implemented the extra kwarg disable_existing_loggers to the listen() parameters. ---------- keywords: +patch nosy: +chillydev Added file: http://bugs.python.org/file42168/Issue#26533.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 01:18:42 2016 From: report at bugs.python.org (Martin Panter) Date: Tue, 15 Mar 2016 05:18:42 +0000 Subject: [issue22359] Remove incorrect uses of recursive make In-Reply-To: <1410165869.76.0.203082844365.issue22359@psf.upfronthosting.co.za> Message-ID: <1458019122.92.0.946008427915.issue22359@psf.upfronthosting.co.za> Martin Panter added the comment: Here is a patch implementing my idea to make file reneration a separate step, not automatically run during the normal build process. But it is sounding like other people don?t like this idea, so Xavier?s approach might be less controversial even if it is more complicated. ---------- Added file: http://bugs.python.org/file42169/separate-regen.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 01:38:18 2016 From: report at bugs.python.org (Benjamin Peterson) Date: Tue, 15 Mar 2016 05:38:18 +0000 Subject: [issue19450] Bug in sqlite in Windows binaries In-Reply-To: <1383131558.55.0.853606379194.issue19450@psf.upfronthosting.co.za> Message-ID: <1458020298.49.0.797118005909.issue19450@psf.upfronthosting.co.za> Benjamin Peterson added the comment: Let's make Windows use the same version as the Mac installer. ---------- assignee: benjamin.peterson -> steve.dower _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 01:59:49 2016 From: report at bugs.python.org (Martin Panter) Date: Tue, 15 Mar 2016 05:59:49 +0000 Subject: [issue26499] http.client.IncompleteRead from HTTPResponse read after part reading file In-Reply-To: <1457345453.59.0.0327827539319.issue26499@psf.upfronthosting.co.za> Message-ID: <1458021589.34.0.962923878649.issue26499@psf.upfronthosting.co.za> Martin Panter added the comment: Here is a modified version of the tests that I propose to commit soon. I trimmed the size of the tests down and simplified some of them. I also mentioned that BufferedIOBase is supported in the documentation. ---------- stage: patch review -> commit review Added file: http://bugs.python.org/file42170/issue26499_6.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 04:29:50 2016 From: report at bugs.python.org (koobs) Date: Tue, 15 Mar 2016 08:29:50 +0000 Subject: [issue17758] test_site fails when the user does not have a home directory In-Reply-To: <1366120279.38.0.306129828747.issue17758@psf.upfronthosting.co.za> Message-ID: <1458030590.6.0.710725256621.issue17758@psf.upfronthosting.co.za> koobs added the comment: @Victor, it would be nice if this test could instead use/fake/mock what it needs in the build directory, or is this not possible because it needs an 'actual' user/group context to work? ---------- nosy: +koobs _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 05:14:14 2016 From: report at bugs.python.org (STINNER Victor) Date: Tue, 15 Mar 2016 09:14:14 +0000 Subject: [issue17758] test_site fails when the user does not have a home directory In-Reply-To: <1458030590.6.0.710725256621.issue17758@psf.upfronthosting.co.za> Message-ID: STINNER Victor added the comment: Everything is possible. It's just a matter of priorities. Do you want to work on a patch. I'm not really interested. If you consider that it'd worth, open a new issue. I close this issue since the iniyal bug is closed. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 05:34:15 2016 From: report at bugs.python.org (Antoine Pitrou) Date: Tue, 15 Mar 2016 09:34:15 +0000 Subject: [issue26523] multiprocessing ThreadPool is untested In-Reply-To: <1457555830.32.0.570545129367.issue26523@psf.upfronthosting.co.za> Message-ID: <1458034455.63.0.606817565718.issue26523@psf.upfronthosting.co.za> Antoine Pitrou added the comment: > Is it worth to change multiprocessing.Pool in _TestPoolWorkerErrors > and _TestPoolWorkerLifetime? Currently they work only for processes, > but may be they can be generalized. Perhaps as another issue? It may be more involved than this one. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 05:47:06 2016 From: report at bugs.python.org (STINNER Victor) Date: Tue, 15 Mar 2016 09:47:06 +0000 Subject: [issue26566] Failures on FreeBSD CURRENT buildbot Message-ID: <1458035226.03.0.186362831064.issue26566@psf.upfronthosting.co.za> New submission from STINNER Victor: http://buildbot.python.org/all/builders/AMD64%20FreeBSD%20CURRENT%203.x/builds/218/steps/test/logs/stdio ====================================================================== FAIL: test_terminate (test.test_subprocess.POSIXProcessTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/test_subprocess.py", line 1679, in test_terminate self.assertEqual(p.wait(), -signal.SIGTERM) AssertionError: 0 != -15 ---------------------------------------------------------------------- ====================================================================== FAIL: test_main (test.test_signal.InterProcessSignalTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/test_signal.py", line 197, in test_main self.fail(tb) AssertionError: Traceback (most recent call last): File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/test_signal.py", line 180, in test_main self.run_test() File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/test_signal.py", line 117, in run_test self.assertTrue(self.a_called) File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/unittest/case.py", line 677, in assertTrue raise self.failureException(msg) AssertionError: False is not true [ 94/400/2] test_multiprocessing_main_handling Timeout (1:00:00)! Thread 0x0000000801815000 (most recent call first): File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/selectors.py", line 376 in select File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/subprocess.py", line 1709 in _communicate File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/subprocess.py", line 1075 in communicate File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/support/script_helper.py", line 86 in run_python_until_end File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/support/script_helper.py", line 96 in _assert_python File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/support/script_helper.py", line 135 in assert_python_ok File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/test_multiprocessing_main_handling.py", line 155 in _check_script File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/test_multiprocessing_main_handling.py", line 182 in test_ipython_workaround File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/unittest/case.py", line 600 in run (...) http://buildbot.python.org/all/builders/AMD64%20FreeBSD%20CURRENT%203.x/builds/217/steps/test/logs/stdio [ 6/400] test_multiprocessing_fork Timeout (1:00:00)! Thread 0x0000000801815000 (most recent call first): File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/multiprocessing/connection.py", line 379 in _recv File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/multiprocessing/connection.py", line 407 in _recv_bytes File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/multiprocessing/connection.py", line 250 in recv File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/multiprocessing/managers.py", line 717 in _callmethod File "", line 2 in terminate File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/_test_multiprocessing.py", line 1837 in test_terminate (...) ---------- keywords: buildbot messages: 261805 nosy: haypo priority: normal severity: normal status: open title: Failures on FreeBSD CURRENT buildbot versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 05:49:57 2016 From: report at bugs.python.org (koobs) Date: Tue, 15 Mar 2016 09:49:57 +0000 Subject: [issue26566] Failures on FreeBSD CURRENT buildbot In-Reply-To: <1458035226.03.0.186362831064.issue26566@psf.upfronthosting.co.za> Message-ID: <1458035397.19.0.722820196727.issue26566@psf.upfronthosting.co.za> Changes by koobs : ---------- nosy: +koobs _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 05:55:52 2016 From: report at bugs.python.org (Antoine Pitrou) Date: Tue, 15 Mar 2016 09:55:52 +0000 Subject: [issue26562] Large Involuntary context switches during oom-killer In-Reply-To: <1457992452.77.0.650639243294.issue26562@psf.upfronthosting.co.za> Message-ID: <1458035752.87.0.326776785532.issue26562@psf.upfronthosting.co.za> Antoine Pitrou added the comment: Why would it be a Python issue? By construction I doubt the OOM killer lets the process run anything before force-killing it. ---------- nosy: +pitrou _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 05:56:08 2016 From: report at bugs.python.org (Roundup Robot) Date: Tue, 15 Mar 2016 09:56:08 +0000 Subject: [issue26523] multiprocessing ThreadPool is untested In-Reply-To: <1457555830.32.0.570545129367.issue26523@psf.upfronthosting.co.za> Message-ID: <20160315095603.118697.71938@psf.io> Roundup Robot added the comment: New changeset 4cabf12b7fc6 by Antoine Pitrou in branch '3.5': Issue #26523: The multiprocessing thread pool (multiprocessing.dummy.Pool) was untested. https://hg.python.org/cpython/rev/4cabf12b7fc6 New changeset 131f92510164 by Antoine Pitrou in branch 'default': Issue #26523: The multiprocessing thread pool (multiprocessing.dummy.Pool) was untested. https://hg.python.org/cpython/rev/131f92510164 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 05:56:34 2016 From: report at bugs.python.org (Antoine Pitrou) Date: Tue, 15 Mar 2016 09:56:34 +0000 Subject: [issue26523] multiprocessing ThreadPool is untested In-Reply-To: <1457555830.32.0.570545129367.issue26523@psf.upfronthosting.co.za> Message-ID: <1458035794.83.0.823810300825.issue26523@psf.upfronthosting.co.za> Changes by Antoine Pitrou : ---------- resolution: -> fixed stage: commit review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 06:33:05 2016 From: report at bugs.python.org (Roundup Robot) Date: Tue, 15 Mar 2016 10:33:05 +0000 Subject: [issue26566] Failures on FreeBSD CURRENT buildbot In-Reply-To: <1458035226.03.0.186362831064.issue26566@psf.upfronthosting.co.za> Message-ID: <20160315103258.108819.30681@psf.io> Roundup Robot added the comment: New changeset 93b998d47bc0 by Victor Stinner in branch 'default': Issue #26566: Rewrite test_signal.InterProcessSignalTests https://hg.python.org/cpython/rev/93b998d47bc0 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 07:31:26 2016 From: report at bugs.python.org (STINNER Victor) Date: Tue, 15 Mar 2016 11:31:26 +0000 Subject: [issue26562] Large Involuntary context switches during oom-killer In-Reply-To: <1457992452.77.0.650639243294.issue26562@psf.upfronthosting.co.za> Message-ID: <1458041486.77.0.537188112278.issue26562@psf.upfronthosting.co.za> STINNER Victor added the comment: > When oom-killer is trigger IMHO this is your root problem. > When oom-killer is trigger I see a large number of involuntary context switches ... The principle of *involuntarty* context switches is that the application is not responsible for them. > I tried the same test using NodeJS/C++ and I could see a lot less involuntary context switches and major page faults which indicates this could be a Python issue. Your rationale cannot be good. It is not a Python bug. OOM Killer is not a bug but a feature to limit abuse of resources on Linux. But yeah, in my experience, Linux becomes crazy when it reachs OOM Killer. You can try to tune your kernel, but it's much better to always avoid using all memory ;-) ---------- resolution: -> not a bug status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 07:44:01 2016 From: report at bugs.python.org (STINNER Victor) Date: Tue, 15 Mar 2016 11:44:01 +0000 Subject: [issue24230] tempfile.mkdtemp() doesn't work with bytes paths In-Reply-To: <1431968694.0.0.694998892664.issue24230@psf.upfronthosting.co.za> Message-ID: <1458042241.44.0.649372364158.issue24230@psf.upfronthosting.co.za> STINNER Victor added the comment: I don't understand the rationale to add new functions using bytes filenames. IMHO it's a bad practice to pass bytes filenames to write portable code. On Windows, bytes lead to strange bugs: os.listdir(bytes) gives you filenames which don't exist when a filename cannot be encoded to the ANSI code page. On UNIX, os.fsencode() and os.fsdecode() allows you to convert filenames between unicode and bytes. It provides nice properties like os.fsencode(os.fsdecode(value))==value where value is bytes. No need to add new APIs, use existing APIs an use os.fsencode() and os.fsdecode() on top of them. Bytes filenames are deprecated on Windows since Python 3.2. The new os.scandir() function doesn't support bytes for example, it's a deliberate choice. Maybe I missed an important technical issue? ---------- nosy: +haypo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 07:46:23 2016 From: report at bugs.python.org (STINNER Victor) Date: Tue, 15 Mar 2016 11:46:23 +0000 Subject: [issue24230] tempfile.mkdtemp() doesn't work with bytes paths In-Reply-To: <1431968694.0.0.694998892664.issue24230@psf.upfronthosting.co.za> Message-ID: <1458042383.77.0.419222988564.issue24230@psf.upfronthosting.co.za> STINNER Victor added the comment: """ Today we're doing something like this: tmpdir = tempfile.mkdtemp('', 'hgtests.', d and d.decode('utf-8')).encode('utf-8') """ Don't do that. UTF-8 is not the right encoding. Use os.fsencode() and os.fsdecode(). Internally, Python uses sys.getfilesystemencoding() with 'surrogateescape' error handler (but 'strict' error handler on Windows). If you use UTF-8, you can get indirectly mojibake. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 09:15:16 2016 From: report at bugs.python.org (STINNER Victor) Date: Tue, 15 Mar 2016 13:15:16 +0000 Subject: [issue26567] Use tracemalloc to display the traceback where an object was allocated when a ResourceWarning is emitted Message-ID: <1458047716.42.0.114286591066.issue26567@psf.upfronthosting.co.za> New submission from STINNER Victor: Python emits ResourceWarning when an object using limited resource is destroyed without being explicitly closed: files, sockets, etc. The problem is that it's hard to find where the object comes from, since the warning can occur very late, in the garbage collector, etc. I propose to reuse tracemalloc.get_object_traceback() to show were the object was allocated, when tracemalloc traces memory allocations. In practice, I propose to add a new "source" parameter to warnings.showwarning(). Attached patch: * Add a new keyword-only source parameter to warnings.showwarning() * Add C function PyErr_ResourceWarning() to pass source * showwarning() uses tracemalloc.get_object_traceback() to get the traceback were the object was allocated * Modify socket.socket, io.FileIO and os.scandir destructor to use PyErr_ResourceWarning() Backward-compatibility problem: The C function PyErr_ResourceWarning() always call warnings.showwarning() with the keyword parameter source. If an application replaces the warnings.showwarning() function, it will probably fail because it doesn't know the source parameter. I don't know how to handle this backward compatibility issue. The patch is incomplete, it's not possible yet to emit a warning in pure Python with a source parameter. x.py script used for examples below: ----------------- import warnings import os import socket def func2(): #f=open("/etc/issue") #f=os.scandir('.') f=socket.socket() f=None def func(): func2() func() ----------------- Output with Python 3.5: ----- x.py:9: ResourceWarning: unclosed f=None ----- Output with -X tracemalloc=5 command line option and patched Python 3.6: ----- x.py:9: ResourceWarning: unclosed f=None Object allocated at (most recent call first): File "x.py", lineno 8 f=socket.socket() File "x.py", lineno 12 func2() File "x.py", lineno 14 func() ----- It's much easier to understand where the warning comes from, no? At x.py:8, line "f=socket.socket()". Note: the traceback doesn't contain the function name, since tracemalloc only stores filename and line number. See also the issue #26564 "Malloc debug hooks: display memory block traceback on error". For Python < 3.6, I wrote "res_warn.py" script which monkey-patches io.FileIO and socket.socket to implement something similar. The script is a fragile hack. I would prefer to have the feature built-in Python. https://bitbucket.org/haypo/misc/src/0a40f27360424145bad0f9b62c9e9148ffdbb169/python/res_warn.py ---------- files: warnings_tracemalloc.patch keywords: patch messages: 261812 nosy: haypo, serhiy.storchaka, yselivanov priority: normal severity: normal status: open title: Use tracemalloc to display the traceback where an object was allocated when a ResourceWarning is emitted versions: Python 3.6 Added file: http://bugs.python.org/file42171/warnings_tracemalloc.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 09:17:41 2016 From: report at bugs.python.org (STINNER Victor) Date: Tue, 15 Mar 2016 13:17:41 +0000 Subject: [issue26564] Malloc debug hooks: display memory block traceback on error In-Reply-To: <1458002396.02.0.186265116381.issue26564@psf.upfronthosting.co.za> Message-ID: <1458047861.68.0.839480816194.issue26564@psf.upfronthosting.co.za> STINNER Victor added the comment: See also the issue #26567: "Use tracemalloc to display the traceback where an object was allocated when a ResourceWarning is emitted". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 09:17:49 2016 From: report at bugs.python.org (STINNER Victor) Date: Tue, 15 Mar 2016 13:17:49 +0000 Subject: [issue26567] ResourceWarning: Use tracemalloc to display the traceback where an object was allocated when a ResourceWarning is emitted In-Reply-To: <1458047716.42.0.114286591066.issue26567@psf.upfronthosting.co.za> Message-ID: <1458047869.38.0.867554820627.issue26567@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- title: Use tracemalloc to display the traceback where an object was allocated when a ResourceWarning is emitted -> ResourceWarning: Use tracemalloc to display the traceback where an object was allocated when a ResourceWarning is emitted _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 09:31:41 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 15 Mar 2016 13:31:41 +0000 Subject: [issue26040] Improve coverage and rigour of test.test_math In-Reply-To: <1452181282.79.0.203850145541.issue26040@psf.upfronthosting.co.za> Message-ID: <1458048701.36.0.849403395684.issue26040@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- nosy: +christian.heimes, eric.smith, lemburg, serhiy.storchaka, stutzbach versions: +Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 10:32:00 2016 From: report at bugs.python.org (STINNER Victor) Date: Tue, 15 Mar 2016 14:32:00 +0000 Subject: [issue26568] Add a new warnings.showmsg() function taking a warnings.WarningMessage object Message-ID: <1458052320.63.0.791464551893.issue26568@psf.upfronthosting.co.za> New submission from STINNER Victor: Currently, the warnings.showformat() function take between 4 and 6 parameters and it's not possible to add new parameters. warnings.showformat() calls warnings.formatwarnings() with 5 parameters. Again, it's not easy to pass new parameters. I would like to add a new "source" parameter for ResourceWarning: see issue #26567 "ResourceWarning: Use tracemalloc to display the traceback where an object was allocated when a ResourceWarning is emitted". To make warnings extensible, I propose to: * Add new showmsg() and formatmsg() functions to the warnings module, these functions take a warnings.WarningMessage instance * The _warnings module calls warnings.showmsg() rather than warnings.showwarning() * For backward compatibility, warnings.showmsg() calls warnings.showwarning() if warnings.showwarning() was replaced. Same for warnings.formatmsg(): call warnings.formatwarning() if replaced. Attached patch implements these changes. With these changes, the warnings looks a little bit more like the logging module and its logging.LogRecord class. The patch is incomplete, it doesn't add much tests yet and it doesn't touch the documentation. I would prefer to get the new API (and the whole idea) approved before going too far. Note: If warnings.showwarning is deleted ("del warnings.showwarning"), showmsg() uses its own implementation. Same for formatmsg(). ---------- files: warnings_showmsg.patch keywords: patch messages: 261814 nosy: haypo priority: normal severity: normal status: open title: Add a new warnings.showmsg() function taking a warnings.WarningMessage object versions: Python 3.6 Added file: http://bugs.python.org/file42172/warnings_showmsg.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 10:32:49 2016 From: report at bugs.python.org (STINNER Victor) Date: Tue, 15 Mar 2016 14:32:49 +0000 Subject: [issue26567] ResourceWarning: Use tracemalloc to display the traceback where an object was allocated when a ResourceWarning is emitted In-Reply-To: <1458047716.42.0.114286591066.issue26567@psf.upfronthosting.co.za> Message-ID: <1458052369.4.0.909055579574.issue26567@psf.upfronthosting.co.za> STINNER Victor added the comment: > Backward-compatibility problem: The C function PyErr_ResourceWarning() always call warnings.showwarning() with the keyword parameter source. If an application replaces the warnings.showwarning() function, it will probably fail because it doesn't know the source parameter. I proposed the issue #26568 "Add a new warnings.showmsg() function taking a warnings.WarningMessage object" to fix this issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 10:34:54 2016 From: report at bugs.python.org (STINNER Victor) Date: Tue, 15 Mar 2016 14:34:54 +0000 Subject: [issue26564] Malloc debug hooks: display memory block traceback on error In-Reply-To: <1458002396.02.0.186265116381.issue26564@psf.upfronthosting.co.za> Message-ID: <1458052494.01.0.0828324087772.issue26564@psf.upfronthosting.co.za> STINNER Victor added the comment: I reviewed my own patch on Rietveld :-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 12:16:43 2016 From: report at bugs.python.org (STINNER Victor) Date: Tue, 15 Mar 2016 16:16:43 +0000 Subject: [issue26558] Disable PyGILState_Check() when Py_NewInterpreter() is called and add more checks on the GIL In-Reply-To: <1457961401.7.0.508641923687.issue26558@psf.upfronthosting.co.za> Message-ID: <1458058603.31.0.100553926554.issue26558@psf.upfronthosting.co.za> STINNER Victor added the comment: Ok, it looks like buildbots are happy. I close the issue. ---------- resolution: -> fixed status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 12:26:07 2016 From: report at bugs.python.org (Roundup Robot) Date: Tue, 15 Mar 2016 16:26:07 +0000 Subject: [issue26558] Disable PyGILState_Check() when Py_NewInterpreter() is called and add more checks on the GIL In-Reply-To: <1457961401.7.0.508641923687.issue26558@psf.upfronthosting.co.za> Message-ID: <20160315162602.108823.16978@psf.io> Roundup Robot added the comment: New changeset b394fc71f92a by Victor Stinner in branch '3.5': Fix Py_FatalError() if called without the GIL https://hg.python.org/cpython/rev/b394fc71f92a New changeset c298c6d8b324 by Victor Stinner in branch '3.5': faulthandler: Test Py_FatalError() with GIL released https://hg.python.org/cpython/rev/c298c6d8b324 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 12:31:27 2016 From: report at bugs.python.org (STINNER Victor) Date: Tue, 15 Mar 2016 16:31:27 +0000 Subject: [issue26102] access violation in PyErrFetch if tcur==null in PyGILState_Release In-Reply-To: <1452714471.66.0.669763876009.issue26102@psf.upfronthosting.co.za> Message-ID: <1458059487.31.0.471337300958.issue26102@psf.upfronthosting.co.za> STINNER Victor added the comment: Good news: it looks like I fixed the Py_FatalError() bug in the issue #26558. Py_FatalError() can again be called with the GIL released. The bug was introduced in Python 3.0. Since your issue is a bug in your code and that Py_FatalError() was fixed, I close the issue. Thanks for your bug report. ---------- nosy: +haypo resolution: -> fixed status: open -> closed versions: +Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 12:55:58 2016 From: report at bugs.python.org (STINNER Victor) Date: Tue, 15 Mar 2016 16:55:58 +0000 Subject: [issue20891] PyGILState_Ensure on non-Python thread causes fatal error In-Reply-To: <1394563213.18.0.508100602451.issue20891@psf.upfronthosting.co.za> Message-ID: <1458060958.49.0.0576119784708.issue20891@psf.upfronthosting.co.za> STINNER Victor added the comment: ptest.c: Portable example using Python API. ---------- Added file: http://bugs.python.org/file42173/ptest.c _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 12:56:16 2016 From: report at bugs.python.org (STINNER Victor) Date: Tue, 15 Mar 2016 16:56:16 +0000 Subject: [issue20891] PyGILState_Ensure on non-Python thread causes fatal error In-Reply-To: <1394563213.18.0.508100602451.issue20891@psf.upfronthosting.co.za> Message-ID: <1458060976.49.0.902573461949.issue20891@psf.upfronthosting.co.za> STINNER Victor added the comment: Attached patch should fix the issue. ---------- keywords: +patch Added file: http://bugs.python.org/file42174/PyGILState_Ensure.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 13:10:13 2016 From: report at bugs.python.org (SilentGhost) Date: Tue, 15 Mar 2016 17:10:13 +0000 Subject: [issue26565] [ctypes] Add value attribute to non basic pointers. In-Reply-To: <1458007329.36.0.71536825947.issue26565@psf.upfronthosting.co.za> Message-ID: <1458061813.6.0.81640287715.issue26565@psf.upfronthosting.co.za> Changes by SilentGhost : ---------- nosy: +amaury.forgeotdarc, belopolsky, meador.inge versions: +Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 13:11:21 2016 From: report at bugs.python.org (SilentGhost) Date: Tue, 15 Mar 2016 17:11:21 +0000 Subject: [issue26560] Error in assertion in wsgiref.handlers.BaseHandler.start_response In-Reply-To: <1457979107.59.0.709846628148.issue26560@psf.upfronthosting.co.za> Message-ID: <1458061881.56.0.0347074379163.issue26560@psf.upfronthosting.co.za> Changes by SilentGhost : ---------- nosy: +pje type: -> behavior versions: +Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 15:27:26 2016 From: report at bugs.python.org (Robert Collins) Date: Tue, 15 Mar 2016 19:27:26 +0000 Subject: [issue24263] unittest cannot load module whose name starts with Unicode In-Reply-To: <1435031451.77.0.239152930978.issue24263@psf.upfronthosting.co.za> Message-ID: <1458070046.8.0.45261176144.issue24263@psf.upfronthosting.co.za> Robert Collins added the comment: sih4sing5hong5 - I think we do need a test in fact - it can be done using mocks, but right now I think the patch has a bug - it looks for isidentifier on $thing.py, but not on just $thing (which we need to do to handle packages, vs modules). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 15:39:38 2016 From: report at bugs.python.org (STINNER Victor) Date: Tue, 15 Mar 2016 19:39:38 +0000 Subject: [issue26568] Add a new warnings.showmsg() function taking a warnings.WarningMessage object In-Reply-To: <1458052320.63.0.791464551893.issue26568@psf.upfronthosting.co.za> Message-ID: <1458070778.89.0.57718047629.issue26568@psf.upfronthosting.co.za> STINNER Victor added the comment: I'm not sure about the method names showmsg() and formatmsg(). Maybe: showwarnmsg() and formatwarnmsg()? First I used warnings.show() and warnings.format(), but "format()" is already the name of a builtin function. By the way, I would prefer to use underscore between names, like show_msg() or show_warn_msg(). But I don't know if it's ok to use a different naming scheme in an existing module :-/ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 15:49:21 2016 From: report at bugs.python.org (Xavier de Gaye) Date: Tue, 15 Mar 2016 19:49:21 +0000 Subject: [issue22359] Remove incorrect uses of recursive make In-Reply-To: <1410165869.76.0.203082844365.issue22359@psf.upfronthosting.co.za> Message-ID: <1458071361.05.0.803239408711.issue22359@psf.upfronthosting.co.za> Xavier de Gaye added the comment: > But I am a bit worried at the new makefile syntax [ifeq directive and $(findstring) function]. I suspect it is Gnu specific, and that Python tries to support other versions of Make as well. Yes, they are both GNU extensions :( To avoid modifying configure.ac since the information is already available, the recipes could be modified with the following conditional: cross_compiling=$$(echo $(PYTHON_FOR_BUILD) | sed "s/.*_PYTHON_HOST_PLATFORM.*/yes/"); \ if [ "$$cross_compiling" = "yes" ]; then \ touch $@; else \ # The original recipes. fi So the built binaries $(PGEN) and Programs/_freeze_importlib would be dummy empty files, but that would not prevent Programs/_freeze_importlib.o, $(LIBRARY_OBJS_OMIT_FROZEN) and $(PGENOBJS) to be needlessly cross-compiled. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 15:54:15 2016 From: report at bugs.python.org (Niv Ben-David) Date: Tue, 15 Mar 2016 19:54:15 +0000 Subject: [issue25690] Replacement for unittest.mock.mock_open In-Reply-To: <1448122983.8.0.049241542179.issue25690@psf.upfronthosting.co.za> Message-ID: <1458071655.0.0.816808426925.issue25690@psf.upfronthosting.co.za> Niv Ben-David added the comment: I copied the code in place of the old mock_open in unittest/mock.py. Regarding the VFS issue, I think that it really depends on what you're trying to test. If you only care about "side effects" on the file system, the VFS way it much better and easier. But if you want to test the way files are handled by your code (proper handling of errors during open/read/write seems the obvious thing here, but I can think of other use cases), then I think MockOpen is the better tool. ---------- Added file: http://bugs.python.org/file42175/mock_open.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 16:44:48 2016 From: report at bugs.python.org (Martin Panter) Date: Tue, 15 Mar 2016 20:44:48 +0000 Subject: [issue18320] python installation is broken if prefix is overridden on an install target In-Reply-To: <1372404539.33.0.335439360663.issue18320@psf.upfronthosting.co.za> Message-ID: <1458074688.92.0.00808372894514.issue18320@psf.upfronthosting.co.za> Martin Panter added the comment: I agree with Martin v. L?wis that this is not a real bug. Cosmicduck doesn?t seem aware of the ?configure --prefix=. . .? option, but I don?t think it is right to add hacks to the makefile to prevent overriding variables. ---------- nosy: +martin.panter _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 16:58:15 2016 From: report at bugs.python.org (Roundup Robot) Date: Tue, 15 Mar 2016 20:58:15 +0000 Subject: [issue26564] Malloc debug hooks: display memory block traceback on error In-Reply-To: <1458002396.02.0.186265116381.issue26564@psf.upfronthosting.co.za> Message-ID: <20160315205803.45760.25237@psf.io> Roundup Robot added the comment: New changeset 18a19e62bac5 by Victor Stinner in branch 'default': Enhance and rewrite traceback dump C functions https://hg.python.org/cpython/rev/18a19e62bac5 New changeset fea3c6e9a38e by Victor Stinner in branch '3.5': _tracemalloc: store lineno as unsigned int https://hg.python.org/cpython/rev/fea3c6e9a38e ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 17:42:24 2016 From: report at bugs.python.org (Roundup Robot) Date: Tue, 15 Mar 2016 21:42:24 +0000 Subject: [issue26564] Malloc debug hooks: display memory block traceback on error In-Reply-To: <1458002396.02.0.186265116381.issue26564@psf.upfronthosting.co.za> Message-ID: <20160315214221.2075.56523@psf.io> Roundup Robot added the comment: New changeset cef6a32d805f by Victor Stinner in branch 'default': On memory error, dump the memory block traceback https://hg.python.org/cpython/rev/cef6a32d805f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 17:50:11 2016 From: report at bugs.python.org (Roundup Robot) Date: Tue, 15 Mar 2016 21:50:11 +0000 Subject: [issue26564] Malloc debug hooks: display memory block traceback on error In-Reply-To: <1458002396.02.0.186265116381.issue26564@psf.upfronthosting.co.za> Message-ID: <20160315215004.108829.58535@psf.io> Roundup Robot added the comment: New changeset 8215dae7ec3c by Victor Stinner in branch 'default': Oops, revert unwanted change used to create an example https://hg.python.org/cpython/rev/8215dae7ec3c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 18:47:30 2016 From: report at bugs.python.org (Roundup Robot) Date: Tue, 15 Mar 2016 22:47:30 +0000 Subject: [issue26538] regrtest: setup_tests() must not replace module.__path__ (_NamespacePath) with a simple list // importlib & abspath In-Reply-To: <1457696667.94.0.108519122037.issue26538@psf.upfronthosting.co.za> Message-ID: <20160315224727.6785.98429@psf.io> Roundup Robot added the comment: New changeset 96b73b649b15 by Victor Stinner in branch 'default': regrtest: Fix module.__path__ https://hg.python.org/cpython/rev/96b73b649b15 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 18:47:30 2016 From: report at bugs.python.org (Roundup Robot) Date: Tue, 15 Mar 2016 22:47:30 +0000 Subject: [issue26564] Malloc debug hooks: display memory block traceback on error In-Reply-To: <1458002396.02.0.186265116381.issue26564@psf.upfronthosting.co.za> Message-ID: <20160315224727.6785.76624@psf.io> Roundup Robot added the comment: New changeset 769dfcb701ee by Victor Stinner in branch 'default': Issue #26564: Fix test_capi https://hg.python.org/cpython/rev/769dfcb701ee ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 18:56:21 2016 From: report at bugs.python.org (STINNER Victor) Date: Tue, 15 Mar 2016 22:56:21 +0000 Subject: [issue26569] pyclbr.readmodule() and pyclbr.readmodule_ex() doens't support packages Message-ID: <1458082581.41.0.63127238645.issue26569@psf.upfronthosting.co.za> New submission from STINNER Victor: While working on the issue #26295 which converts the test module to a package, I noticed that pyclbr doesn't work with packages: test_pyclbr fails when test becomes a package. Attached patch fixes pyclbr._readmodule(): * Replace "spec.loader.is_package(fullmodule)" test with "spec.submodule_search_locations is not None" to check is the module is a package * for a package, use spec.submodule_search_locations to build __path__ I don't know importlib well enough to say if my usage of importlib spec is correct. ---------- files: pyclbr.patch keywords: patch messages: 261832 nosy: brett.cannon, haypo priority: normal severity: normal status: open title: pyclbr.readmodule() and pyclbr.readmodule_ex() doens't support packages versions: Python 3.6 Added file: http://bugs.python.org/file42176/pyclbr.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 18:56:48 2016 From: report at bugs.python.org (STINNER Victor) Date: Tue, 15 Mar 2016 22:56:48 +0000 Subject: [issue26569] pyclbr.readmodule() and pyclbr.readmodule_ex() don't support packages In-Reply-To: <1458082581.41.0.63127238645.issue26569@psf.upfronthosting.co.za> Message-ID: <1458082608.0.0.67162942488.issue26569@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- title: pyclbr.readmodule() and pyclbr.readmodule_ex() doens't support packages -> pyclbr.readmodule() and pyclbr.readmodule_ex() don't support packages _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 18:57:35 2016 From: report at bugs.python.org (STINNER Victor) Date: Tue, 15 Mar 2016 22:57:35 +0000 Subject: [issue26295] Random failures when running test suite in parallel (-m test -j0) caused by test_regrtest In-Reply-To: <1454663707.24.0.201658170139.issue26295@psf.upfronthosting.co.za> Message-ID: <1458082655.76.0.669843421579.issue26295@psf.upfronthosting.co.za> STINNER Victor added the comment: Hum, test_doctest, test_zipfile and test_pyclbr fail if test is converted to a package (if Lib/test/__init__.py is removed). Attached patch fixes test_zipfile. I created the issue #26569 for test_pyclbr failure. ---------- Added file: http://bugs.python.org/file42177/test_regrtest_tmpdir-2.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 19:04:23 2016 From: report at bugs.python.org (Robert Collins) Date: Tue, 15 Mar 2016 23:04:23 +0000 Subject: [issue25894] unittest subTest failure causes result to be omitted from listing In-Reply-To: <1450331375.94.0.689081172202.issue25894@psf.upfronthosting.co.za> Message-ID: <1458083063.68.0.12820040616.issue25894@psf.upfronthosting.co.za> Robert Collins added the comment: The basic model is this: - a test can have a single outcome [yes, the api is ambiguous, but there it is] - subtests let you identify multiple variations of a single test (note the id tweak etc) and *may* be reported differently We certainly must not report the test as a whole passing if any subtest did not pass. Long term I want to remove the error/failure partitioning of exceptions; its not actually useful. The summary for the test, when subtests are used, should probably enumerate the states. test_foo (3 passed, 2 skipped, 1 failure) in much the same way the run as a whole is enumerated. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 19:11:30 2016 From: report at bugs.python.org (Robert Collins) Date: Tue, 15 Mar 2016 23:11:30 +0000 Subject: [issue25597] unittest.mock does not wrap dunder methods (__getitem__ etc) In-Reply-To: <1447174958.96.0.448093662654.issue25597@psf.upfronthosting.co.za> Message-ID: <1458083490.35.0.999842355603.issue25597@psf.upfronthosting.co.za> Robert Collins added the comment: I think this is a valid mock bug; it likely needs some thoughtful exhaustive testing, and obviously support added for it. ---------- stage: -> test needed title: unittest.mock does not wrap dict objects correctly -> unittest.mock does not wrap dunder methods (__getitem__ etc) _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 19:20:56 2016 From: report at bugs.python.org (Mark Lawrence) Date: Tue, 15 Mar 2016 23:20:56 +0000 Subject: [issue18320] python installation is broken if prefix is overridden on an install target In-Reply-To: <1372404539.33.0.335439360663.issue18320@psf.upfronthosting.co.za> Message-ID: <1458084056.65.0.494541315882.issue18320@psf.upfronthosting.co.za> Changes by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 19:53:24 2016 From: report at bugs.python.org (Damian Myerscough) Date: Tue, 15 Mar 2016 23:53:24 +0000 Subject: [issue26562] Large Involuntary context switches during oom-killer In-Reply-To: <1457992452.77.0.650639243294.issue26562@psf.upfronthosting.co.za> Message-ID: <1458086004.7.0.826636184155.issue26562@psf.upfronthosting.co.za> Damian Myerscough added the comment: Thanks for the feedback, I will continue to dig into this. I know processes go crazy sometimes when OOM killer kicks off, I just wanted to rule out a Python bug or if anyone in the community has seen this before. Thanks ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 20:42:50 2016 From: report at bugs.python.org (Ned Deily) Date: Wed, 16 Mar 2016 00:42:50 +0000 Subject: [issue18320] python installation is broken if prefix is overridden on an install target In-Reply-To: <1372404539.33.0.335439360663.issue18320@psf.upfronthosting.co.za> Message-ID: <1458088970.35.0.764404012033.issue18320@psf.upfronthosting.co.za> Ned Deily added the comment: Allowing prefix to be overridden after configure-time is certainly not the most critical shortcoming of the Python build system and it is possible someone is relying on that behavior. Since no one, including me, seems very interested at this point in trying to change it, let's close this issue. ---------- resolution: -> wont fix stage: needs patch -> resolved status: open -> closed versions: +Python 3.6 -Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 16 00:28:54 2016 From: report at bugs.python.org (Eryk Sun) Date: Wed, 16 Mar 2016 04:28:54 +0000 Subject: [issue19914] help([object]) returns "Not enough memory." on standard Python types, object and object functions In-Reply-To: <1386372447.57.0.257737240226.issue19914@psf.upfronthosting.co.za> Message-ID: <1458102534.78.0.0601152409794.issue19914@psf.upfronthosting.co.za> Eryk Sun added the comment: For posterity for anyone that finds this old issue, I investigated this problem in the debugger in Windows 7. It turns out that more.com (the pager used by Python's help) calls MultiByteToWideChar [1] with dwFlags passed as MB_PRECOMPOSED (1), which is forbidden for UTF-8. The error message is just a generic error that incorrectly assumes decoding the byte string failed due to running out of memory. You may be happy to learn that this problem is fixed in Windows 10. [1]: https://msdn.microsoft.com/en-us/library/dd319072 Here are a few snapshots from the debugger. more.com calls SetConsoleConversions from its init function, InitializeThings: Breakpoint 0 hit more!MORE::InitializeThings: 00000000`ff293058 48895c2408 mov qword ptr [rsp+8],rbx ss:00000000`0024f7a0=0000000000000000 0:000> g Breakpoint 2 hit ulib!WSTRING::SetConsoleConversions: 000007fe`f6498934 8a05d6a80000 mov al,byte ptr [ulib!WSTRING::_UseAnsiConversions (000007fe`f64a3210)] ds:000007f e`f64a3210=00 This causes decoding byte strings to use the current console codepage instead of the system ANSI or OEM codepage. The intention here is to allow a user to correctly display a text file that's in a different encoding. The decoded text is written to the console as Unicode via WriteConsoleW. Here is the bad call where dwFlags (register rdx) is passed as MB_PRECOMPOSED (1), which is invalid for codepage 65001 (register rcx). 0:000> g Breakpoint 1 hit KERNELBASE!MultiByteToWideChar: 000007fe`fd191f00 fff3 push rbx 0:000> ? @rcx Evaluate expression: 65001 = 00000000`0000fde9 0:000> r rdx rdx=0000000000000001 In Windows 10 this argument is passed as 0, the correct value. This problem occurs indirectly via a utility library named ulib.dll, which is used by Windows command-line utilities. It should only occur when console conversions are enabled. Otherwise ulib converts using the system OEM and ANSI codepages. I searched for other utilities that use ulib!WSTRING::SetConsoleConversions: C:\>for %f in (C:\Windows\system32\*.exe) do @(^ More? dumpbin /imports "%f" | ^ More? findstr SetConsoleConversions && echo %f) 7FF713B8934 167 ?SetConsoleConversions at WSTRING@@SAXXZ C:\Windows\system32\find.exe I found that find.exe is also subject to this bug in Windows 7. It fails to print the result if the console is using codepage 65001: C:\Temp\test>type test eggs spam C:\Temp\test>find /n "spam" * ---------- TEST [2]spam C:\Temp\test>chcp 65001 Active code page: 65001 C:\Temp\test>find /n "spam" * ---------- TEST This works correctly in Windows 10. ---------- nosy: +eryksun _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 16 00:29:38 2016 From: report at bugs.python.org (Ilya Kreymer) Date: Wed, 16 Mar 2016 04:29:38 +0000 Subject: [issue26570] comma-separated cookies with expires header do not parse properly Message-ID: <1458102578.18.0.474747054638.issue26570@psf.upfronthosting.co.za> New submission from Ilya Kreymer: This is a peculiar regression in 3.5 where a comma-separated cookie following an expires field is considered invalid: Ex: which results in a silent error/empty cookie in 3.5.1 Python 3.5.1 (default, Dec 26 2015, 18:11:22) [GCC 4.2.1 Compatible Apple LLVM 7.0.2 (clang-700.1.81)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> from http.cookies import SimpleCookie >>> SimpleCookie('A=B; expires=Thu, 01-Jan-1970 00:00:00 GMT, C=D') compared to 3.4.2 and 2.7.9 Python 3.4.2 (default, Jan 29 2015, 06:45:30) [GCC 4.2.1 Compatible Apple LLVM 5.1 (clang-503.0.40)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> from http.cookies import SimpleCookie >>> SimpleCookie('A=B; expires=Thu, 01-Jan-1970 00:00:00 GMT, C=D') Python 2.7.9 (default, Jan 29 2015, 06:28:46) [GCC 4.2.1 Compatible Apple LLVM 5.1 (clang-503.0.40)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> from Cookie import SimpleCookie >>> SimpleCookie('A=B; expires=Thu, 01-Jan-1970 00:00:00 GMT, C=D') This seems to specifically happen when the expires field is the last field in the cookie. eg, this works as expected: >>> SimpleCookie('A=B; expires=Thu, 01-Jan-1970 00:00:00 GMT; Path=/, C=D') I'm not sure if this is related to the other comma-related cookie bugs, such as issue26302 as this does not appear to use the same regex at first glance. I have not had a chance to track it down it further. ---------- components: Library (Lib) messages: 261839 nosy: ikreymer priority: normal severity: normal status: open title: comma-separated cookies with expires header do not parse properly versions: Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 16 00:59:15 2016 From: report at bugs.python.org (Ellison Marks) Date: Wed, 16 Mar 2016 04:59:15 +0000 Subject: [issue26571] turtle regression in 3.5 Message-ID: <1458104355.45.0.620158354917.issue26571@psf.upfronthosting.co.za> New submission from Ellison Marks: I noticed some odd behaviour when running some turtle code I wrote using python 3.5. A simplified example: >>> from turtle import Turtle >>> t = Turtle() >>> t.getscreen().bye() # or manually close the turtle window >>> t2 = Turtle() Traceback (most recent call last): File "", line 1, in File "/usr/lib64/python3.5/turtle.py", line 3816, in __init__ visible=visible) File "/usr/lib64/python3.5/turtle.py", line 2557, in __init__ self._update() File "/usr/lib64/python3.5/turtle.py", line 2660, in _update self._update_data() File "/usr/lib64/python3.5/turtle.py", line 2646, in _update_data self.screen._incrementudc() File "/usr/lib64/python3.5/turtle.py", line 1292, in _incrementudc raise Terminator turtle.Terminator >>> This code works under 3.4, opening a new turtle window the second time Turtle() is called. Under 3.5, a blank white window opens. This seems to be related to https://hg.python.org/cpython/rev/1628484c9408, as the only point that raises Terminator is guarded by a check for `if not TurtleScreen._RUNNING:` ---------- components: Library (Lib) messages: 261840 nosy: Ellison Marks priority: normal severity: normal status: open title: turtle regression in 3.5 type: behavior versions: Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 16 03:13:52 2016 From: report at bugs.python.org (Ethan Furman) Date: Wed, 16 Mar 2016 07:13:52 +0000 Subject: [issue26571] turtle regression in 3.5 In-Reply-To: <1458104355.45.0.620158354917.issue26571@psf.upfronthosting.co.za> Message-ID: <1458112432.44.0.243448187027.issue26571@psf.upfronthosting.co.za> Changes by Ethan Furman : ---------- nosy: +ethan.furman _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 16 03:17:33 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 16 Mar 2016 07:17:33 +0000 Subject: [issue26571] turtle regression in 3.5 In-Reply-To: <1458104355.45.0.620158354917.issue26571@psf.upfronthosting.co.za> Message-ID: <1458112653.38.0.066544475984.issue26571@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- assignee: -> serhiy.storchaka nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 16 03:18:12 2016 From: report at bugs.python.org (Martin Panter) Date: Wed, 16 Mar 2016 07:18:12 +0000 Subject: [issue26564] Malloc debug hooks: display memory block traceback on error In-Reply-To: <1458002396.02.0.186265116381.issue26564@psf.upfronthosting.co.za> Message-ID: <1458112692.64.0.955963115502.issue26564@psf.upfronthosting.co.za> Martin Panter added the comment: FYI Victor if you haven?t already noticed, the Windows buildbots are choking on a variable-length array: ..\Python\traceback.c(513): error C2057: expected constant expression [D:\buildarea\3.x.bolen-windows10\build\PCbuild\pythoncore.vcxproj] ..\Python\traceback.c(513): error C2466: cannot allocate an array of constant size 0 [D:\buildarea\3.x.bolen-windows10\build\PCbuild\pythoncore.vcxproj] ..\Python\traceback.c(513): error C2133: 'buffer': unknown size [D:\buildarea\3.x.bolen-windows10\build\PCbuild\pythoncore.vcxproj] ---------- nosy: +martin.panter _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 16 03:20:24 2016 From: report at bugs.python.org (Roundup Robot) Date: Wed, 16 Mar 2016 07:20:24 +0000 Subject: [issue26499] http.client.IncompleteRead from HTTPResponse read after part reading file In-Reply-To: <1457345453.59.0.0327827539319.issue26499@psf.upfronthosting.co.za> Message-ID: <20160316072017.2574.465@psf.io> Roundup Robot added the comment: New changeset e95e9701b472 by Martin Panter in branch '3.5': Issue #26499: Fixes to HTTPResponse.readline() and read1(), by Silent Ghost https://hg.python.org/cpython/rev/e95e9701b472 New changeset 74b3523d6256 by Martin Panter in branch 'default': Issue #26499: Merge HTTPResponse fix from 3.5 https://hg.python.org/cpython/rev/74b3523d6256 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 16 04:03:15 2016 From: report at bugs.python.org (Mark Lawrence) Date: Wed, 16 Mar 2016 08:03:15 +0000 Subject: [issue19914] help([object]) returns "Not enough memory." on standard Python types, object and object functions In-Reply-To: <1386372447.57.0.257737240226.issue19914@psf.upfronthosting.co.za> Message-ID: <1458115395.26.0.162528972522.issue19914@psf.upfronthosting.co.za> Changes by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 16 04:35:22 2016 From: report at bugs.python.org (Berker Peksag) Date: Wed, 16 Mar 2016 08:35:22 +0000 Subject: [issue26560] Error in assertion in wsgiref.handlers.BaseHandler.start_response In-Reply-To: <1457979107.59.0.709846628148.issue26560@psf.upfronthosting.co.za> Message-ID: <1458117322.69.0.302071474269.issue26560@psf.upfronthosting.co.za> Berker Peksag added the comment: Thanks for the report. Can you give us a bit more information about the issue? Did you get a traceback? Or just noticed it while reading the source code? If you want to write a patch, please read the devguide. ---------- nosy: +berker.peksag priority: normal -> low stage: -> needs patch versions: +Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 16 04:39:57 2016 From: report at bugs.python.org (Martin Panter) Date: Wed, 16 Mar 2016 08:39:57 +0000 Subject: [issue26499] http.client.IncompleteRead from HTTPResponse read after part reading file In-Reply-To: <1457345453.59.0.0327827539319.issue26499@psf.upfronthosting.co.za> Message-ID: <1458117597.17.0.96577458471.issue26499@psf.upfronthosting.co.za> Changes by Martin Panter : ---------- resolution: -> fixed stage: commit review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 16 04:41:45 2016 From: report at bugs.python.org (Roundup Robot) Date: Wed, 16 Mar 2016 08:41:45 +0000 Subject: [issue21042] ctypes.util.find_library() should return full pathname instead of filename in linux In-Reply-To: <1395614835.79.0.900137034576.issue21042@psf.upfronthosting.co.za> Message-ID: <20160316084142.2077.78887@psf.io> Roundup Robot added the comment: New changeset 811ec2860dc4 by Martin Panter in branch 'default': Issue #21042: Revert Linux find_library() to return just filename https://hg.python.org/cpython/rev/811ec2860dc4 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 16 04:46:06 2016 From: report at bugs.python.org (Roundup Robot) Date: Wed, 16 Mar 2016 08:46:06 +0000 Subject: [issue26564] Malloc debug hooks: display memory block traceback on error In-Reply-To: <1458002396.02.0.186265116381.issue26564@psf.upfronthosting.co.za> Message-ID: <20160316084559.2584.29505@psf.io> Roundup Robot added the comment: New changeset 5f2284ecf9c6 by Victor Stinner in branch 'default': Fix compilation error of traceback.c on Windows https://hg.python.org/cpython/rev/5f2284ecf9c6 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 16 04:51:31 2016 From: report at bugs.python.org (STINNER Victor) Date: Wed, 16 Mar 2016 08:51:31 +0000 Subject: [issue26564] Malloc debug hooks: display memory block traceback on error In-Reply-To: <1458112692.64.0.955963115502.issue26564@psf.upfronthosting.co.za> Message-ID: STINNER Victor added the comment: Martin Panter added the comment: > FYI Victor if you haven?t already noticed, the Windows buildbots are choking on a variable-length array: Thank you, sometimes I miss buildbot failures. I pushed changes which had 2 tests, so I knew that all buildbots were red, and I planned to come back the day after to check. For Windows, it's a pity, the expression is constant. Stupid compiler :-) VS2015 doesn't support C99 yet? Anyway, it's trivial to fix the code. I just fixed it. I will check again if buildbots are now happy with the current code ;-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 16 06:07:23 2016 From: report at bugs.python.org (Chris Jerdonek) Date: Wed, 16 Mar 2016 10:07:23 +0000 Subject: [issue24959] unittest swallows part of stack trace when raising AssertionError in a TestCase In-Reply-To: <1440864914.24.0.799928607113.issue24959@psf.upfronthosting.co.za> Message-ID: <1458122843.08.0.956499580848.issue24959@psf.upfronthosting.co.za> Chris Jerdonek added the comment: This is simply a reduced test case to illustrate the issue more clearly. There was more to it in how I was using it in practice. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 16 06:30:56 2016 From: report at bugs.python.org (Christian Zommerfelds) Date: Wed, 16 Mar 2016 10:30:56 +0000 Subject: [issue23735] Readline not adjusting width after resize with 6.3 In-Reply-To: <1426984974.32.0.405944458303.issue23735@psf.upfronthosting.co.za> Message-ID: <1458124256.56.0.411332041638.issue23735@psf.upfronthosting.co.za> Changes by Christian Zommerfelds : ---------- nosy: +Christian Zommerfelds _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 16 06:39:14 2016 From: report at bugs.python.org (Christian Zommerfelds) Date: Wed, 16 Mar 2016 10:39:14 +0000 Subject: [issue23735] Readline not adjusting width after resize with 6.3 In-Reply-To: <1426984974.32.0.405944458303.issue23735@psf.upfronthosting.co.za> Message-ID: <1458124754.72.0.437989222888.issue23735@psf.upfronthosting.co.za> Christian Zommerfelds added the comment: This bug makes the REPL totally unusable because larger lines start to wrap in a very strange and unreadable way. What has to be done in order for this to get accepted? It looks like there is no better way to define the signal handler and that the user has to know to properly call the old signal handler if it needs to. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 16 06:55:09 2016 From: report at bugs.python.org (STINNER Victor) Date: Wed, 16 Mar 2016 10:55:09 +0000 Subject: [issue26564] Malloc debug hooks: display memory block traceback on error In-Reply-To: <1458002396.02.0.186265116381.issue26564@psf.upfronthosting.co.za> Message-ID: <1458125709.82.0.40423765917.issue26564@psf.upfronthosting.co.za> STINNER Victor added the comment: Ok, buildbots are green again. I close the issue. ---------- resolution: -> fixed status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 16 07:17:03 2016 From: report at bugs.python.org (Roundup Robot) Date: Wed, 16 Mar 2016 11:17:03 +0000 Subject: [issue26563] PyMem_Malloc(): check that the GIL is hold in debug hooks In-Reply-To: <1457995973.59.0.0490877458577.issue26563@psf.upfronthosting.co.za> Message-ID: <20160316111657.118681.29412@psf.io> Roundup Robot added the comment: New changeset 58644086c195 by Victor Stinner in branch 'default': Fail if PyMem_Malloc() is called without holding the GIL https://hg.python.org/cpython/rev/58644086c195 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 16 07:17:47 2016 From: report at bugs.python.org (STINNER Victor) Date: Wed, 16 Mar 2016 11:17:47 +0000 Subject: [issue26563] PyMem_Malloc(): check that the GIL is hold in debug hooks In-Reply-To: <1457995973.59.0.0490877458577.issue26563@psf.upfronthosting.co.za> Message-ID: <1458127067.2.0.924211153127.issue26563@psf.upfronthosting.co.za> STINNER Victor added the comment: I pushed the patch (I added an unit test). If too many users complain, we can revert the change since it's now a small change. ---------- resolution: -> fixed status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 16 08:57:02 2016 From: report at bugs.python.org (Nick Coghlan) Date: Wed, 16 Mar 2016 12:57:02 +0000 Subject: [issue13601] sys.stderr should always be line-buffered In-Reply-To: <1323868292.46.0.495967266587.issue13601@psf.upfronthosting.co.za> Message-ID: <1458133022.8.0.474910435453.issue13601@psf.upfronthosting.co.za> Nick Coghlan added the comment: This question came up today in the context of the final line of a traceback output potentially being missing from stderr if the closing flush of the standard streams is missed for any reason. That's not going to be a common scenario (as far as I know it was an entirely hypothetical discussion), but the last line of a traceback is the one with the actual error message, so it's likely to be annoyingly cryptic if it does happen. ---------- nosy: +ncoghlan _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 16 09:12:55 2016 From: report at bugs.python.org (Nick Coghlan) Date: Wed, 16 Mar 2016 13:12:55 +0000 Subject: [issue13601] sys.stderr should always be line-buffered In-Reply-To: <1323868292.46.0.495967266587.issue13601@psf.upfronthosting.co.za> Message-ID: <1458133975.59.0.336970074476.issue13601@psf.upfronthosting.co.za> Nick Coghlan added the comment: Changing the target version and summarising my understanding of the status quo: "python3": sys.stderr is line buffered at both the TextIOWrapper layer and may be fully buffered at the binary BufferedWriter layer if the output is redirected to a file "python3 -u": the BufferedWriter layer is omitted entirely, leaving only the line buffering at the TextIOWrapper layer Looking at http://pubs.opengroup.org/onlinepubs/9699919799/functions/stdin.html (which also covers stdout and stderr), it specifically says about stderr: "When opened, the standard error stream is not fully buffered;". That means either line buffering or no buffering is considered acceptable, but full buffering is not. So, at the very least, it seems to me that the way we configure stderr should be the same regardless of whether or not "-u" is used: omit the BufferedWriter layer. Given that POSIX allows compliant implementations to use line-buffering on stderr, the "missing trailing newline and no implicit flush() is ever triggered" scenario is probably obscure enough not to worry about. ---------- versions: +Python 3.6 -Python 3.2, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 16 10:36:17 2016 From: report at bugs.python.org (Roundup Robot) Date: Wed, 16 Mar 2016 14:36:17 +0000 Subject: [issue26563] PyMem_Malloc(): check that the GIL is hold in debug hooks In-Reply-To: <1457995973.59.0.0490877458577.issue26563@psf.upfronthosting.co.za> Message-ID: <20160316143542.118671.23633@psf.io> Roundup Robot added the comment: New changeset ae76a1046bb9 by Victor Stinner in branch 'default': Fix usage of PyMem_Malloc() in os.stat() https://hg.python.org/cpython/rev/ae76a1046bb9 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 16 11:05:02 2016 From: report at bugs.python.org (Mark Dickinson) Date: Wed, 16 Mar 2016 15:05:02 +0000 Subject: [issue26040] Improve coverage and rigour of test.test_math In-Reply-To: <1452181282.79.0.203850145541.issue26040@psf.upfronthosting.co.za> Message-ID: <1458140702.63.0.690824327854.issue26040@psf.upfronthosting.co.za> Mark Dickinson added the comment: Big +1 for the idea, and thank you for doing this work. I can't promise to find time to do a thorough review in the near future (though I'll try). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 16 14:22:50 2016 From: report at bugs.python.org (Robert Collins) Date: Wed, 16 Mar 2016 18:22:50 +0000 Subject: [issue24959] unittest swallows par t of stack trace when raising AssertionError in a TestCase In-Reply-To: <1440864914.24.0.799928607113.issue24959@psf.upfronthosting.co.za> Message-ID: <1458152570.92.0.960345271405.issue24959@psf.upfronthosting.co.za> Robert Collins added the comment: I'm fairly sure its eating the stack frames because the calling frames are annotated __unittest__ - its technically a feature :/. ---------- title: unittest swallows part of stack trace when raising AssertionError in a TestCase -> unittest swallows par t of stack trace when raising AssertionError in a TestCase _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 16 14:35:16 2016 From: report at bugs.python.org (Robert Collins) Date: Wed, 16 Mar 2016 18:35:16 +0000 Subject: [issue24959] unittest swallows part of stack trace when raising AssertionError in a TestCase In-Reply-To: <1440864914.24.0.799928607113.issue24959@psf.upfronthosting.co.za> Message-ID: <1458153316.96.0.413679142136.issue24959@psf.upfronthosting.co.za> Robert Collins added the comment: Yes, it is... ish. The frame skipping code occurs when we serialise exceptions, and we pass a limit in. The limit is calculated on the main exception only. If the cause has a longer exception than the limit we calculated, you'd see this behaviour. Probably need to make it possible to do per-exception processing of limit: I think via a callback or similar mechanism in traceback (because the cause might have thrown from some code that is also marked __unittest, so if we're honouring that, we should honour it within each exception. ---------- title: unittest swallows par t of stack trace when raising AssertionError in a TestCase -> unittest swallows part of stack trace when raising AssertionError in a TestCase _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 16 14:52:42 2016 From: report at bugs.python.org (Robert Collins) Date: Wed, 16 Mar 2016 18:52:42 +0000 Subject: [issue24959] unittest swallows part of stack trace when raising AssertionError in a TestCase In-Reply-To: <1440864914.24.0.799928607113.issue24959@psf.upfronthosting.co.za> Message-ID: <1458154362.07.0.366894071534.issue24959@psf.upfronthosting.co.za> Changes by Robert Collins : ---------- stage: needs patch -> test needed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 16 16:32:35 2016 From: report at bugs.python.org (Martin Panter) Date: Wed, 16 Mar 2016 20:32:35 +0000 Subject: [issue21042] ctypes.util.find_library() should return full pathname instead of filename in linux In-Reply-To: <1395614835.79.0.900137034576.issue21042@psf.upfronthosting.co.za> Message-ID: <1458160355.66.0.962161395568.issue21042@psf.upfronthosting.co.za> Martin Panter added the comment: I reverted the change until we can come up with something more consistent. ---------- stage: commit review -> needs patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 16 16:56:02 2016 From: report at bugs.python.org (Terry J. Reedy) Date: Wed, 16 Mar 2016 20:56:02 +0000 Subject: [issue15660] Clarify 0 prefix for width specifier in str.format doc, In-Reply-To: <1345004440.11.0.680139192916.issue15660@psf.upfronthosting.co.za> Message-ID: <1458161762.91.0.990190423499.issue15660@psf.upfronthosting.co.za> Terry J. Reedy added the comment: This came up again on python-list today in thread "Replace weird error message?" by "the.gerenuk--- via Python-list". After reading the discussion, I decided that expecting someone to read and connect together two sentences half a page apart is expecting a bit too much. ''' '=' Forces the padding to be placed after the sign (if any) but before the digits. This is used for printing fields in the form ?+000000120?. This alignment option is only valid for numeric types. ''' Add "It becomes the default when '0' precedes the field width." ''' Preceding the width field by a zero ('0') character enables sign-aware zero-padding for numeric types. This is equivalent to a fill character of '0' with an alignment type of '='. ''' This is not true when an explicit alignment other than '=' is given. >>> "{:09}".format(-1) '-00000001' >>> "{:>09}".format(-1) # 2.7.11 and 3.5.1 '0000000-1' Proposal: Replace with ''' When no explicit alignment is given, preceding the width field by a zero ('0') character enables sign-aware zero-padding for numeric types. This is equivalent to a fill character of '0' with an alignment type of '='. ''' I presume the problem with changing the error message is that it is not immediately known that alignment was set implicitly, by 0 before decimal width, rather than explicitly. If the spec string is still available, it could be searched and the message adjusted if '=' is not present. That proposal should be a new issue if someone wants to push it. ---------- resolution: fixed -> stage: resolved -> patch review status: closed -> open versions: +Python 3.5, Python 3.6 -Python 3.2, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 16 17:01:16 2016 From: report at bugs.python.org (Rob Church) Date: Wed, 16 Mar 2016 21:01:16 +0000 Subject: [issue26572] urlparse does not handle passwords with ? in them. Message-ID: <1458162076.53.0.59602489258.issue26572@psf.upfronthosting.co.za> New submission from Rob Church: >>> urlparse('http://user:pass?word at example.com/path?query') ParseResult(scheme='http', netloc='user:pass', path='', params='', query='word at example.com/path?query', fragment='') Expected output is: ParseResult(scheme='http', netloc='user:pass?word at example.com', path='/path', params='', query='query', fragment='') ---------- components: Library (Lib) messages: 261860 nosy: Rob Church priority: normal severity: normal status: open title: urlparse does not handle passwords with ? in them. versions: Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 16 17:03:02 2016 From: report at bugs.python.org (Eric V. Smith) Date: Wed, 16 Mar 2016 21:03:02 +0000 Subject: [issue15660] Clarify 0 prefix for width specifier in str.format doc, In-Reply-To: <1458161762.91.0.990190423499.issue15660@psf.upfronthosting.co.za> Message-ID: <56E9CA00.2030302@trueblade.com> Eric V. Smith added the comment: > ''' > When no explicit alignment is given, preceding the width field by a zero ('0') character enables sign-aware zero-padding for numeric types. This is equivalent to a fill character of '0' with an alignment type of '='. > ''' I think that's good. > I presume the problem with changing the error message is that it is not immediately known that alignment was set implicitly, by 0 before decimal width, rather than explicitly. If the spec string is still available, it could be searched and the message adjusted if '=' is not present. That proposal should be a new issue if someone wants to push it. Yes, that's the problem. I guess it would be easier to keep track of which fields were set via defaults, and which explicitly. Currently, that information is lost. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 16 17:12:11 2016 From: report at bugs.python.org (G Young) Date: Wed, 16 Mar 2016 21:12:11 +0000 Subject: [issue26573] Method Parameters can be Accepted as Keyword Arguments? Message-ID: <1458162731.32.0.603859986018.issue26573@psf.upfronthosting.co.za> New submission from G Young: This issue arose as we were making changes to the 'pandas' library. I am not sure if this is a bug or feature, but it definitely did not cross anyone's minds when discussing the PR at hand. I have attached a code sample to illustrate the "bug" that I have run successfully on Python 2.7 and Python 3.4. ---------- components: Interpreter Core files: bug.py messages: 261862 nosy: G Young priority: normal severity: normal status: open title: Method Parameters can be Accepted as Keyword Arguments? type: behavior versions: Python 2.7, Python 3.4 Added file: http://bugs.python.org/file42178/bug.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 16 17:20:03 2016 From: report at bugs.python.org (Martin Panter) Date: Wed, 16 Mar 2016 21:20:03 +0000 Subject: [issue18140] urlparse, urlsplit confused when password includes fragment (#), query (?) In-Reply-To: <1370425503.35.0.436511643169.issue18140@psf.upfronthosting.co.za> Message-ID: <1458163203.71.0.150084251195.issue18140@psf.upfronthosting.co.za> Changes by Martin Panter : ---------- title: urlparse.urlsplit confused to fragment when password include # -> urlparse, urlsplit confused when password includes fragment (#), query (?) versions: +Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 16 17:22:34 2016 From: report at bugs.python.org (G Young) Date: Wed, 16 Mar 2016 21:22:34 +0000 Subject: [issue26573] Method Parameters can be Accepted as Keyword Arguments? In-Reply-To: <1458162731.32.0.603859986018.issue26573@psf.upfronthosting.co.za> Message-ID: <1458163354.2.0.65146683361.issue26573@psf.upfronthosting.co.za> G Young added the comment: Google indicates that this is indeed a feature of the language. Sorry about that! I guess that was a miscommunication on the PR-end. ---------- status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 16 17:23:17 2016 From: report at bugs.python.org (Martin Panter) Date: Wed, 16 Mar 2016 21:23:17 +0000 Subject: [issue26572] urlparse does not handle passwords with ? in them. In-Reply-To: <1458162076.53.0.59602489258.issue26572@psf.upfronthosting.co.za> Message-ID: <1458163397.47.0.555680063488.issue26572@psf.upfronthosting.co.za> Martin Panter added the comment: I think this is the same as Issue 18140. Perhaps you can answer my question at the bottom there about why the question mark is not encoded, and why splitting at the at (@) symbol should be higher priority than the query (?) symbol. ---------- nosy: +martin.panter resolution: -> duplicate status: open -> closed superseder: -> urlparse, urlsplit confused when password includes fragment (#), query (?) _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 16 17:25:01 2016 From: report at bugs.python.org (Zachary Ware) Date: Wed, 16 Mar 2016 21:25:01 +0000 Subject: [issue26573] Method Parameters can be Accepted as Keyword Arguments? In-Reply-To: <1458162731.32.0.603859986018.issue26573@psf.upfronthosting.co.za> Message-ID: <1458163501.09.0.44196808526.issue26573@psf.upfronthosting.co.za> Changes by Zachary Ware : ---------- resolution: -> not a bug stage: -> resolved _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 16 18:21:23 2016 From: report at bugs.python.org (Roundup Robot) Date: Wed, 16 Mar 2016 22:21:23 +0000 Subject: [issue26563] PyMem_Malloc(): check that the GIL is hold in debug hooks In-Reply-To: <1457995973.59.0.0490877458577.issue26563@psf.upfronthosting.co.za> Message-ID: <20160316222120.8708.51251@psf.io> Roundup Robot added the comment: New changeset 5b4f173f0690 by Victor Stinner in branch 'default': faulthandler now works in non-Python threads https://hg.python.org/cpython/rev/5b4f173f0690 New changeset d6d64168ee8c by Victor Stinner in branch 'default': Py_FatalError: disable faulthandler earlier https://hg.python.org/cpython/rev/d6d64168ee8c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 16 18:27:39 2016 From: report at bugs.python.org (Roundup Robot) Date: Wed, 16 Mar 2016 22:27:39 +0000 Subject: [issue26563] PyMem_Malloc(): check that the GIL is hold in debug hooks In-Reply-To: <1457995973.59.0.0490877458577.issue26563@psf.upfronthosting.co.za> Message-ID: <20160316222736.15316.79052@psf.io> Roundup Robot added the comment: New changeset 959e58cfbde9 by Victor Stinner in branch 'default': Fix usage of PyMem_Malloc() in overlapped.c https://hg.python.org/cpython/rev/959e58cfbde9 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 16 18:45:40 2016 From: report at bugs.python.org (Roundup Robot) Date: Wed, 16 Mar 2016 22:45:40 +0000 Subject: [issue26563] PyMem_Malloc(): check that the GIL is hold in debug hooks In-Reply-To: <1457995973.59.0.0490877458577.issue26563@psf.upfronthosting.co.za> Message-ID: <20160316224538.14912.44663@psf.io> Roundup Robot added the comment: New changeset 73d8adc0d5ea by Victor Stinner in branch '3.5': Fix usage of PyMem_Malloc() in overlapped.c https://hg.python.org/cpython/rev/73d8adc0d5ea ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 16 18:54:37 2016 From: report at bugs.python.org (STINNER Victor) Date: Wed, 16 Mar 2016 22:54:37 +0000 Subject: [issue13601] sys.stderr should always be line-buffered In-Reply-To: <1323868292.46.0.495967266587.issue13601@psf.upfronthosting.co.za> Message-ID: <1458168877.15.0.749859160538.issue13601@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- nosy: +haypo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 16 19:05:51 2016 From: report at bugs.python.org (Eric Snow) Date: Wed, 16 Mar 2016 23:05:51 +0000 Subject: [issue26569] pyclbr.readmodule() and pyclbr.readmodule_ex() don't support packages In-Reply-To: <1458082581.41.0.63127238645.issue26569@psf.upfronthosting.co.za> Message-ID: <1458169551.37.0.0674390469083.issue26569@psf.upfronthosting.co.za> Eric Snow added the comment: Hmm. These two should be equivalent: if spec.loader.is_package(fullmodule): dict['__path__'] = [os.path.dirname(fname)] if spec.submodule_search_locations is not None: dict['__path__'] = spec.submodule_search_locations Do you mean that "python -m pyclbr XXX" doesn't work for packages? I'm guessing you mean something else because I was able to run it successfully for both "os" (sort of a package) and "importlib". Also, I noticed that if I run pyclbr on the "test" package or "test.regrtest" I get back no output, not an error. I'd expect to get output though. Perhaps that's related? If you are getting an error, what is the traceback you are getting? Note that pyclbr fails with the following if you try to run it on a file or module that doesn't exist: AttributeError: 'NoneType' object has no attribute 'loader' ---------- nosy: +eric.snow, ncoghlan _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 16 19:16:55 2016 From: report at bugs.python.org (STINNER Victor) Date: Wed, 16 Mar 2016 23:16:55 +0000 Subject: [issue26569] pyclbr.readmodule() and pyclbr.readmodule_ex() don't support packages In-Reply-To: <1458082581.41.0.63127238645.issue26569@psf.upfronthosting.co.za> Message-ID: <1458170215.13.0.82648717793.issue26569@psf.upfronthosting.co.za> STINNER Victor added the comment: >Hmm. These two should be equivalent: > if spec.loader.is_package(fullmodule): ... The problem is that spec.loader is None when test is a package. It's easy to reproduce the issue: $ rm -f Lib/test/__init__.py Lib/test/__pycache__/__init__.cpython-36.pyc $ ./python -m test -v -m test_decorators test_pyclbr .. ====================================================================== ERROR: test_decorators (test.test_pyclbr.PyclbrTest) ---------------------------------------------------------------------- Traceback (most recent call last): ... File "/home/haypo/prog/python/default/Lib/pyclbr.py", line 145, in _readmodule fname = spec.loader.get_filename(fullmodule) AttributeError: 'NoneType' object has no attribute 'get_filename' ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 16 19:28:10 2016 From: report at bugs.python.org (Josh Snider) Date: Wed, 16 Mar 2016 23:28:10 +0000 Subject: [issue26574] replace_interleave can be optimized for single character byte strings Message-ID: <1458170890.63.0.147886169107.issue26574@psf.upfronthosting.co.za> New submission from Josh Snider: replace_interleave in Objects/bytesobject.c and Objects/bytearrayobject.c can be optimized for the special case where the interleaving byte string is a single character. Here's some quick results from timeit showing that it's about three times faster for the special case. * Before (cold start): >>> timeit.timeit('(b"x" * 2000000).replace(b"", b".")', number=1000) 7.619218342995737 * After (cold start): >>> timeit.timeit('(b"x" * 2000000).replace(b"", b".")', number=1000) 2.7605581780080684 For the non-special case, running timeit.timeit('(b"x" * 2000000).replace(b"", b".0")', number=10000) takes ~173 seconds on both versions. ---------- components: Library (Lib) files: bytes.patch keywords: patch messages: 261870 nosy: Josh Snider priority: normal severity: normal status: open title: replace_interleave can be optimized for single character byte strings type: performance versions: Python 3.6 Added file: http://bugs.python.org/file42179/bytes.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 16 19:45:26 2016 From: report at bugs.python.org (STINNER Victor) Date: Wed, 16 Mar 2016 23:45:26 +0000 Subject: [issue26574] replace_interleave can be optimized for single character byte strings In-Reply-To: <1458170890.63.0.147886169107.issue26574@psf.upfronthosting.co.za> Message-ID: <1458171926.62.0.566241693.issue26574@psf.upfronthosting.co.za> STINNER Victor added the comment: I reviewed your patch on Rietveld (you should get an email notification). ---------- nosy: +haypo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 16 19:47:08 2016 From: report at bugs.python.org (STINNER Victor) Date: Wed, 16 Mar 2016 23:47:08 +0000 Subject: [issue21130] equivalent functools.partial instances should compare equal In-Reply-To: <1396425472.15.0.80240218298.issue21130@psf.upfronthosting.co.za> Message-ID: <1458172028.28.0.264407527976.issue21130@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- nosy: +haypo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 16 20:41:28 2016 From: report at bugs.python.org (STINNER Victor) Date: Thu, 17 Mar 2016 00:41:28 +0000 Subject: [issue26516] Add PYTHONMALLOC env var and add support for malloc debug hooks in release mode In-Reply-To: <1457522115.12.0.78692190259.issue26516@psf.upfronthosting.co.za> Message-ID: <1458175288.53.0.618320318309.issue26516@psf.upfronthosting.co.za> STINNER Victor added the comment: Buildbots are happy, I close the issue. ---------- resolution: -> fixed status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 16 20:43:02 2016 From: report at bugs.python.org (Josh Snider) Date: Thu, 17 Mar 2016 00:43:02 +0000 Subject: [issue26574] replace_interleave can be optimized for single character byte strings In-Reply-To: <1458170890.63.0.147886169107.issue26574@psf.upfronthosting.co.za> Message-ID: <1458175382.93.0.854569633554.issue26574@psf.upfronthosting.co.za> Josh Snider added the comment: Addresses review comments. ---------- Added file: http://bugs.python.org/file42180/bytes-2.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 16 20:43:33 2016 From: report at bugs.python.org (STINNER Victor) Date: Thu, 17 Mar 2016 00:43:33 +0000 Subject: [issue26563] PyMem_Malloc(): check that the GIL is hold in debug hooks In-Reply-To: <1457995973.59.0.0490877458577.issue26563@psf.upfronthosting.co.za> Message-ID: <1458175413.6.0.672256649807.issue26563@psf.upfronthosting.co.za> STINNER Victor added the comment: Reopen. I found and fixed two bugs in os and _overlapped modules (_overlapped is used by asyncio on Windows). ---------- resolution: fixed -> status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 16 20:46:17 2016 From: report at bugs.python.org (gigaplastik) Date: Thu, 17 Mar 2016 00:46:17 +0000 Subject: [issue26543] imaplib noop Debug In-Reply-To: <1457738623.54.0.0867122071018.issue26543@psf.upfronthosting.co.za> Message-ID: <1458175577.37.0.281655461438.issue26543@psf.upfronthosting.co.za> Changes by gigaplastik : ---------- nosy: +gigaplastik _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 16 20:46:28 2016 From: report at bugs.python.org (Roundup Robot) Date: Thu, 17 Mar 2016 00:46:28 +0000 Subject: [issue26563] PyMem_Malloc(): check that the GIL is hold in debug hooks In-Reply-To: <1457995973.59.0.0490877458577.issue26563@psf.upfronthosting.co.za> Message-ID: <20160317004624.115163.5188@psf.io> Roundup Robot added the comment: New changeset ce62df22f3bf by Victor Stinner in branch '3.5': Py_FatalError: disable faulthandler earlier https://hg.python.org/cpython/rev/ce62df22f3bf ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 16 20:48:10 2016 From: report at bugs.python.org (Eric Snow) Date: Thu, 17 Mar 2016 00:48:10 +0000 Subject: [issue26569] pyclbr.readmodule() and pyclbr.readmodule_ex() don't support namespace packages In-Reply-To: <1458082581.41.0.63127238645.issue26569@psf.upfronthosting.co.za> Message-ID: <1458175690.32.0.163346740671.issue26569@psf.upfronthosting.co.za> Eric Snow added the comment: Ah, you're talking about deleting Lib/test/__init__.py. Doing so makes it a namespace package. The loader we use for namespace packages [1] does not have a get_filename() method. So the problem to solve is supporting namespace packages in Lib/pyclbr.py. Regarding your patch, it's okay, but not the best option. Using spec.submodule_search_locations like you are isn't ideal, but works. However, you should be able to leave the is_package() call alone. TBH, the better option is to use importlib.util.module_from_spec() instead, since it does the right thing for you, like setting __path__. FWIW, I get the same as you by deleting those files and running the following: ./python Lib/pyclbr.py Lib/test [1] https://hg.python.org/cpython/file/default/Lib/importlib/_bootstrap_external.py#l991 ---------- title: pyclbr.readmodule() and pyclbr.readmodule_ex() don't support packages -> pyclbr.readmodule() and pyclbr.readmodule_ex() don't support namespace packages _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 16 20:51:16 2016 From: report at bugs.python.org (STINNER Victor) Date: Thu, 17 Mar 2016 00:51:16 +0000 Subject: [issue26569] pyclbr.readmodule() and pyclbr.readmodule_ex() don't support namespace packages In-Reply-To: <1458082581.41.0.63127238645.issue26569@psf.upfronthosting.co.za> Message-ID: <1458175876.68.0.613939801244.issue26569@psf.upfronthosting.co.za> STINNER Victor added the comment: > However, you should be able to leave the is_package() call alone. I don't really care how the issue is fixed. As I wrote, I don't know well the importlib module. Feel free to propose a better patch :-) My main concern is to fix test_pyclbr when test becomes a namespace. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 16 20:52:54 2016 From: report at bugs.python.org (Eric Snow) Date: Thu, 17 Mar 2016 00:52:54 +0000 Subject: [issue26569] pyclbr.readmodule() and pyclbr.readmodule_ex() don't support namespace packages In-Reply-To: <1458082581.41.0.63127238645.issue26569@psf.upfronthosting.co.za> Message-ID: <1458175974.71.0.15369265346.issue26569@psf.upfronthosting.co.za> Eric Snow added the comment: Also, beside namespace packages, custom loaders may run into a similar problem with get_filename() and probably other code in there. It looks like the pyclbr module assumes that modules will be either builtin or loaded through SourceFileLoader. For example, you get a similar failure for frozen modules: ./python Lib/pyclbr.py _frozen_importlib ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 16 20:56:13 2016 From: report at bugs.python.org (Eric Snow) Date: Thu, 17 Mar 2016 00:56:13 +0000 Subject: [issue26569] pyclbr.readmodule() and pyclbr.readmodule_ex() don't support namespace packages In-Reply-To: <1458082581.41.0.63127238645.issue26569@psf.upfronthosting.co.za> Message-ID: <1458176173.47.0.900500187372.issue26569@psf.upfronthosting.co.za> Eric Snow added the comment: Oh, and spec.loader for namespace package is set to None. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 16 21:01:02 2016 From: report at bugs.python.org (Eric Snow) Date: Thu, 17 Mar 2016 01:01:02 +0000 Subject: [issue26569] pyclbr.readmodule() and pyclbr.readmodule_ex() don't support namespace packages In-Reply-To: <1458082581.41.0.63127238645.issue26569@psf.upfronthosting.co.za> Message-ID: <1458176462.64.0.75959182272.issue26569@psf.upfronthosting.co.za> Eric Snow added the comment: Well, your patch is correct even if not ideal. :) Landing it as a short-term solution is fine. Just keep this issue open so we can address the problem more completely later. ---------- components: +Interpreter Core stage: -> commit review type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 16 22:38:34 2016 From: report at bugs.python.org (py.user) Date: Thu, 17 Mar 2016 02:38:34 +0000 Subject: [issue15660] Clarify 0 prefix for width specifier in str.format doc, In-Reply-To: <1345004440.11.0.680139192916.issue15660@psf.upfronthosting.co.za> Message-ID: <1458182314.17.0.053443562129.issue15660@psf.upfronthosting.co.za> py.user added the comment: There is a funny thing in 3.6.0a0 >>> '{:<09}'.format(1) '100000000' >>> '{:<09}'.format(10) '100000000' >>> '{:<09}'.format(100) '100000000' >>> Actually, it behaves like a string, but the format should call internal format function of the passed number and the internal format function should not format different numbers as equal numbers. Why does it represent number 1 as number 10? >>> format(1, '<02') '10' >>> format(10, '') '10' >>> I guess, there should be a restriction. Zero padding for numbers should be correct. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 16 23:03:19 2016 From: report at bugs.python.org (Berker Peksag) Date: Thu, 17 Mar 2016 03:03:19 +0000 Subject: [issue22758] Regression in Python 3.2 cookie parsing In-Reply-To: <1414577677.93.0.364604019199.issue22758@psf.upfronthosting.co.za> Message-ID: <1458183799.35.0.706539612873.issue22758@psf.upfronthosting.co.za> Berker Peksag added the comment: I will commit this to the 3.2 branch today. ---------- status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 16 23:08:02 2016 From: report at bugs.python.org (Roundup Robot) Date: Thu, 17 Mar 2016 03:08:02 +0000 Subject: [issue17603] AC_LIBOBJ replacement of fileblocks In-Reply-To: <1364760819.41.0.900154328327.issue17603@psf.upfronthosting.co.za> Message-ID: <20160317030759.14938.17523@psf.io> Roundup Robot added the comment: New changeset acbeb33dc76a by Martin Panter in branch '2.7': Issue #17603: Check for st_blocks field without requiring fileblocks.o https://hg.python.org/cpython/rev/acbeb33dc76a New changeset 0774398c3433 by Martin Panter in branch '3.5': Issue #17603: Check for st_blocks field without requiring fileblocks.o https://hg.python.org/cpython/rev/0774398c3433 New changeset 628bd1ebfa22 by Martin Panter in branch 'default': Issue #17603: Merge configure.ac fix from 3.5 https://hg.python.org/cpython/rev/628bd1ebfa22 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 00:32:48 2016 From: report at bugs.python.org (Martin Panter) Date: Thu, 17 Mar 2016 04:32:48 +0000 Subject: [issue3539] Problem with testembed make dependencies in certain circumstances In-Reply-To: <1218416155.29.0.722740811463.issue3539@psf.upfronthosting.co.za> Message-ID: <1458189168.73.0.50981205595.issue3539@psf.upfronthosting.co.za> Martin Panter added the comment: The fault still exists for me with the pgen objects. The makefile has changed a few times about automatically compiling pgen (Issue 22359) or not (Issue 14321), so it would depend which version is tested. I?m not an expert on VPATH, but it seems like it would be a awkward working around this problem (e.g. adding absolute paths do all the object file names or something). I propose to just close this. Issue 1613 added a note to the Python 2 README, and Python 3?s README says: [Building from a subdirectory] will fail if you *also* built at the top-level directory. You should do a "make clean" at the toplevel first. ---------- nosy: +martin.panter _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 01:52:46 2016 From: report at bugs.python.org (David Goffredo) Date: Thu, 17 Mar 2016 05:52:46 +0000 Subject: [issue26575] lambda not closed on specific value in comprehension Message-ID: <1458193966.9.0.501665269138.issue26575@psf.upfronthosting.co.za> New submission from David Goffredo: A series of lambdas referring to a variable in a comprehension do not hold distinct values, while conventional higher order function do. PS C:\Users\David\Desktop> python 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. >>> class Caller: ... def __init__(self, f): ... self._f = f ... def start(self): ... print(self._f()) ... >>> def asFunc(boundValue): ... def func(): ... return boundValue ... return func ... >>> for caller in [Caller(asFunc(x)) for x in range(5)]: ... caller.start() ... 0 1 2 3 4 >>> for caller in [Caller(lambda: x) for x in range(5)]: ... caller.start() ... 4 4 4 4 4 >>> ---------- messages: 261885 nosy: David Goffredo priority: normal severity: normal status: open title: lambda not closed on specific value in comprehension type: behavior versions: Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 02:13:27 2016 From: report at bugs.python.org (Martin Panter) Date: Thu, 17 Mar 2016 06:13:27 +0000 Subject: [issue26575] lambda not closed on specific value in comprehension In-Reply-To: <1458193966.9.0.501665269138.issue26575@psf.upfronthosting.co.za> Message-ID: <1458195207.49.0.606411990018.issue26575@psf.upfronthosting.co.za> Martin Panter added the comment: https://docs.python.org/3.5/faq/programming.html#why-do-lambdas-defined-in-a-loop-with-different-values-all-return-the-same-result ---------- nosy: +martin.panter resolution: -> not a bug status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 02:23:07 2016 From: report at bugs.python.org (Martin Panter) Date: Thu, 17 Mar 2016 06:23:07 +0000 Subject: [issue17603] AC_LIBOBJ replacement of fileblocks In-Reply-To: <1364760819.41.0.900154328327.issue17603@psf.upfronthosting.co.za> Message-ID: <1458195787.75.0.408773652976.issue17603@psf.upfronthosting.co.za> Martin Panter added the comment: I assume that should have fixed the problem, but I have only tested it in roundabout ways, so it would be good to get confirmation if it helps e.g. the original Ming GW problem. ---------- resolution: -> fixed status: open -> closed versions: +Python 2.7, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 02:29:58 2016 From: report at bugs.python.org (Chris Angelico) Date: Thu, 17 Mar 2016 06:29:58 +0000 Subject: [issue26576] Tweak wording of decorator docos Message-ID: <1458196198.66.0.0478952577579.issue26576@psf.upfronthosting.co.za> New submission from Chris Angelico: The official documentation declares an unambiguous equivalence which is not true in some corner cases: @deco def f(x): pass is not quite the same as def f(x): pass f = deco(f) as the name is never bound to the undecorated function. This is what makes @property and @prop.setter work; otherwise, the undecorated setter function would overwrite the property, and the decoration would fail. Attached patch loosens the wording slightly to "broadly equivalent"; this permits corner cases to vary from the equivalence, while still retaining its simplicity for the 99% of cases where it's correct. (Think of explaining "yield from iter" as "for x in iter: yield x" and you have a similar near-equivalence.) Also, class decorators aren't required to return classes. Text removed saying that they do. ---------- assignee: docs at python components: Documentation files: deco-docos.patch keywords: patch messages: 261888 nosy: Rosuav, docs at python priority: normal severity: normal status: open title: Tweak wording of decorator docos Added file: http://bugs.python.org/file42181/deco-docos.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 02:36:18 2016 From: report at bugs.python.org (Chris Angelico) Date: Thu, 17 Mar 2016 06:36:18 +0000 Subject: [issue26576] Tweak wording of decorator docos In-Reply-To: <1458196198.66.0.0478952577579.issue26576@psf.upfronthosting.co.za> Message-ID: <1458196578.48.0.162374627407.issue26576@psf.upfronthosting.co.za> Chris Angelico added the comment: Question: Is it worth having an explanation somewhere of exactly what *does* happen? To what extent is it guaranteed by the language? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 03:02:08 2016 From: report at bugs.python.org (Georg Brandl) Date: Thu, 17 Mar 2016 07:02:08 +0000 Subject: [issue26576] Tweak wording of decorator docos In-Reply-To: <1458196198.66.0.0478952577579.issue26576@psf.upfronthosting.co.za> Message-ID: <1458198128.24.0.76956021773.issue26576@psf.upfronthosting.co.za> Georg Brandl added the comment: The patch is definitely an improvement. What about a remark like ", except that `deco` is evaluated before the function `f` is created"? That should cover the remaining difference. ---------- nosy: +georg.brandl _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 03:02:53 2016 From: report at bugs.python.org (Georg Brandl) Date: Thu, 17 Mar 2016 07:02:53 +0000 Subject: [issue26576] Tweak wording of decorator docos In-Reply-To: <1458196198.66.0.0478952577579.issue26576@psf.upfronthosting.co.za> Message-ID: <1458198173.7.0.800426452082.issue26576@psf.upfronthosting.co.za> Georg Brandl added the comment: (Also, toggled your "is committer" bit so you get the Python logo next to your name.) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 03:16:36 2016 From: report at bugs.python.org (Chris Angelico) Date: Thu, 17 Mar 2016 07:16:36 +0000 Subject: [issue26576] Tweak wording of decorator docos In-Reply-To: <1458196198.66.0.0478952577579.issue26576@psf.upfronthosting.co.za> Message-ID: <1458198996.25.0.438002592338.issue26576@psf.upfronthosting.co.za> Chris Angelico added the comment: The remaining difference that's actually of use, perhaps. But the decoration itself happens before the name is bound. It's impossible to describe in Python code; but it can be probed - you can monkeypatch a class using a decorator: def monkeypatch(cls): orig = globals()[cls.__name__] # Undocumented magic print("Monkeypatch",id(cls),"into",id(orig)) for attr in dir(cls): if not attr.startswith("_"): setattr(orig,attr,getattr(cls,attr)) return orig class Foo: def method1(self): print("I am method 1") print("Foo is currently",id(Foo)) some_object = Foo() @monkeypatch class Foo: def method2(self): print("I am method 2") print("Foo is now",id(Foo)) some_object.method1() some_object.method2() Is this undocumented behaviour? Should it be supported? It works on every Python I've tried it on (CPython 2.7 and 3.6, PyPy2 and PyPy3, Jython, and MicroPython), but it's not something I'd depend on in production code unless it's documented. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 03:17:37 2016 From: report at bugs.python.org (Chris Angelico) Date: Thu, 17 Mar 2016 07:17:37 +0000 Subject: [issue26576] Tweak wording of decorator docos In-Reply-To: <1458196198.66.0.0478952577579.issue26576@psf.upfronthosting.co.za> Message-ID: <1458199057.73.0.054042237065.issue26576@psf.upfronthosting.co.za> Chris Angelico added the comment: I may be a committer, but I don't push to cpython - just to the peps. But sure, pretty little logo :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 03:24:19 2016 From: report at bugs.python.org (Georg Brandl) Date: Thu, 17 Mar 2016 07:24:19 +0000 Subject: [issue26576] Tweak wording of decorator docos In-Reply-To: <1458196198.66.0.0478952577579.issue26576@psf.upfronthosting.co.za> Message-ID: <1458199459.42.0.57433234005.issue26576@psf.upfronthosting.co.za> Georg Brandl added the comment: That is definitely supported. Whether it's actually useful to document, I'm not sure. "except that the original function is not temporarily bound to the name `f`" could work. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 03:38:17 2016 From: report at bugs.python.org (Chris Angelico) Date: Thu, 17 Mar 2016 07:38:17 +0000 Subject: [issue26576] Tweak wording of decorator docos In-Reply-To: <1458196198.66.0.0478952577579.issue26576@psf.upfronthosting.co.za> Message-ID: <1458200297.84.0.988864187731.issue26576@psf.upfronthosting.co.za> Chris Angelico added the comment: Sounds good to me. Replacement patch. ---------- Added file: http://bugs.python.org/file42182/deco-docos.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 03:39:23 2016 From: report at bugs.python.org (SilentGhost) Date: Thu, 17 Mar 2016 07:39:23 +0000 Subject: [issue26570] comma-separated cookies with expires header do not parse properly In-Reply-To: <1458102578.18.0.474747054638.issue26570@psf.upfronthosting.co.za> Message-ID: <1458200363.07.0.926443344877.issue26570@psf.upfronthosting.co.za> SilentGhost added the comment: This is not a regression and you can see that if you do print(SimpleCookie('A=B; expires=Thu, 01-Jan-1970 00:00:00 GMT, C=D')) The values of expires and Path attribute were parsed incorrectly, even though you got two cookies. The problem as far as I can see is a non-standard separator between attributes that you're trying to use, i.e. a comma. If you were to use a semi-colon (or a space) there would not be a problem in any of the versions. ---------- nosy: +SilentGhost resolution: -> not a bug stage: -> resolved status: open -> closed type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 03:40:30 2016 From: report at bugs.python.org (Ryan Fox) Date: Thu, 17 Mar 2016 07:40:30 +0000 Subject: [issue26577] inspect.getclosurevars returns incorrect variable when using class member with the same name as other variable Message-ID: <1458200430.96.0.916440482942.issue26577@psf.upfronthosting.co.za> New submission from Ryan Fox: If a variable 'x' exists in the global or local scope, and a function (also defined in the same scope as 'x', or lower) refers only to a member named 'x' of an object, inspect.getclosurevars will include a reference to the variable, rather than the member. Okay, that's kind of confusing to describe, so here's a small example in code form: import inspect class Foo: x = int() x = 1 f = Foo() assert(f.x != x) func = lambda: f.x == 0 assert(func()) cv = inspect.getclosurevars(func) assert(cv.globals['f'] == f) assert(cv.globals.get('x') != x) # <--- Assertion fails It is expected that 'x' would not exist in cv.globals, since func does not refer to it. Also, there should be a 'f.x' included somewhere in the ClosureVariables object returned. ---------- components: Library (Lib) messages: 261897 nosy: Ryan Fox priority: normal severity: normal status: open title: inspect.getclosurevars returns incorrect variable when using class member with the same name as other variable versions: Python 3.3, Python 3.4, Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 03:42:36 2016 From: report at bugs.python.org (Xiang Zhang) Date: Thu, 17 Mar 2016 07:42:36 +0000 Subject: [issue26578] Bad BaseHTTPRequestHandler response when using HTTP/0.9 Message-ID: <1458200556.85.0.71774056033.issue26578@psf.upfronthosting.co.za> New submission from Xiang Zhang: BaseHTTPRequestHandler in http.server supports HTTP/0.9. But the response for HTTP/0.9 request is implemented wrong. Response of HTTP/0.9 request returns message body directly without status line and headers. But if you inherit BaseHTTPRequestHandler and set the default_request_version to "HTTP/1.x", then self.request_version can never be "HTTP/0.9" since in the https://hg.python.org/cpython/file/tip/Lib/http/server.py#l315 branch it does not set version to "HTTP/0.9" and then always sends the status line and headers back. A trivial patch can fix this problem that set version to "HTTP/0.9" in the branch. But this will cause some failure in tests. The tests in test_httpservers use http.client.HTTPConnection to send and receive HTTP message. But since 3.4, HTTPConnection doesn't support HTTP/0.9-style simple responses. We can use it to test HTTP/0.9 connection if the server is implemented in the right way. And since http.client.HTTPConnection has dropped the support for HTTP/0.9, is it reasonable to drop the support in http.server too? ---------- components: Library (Lib) messages: 261898 nosy: xiang.zhang priority: normal severity: normal status: open title: Bad BaseHTTPRequestHandler response when using HTTP/0.9 versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 03:45:33 2016 From: report at bugs.python.org (Xiang Zhang) Date: Thu, 17 Mar 2016 07:45:33 +0000 Subject: [issue26578] Bad BaseHTTPRequestHandler response when using HTTP/0.9 In-Reply-To: <1458200556.85.0.71774056033.issue26578@psf.upfronthosting.co.za> Message-ID: <1458200733.72.0.782017561435.issue26578@psf.upfronthosting.co.za> Xiang Zhang added the comment: can should be can not. And not only HTTPConnection, support for HTTP/0.9 seems to have been totally abandoned since Python3.4 in http.client. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 03:50:06 2016 From: report at bugs.python.org (SilentGhost) Date: Thu, 17 Mar 2016 07:50:06 +0000 Subject: [issue26577] inspect.getclosurevars returns incorrect variable when using class member with the same name as other variable In-Reply-To: <1458200430.96.0.916440482942.issue26577@psf.upfronthosting.co.za> Message-ID: <1458201006.99.0.73210066266.issue26577@psf.upfronthosting.co.za> Changes by SilentGhost : ---------- nosy: +yselivanov type: -> behavior versions: -Python 3.3, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 04:12:36 2016 From: report at bugs.python.org (Roundup Robot) Date: Thu, 17 Mar 2016 08:12:36 +0000 Subject: [issue26569] pyclbr.readmodule() and pyclbr.readmodule_ex() don't support namespace packages In-Reply-To: <1458082581.41.0.63127238645.issue26569@psf.upfronthosting.co.za> Message-ID: <20160317081233.14908.7130@psf.io> Roundup Robot added the comment: New changeset 700ae1bfc453 by Victor Stinner in branch '3.5': Fix pyclbr to support importing packages https://hg.python.org/cpython/rev/700ae1bfc453 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 04:15:39 2016 From: report at bugs.python.org (STINNER Victor) Date: Thu, 17 Mar 2016 08:15:39 +0000 Subject: [issue26569] pyclbr.readmodule() and pyclbr.readmodule_ex() don't support namespace packages In-Reply-To: <1458082581.41.0.63127238645.issue26569@psf.upfronthosting.co.za> Message-ID: <1458202539.74.0.5521131244.issue26569@psf.upfronthosting.co.za> STINNER Victor added the comment: > Well, your patch is correct even if not ideal. :) Landing it as a short-term solution is fine. Ok, done. Sorry, I didn't write an unit test. I only tested manually by removing Lib/test/__init__.py. > Just keep this issue open so we can address the problem more completely later. If it's a different problem, I prefer to open a new issue. But it's up to you. Can you please rephrase the title to put your expectations there? I understood that you also want to support frozen module? ---------- versions: +Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 04:19:56 2016 From: report at bugs.python.org (STINNER Victor) Date: Thu, 17 Mar 2016 08:19:56 +0000 Subject: [issue26563] PyMem_Malloc(): check that the GIL is hold in debug hooks In-Reply-To: <1457995973.59.0.0490877458577.issue26563@psf.upfronthosting.co.za> Message-ID: <1458202796.69.0.681450125595.issue26563@psf.upfronthosting.co.za> STINNER Victor added the comment: Hum ok, all buildbots look to be happy again :-) I close the issue (again). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 04:20:02 2016 From: report at bugs.python.org (STINNER Victor) Date: Thu, 17 Mar 2016 08:20:02 +0000 Subject: [issue26563] PyMem_Malloc(): check that the GIL is hold in debug hooks In-Reply-To: <1457995973.59.0.0490877458577.issue26563@psf.upfronthosting.co.za> Message-ID: <1458202802.74.0.188561524881.issue26563@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- resolution: -> fixed status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 04:43:07 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 17 Mar 2016 08:43:07 +0000 Subject: [issue26579] Support pickling slots in subclasses of common classes Message-ID: <1458204186.54.0.651323931278.issue26579@psf.upfronthosting.co.za> New submission from Serhiy Storchaka: Pickling and copying instances of subclasses of some basic classes pickles and copies instance attributes. Example: >>> class BA(bytearray): ... pass ... >>> b = BA(b'abc') >>> b.x = 10 >>> c = copy.copy(b) >>> c.x 10 >>> c = pickle.loads(pickle.dumps(b)) >>> c.x 10 But this doesn't work if attributes are saved not in instance dictionary, but in slots. >>> class BA(bytearray): ... __slots__ = ('x',) ... >>> b = BA(b'abc') >>> b.x = 10 >>> c = copy.copy(b) >>> c.x Traceback (most recent call last): File "", line 1, in AttributeError: x >>> c = pickle.loads(pickle.dumps(b)) >>> c.x Traceback (most recent call last): File "", line 1, in AttributeError: x Since using __slots__ is implementation detail, this failure can be considered as a bug. Proposed patch adds support of pickling and copying slots in subclasses of all classes that already support pickling and copying non-slot attributes. It is backward compatible, classes with slots can be unpickled on older Python versions without slots. Affected classes: bytearray, set, frozenset, weakref.WeakSet, collections.OrderedDict, collections.deque, datetime.tzinfo. The patch adds the copyreg._getstate() function for Python classes and exposes the _PyObject_GetState() function for extension classes. An alternative (and simpler for end user) solution would be to add default implementation as object.__getstate__(). But this is not easy to reject non-pickleable classes (issue22995) in this case, since __getstate__ is looked up as instance attribute, not as other special methods. ---------- components: Extension Modules, Library (Lib) files: copyreg_getstate.patch keywords: patch messages: 261903 nosy: alexandre.vassalotti, pitrou, rhettinger, serhiy.storchaka priority: normal severity: normal stage: patch review status: open title: Support pickling slots in subclasses of common classes type: enhancement versions: Python 3.6 Added file: http://bugs.python.org/file42183/copyreg_getstate.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 06:40:28 2016 From: report at bugs.python.org (STINNER Victor) Date: Thu, 17 Mar 2016 10:40:28 +0000 Subject: [issue26538] regrtest: setup_tests() must not replace module.__path__ (_NamespacePath) with a simple list // importlib & abspath In-Reply-To: <1457696667.94.0.108519122037.issue26538@psf.upfronthosting.co.za> Message-ID: <1458211228.15.0.154063371893.issue26538@psf.upfronthosting.co.za> STINNER Victor added the comment: I pushed my minimum fix. I now understand that it is not needed to change importlib, it's ok to keep "abspath" code in site & libregrtest. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 06:40:38 2016 From: report at bugs.python.org (STINNER Victor) Date: Thu, 17 Mar 2016 10:40:38 +0000 Subject: [issue26538] regrtest: setup_tests() must not replace module.__path__ (_NamespacePath) with a simple list // importlib & abspath In-Reply-To: <1457696667.94.0.108519122037.issue26538@psf.upfronthosting.co.za> Message-ID: <1458211238.79.0.485176950996.issue26538@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- resolution: -> fixed status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 07:00:01 2016 From: report at bugs.python.org (STINNER Victor) Date: Thu, 17 Mar 2016 11:00:01 +0000 Subject: [issue26530] tracemalloc: add C API to manually track/untrack memory allocations In-Reply-To: <1457619430.68.0.0968942184372.issue26530@psf.upfronthosting.co.za> Message-ID: <1458212401.23.0.101165857424.issue26530@psf.upfronthosting.co.za> STINNER Victor added the comment: Nathaniel Smith: > So PyMem_Malloc would just call PyMem_RecordAlloc("heap", ptr, size) (or act equivalently to something that called that, etc.), but something like PyCuda might do PyMem_RecordAlloc("gpu", ptr, size) to track allocations in GPU memory. If I change tracemalloc, it's not to fullfit numpy requirements, it must remain very generic. *If* we add something, I see 3 choices: * add a C int to trace_t * add a C char* to trace_t * add a C void* to trace_t int uses 2x less memory than char* or void* on 64-bit systems. The problem of void* is to find a way to expose it in Python. An option is not ignore it in the Python API, and only provide a C API to retrieve traces with the extra info. void* allows to implement the rejected option of also storing the C filename an C line number: https://www.python.org/dev/peps/pep-0445/#pass-the-c-filename-and-line-number When I designed the PEP 445 (malloc API) an PEP 454 (tracemalloc), I recall that it was proposed to add "colors" (red, blue, etc.) to memory allocations. It sounds similar do you "heap" and "gpu" use case. It's just that you use an integer rather than a string. Anyway, extending tracemalloc is non-trivial, we have to investigate use cases to design the new API. I would prefer to move step by step, an begin with exposing existing API. What do you think? > All the tracing stuff in tracemalloc would be awesome to have for GPU allocations, and it would hardly require any changes to enable it. Ditto for other leakable resources like file descriptors or shmem segments. FYI I opened an issue to use tracemalloc when logging ResourceWarning: http://bugs.python.org/issue26567 > I think the extra footprint would be tiny? In my experience, tracemalloc footprint is large. Basically, it doubles the total memory footprint. So adding 4 or 8 bytes to a trace which currently takes 16 bytes is not negligible! Maybe we can be smart and use compact trace when extra info is not stored (current trace_t) and switch to "extended" trace (trace_t + int/char*/void*) when the extended API is used? It requires to convert all existing traces from the compact to the extende format. It doesn't look too complex to support two formats, expecially if the extended format is based on the compact format (trace_t structure used in extended_trace_t structure). > Logically, you'd index traces by (domain, pointer) instead of (pointer) It's not how tracemalloc is designed. _tracemalloc has a simple design. It's a simple hashtable: pointer => trace. The Python module tracemalloc.py is responsible to group traces: https://docs.python.org/dev/library/tracemalloc.html#tracemalloc.Snapshot.statistics The design is to have a simple and efficient _tracemalloc module, an off-load statistics later. It allows to capture traces on a small and slow device, and then analyze data on a fast compuer with more memory (ex: transfer data by network). The idea is also to limit the overhead of using _tracemalloc. Moreover, your proposed structure looks specific to your use case. I'm not sure that you always want to group by the domain. If domain is a C traceback (filename, line number), you probably don't want to group by traceback, but group by C filename for example. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 07:08:20 2016 From: report at bugs.python.org (Christian Heimes) Date: Thu, 17 Mar 2016 11:08:20 +0000 Subject: [issue26470] Make OpenSSL module compatible with OpenSSL 1.1.0 In-Reply-To: <1456920893.87.0.933592382559.issue26470@psf.upfronthosting.co.za> Message-ID: <1458212900.88.0.281483369045.issue26470@psf.upfronthosting.co.za> Christian Heimes added the comment: Here is a first working patch. It requires 1.1.0-pre4. The failing ALPN test is caused by a regression in OpenSSL. ---------- keywords: +patch stage: needs patch -> patch review versions: +Python 3.6 Added file: http://bugs.python.org/file42184/0001-Port-Python-s-SSL-module-to-OpenSSL-1.1.0-WIP.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 07:08:30 2016 From: report at bugs.python.org (STINNER Victor) Date: Thu, 17 Mar 2016 11:08:30 +0000 Subject: [issue26567] ResourceWarning: Use tracemalloc to display the traceback where an object was allocated when a ResourceWarning is emitted In-Reply-To: <1458047716.42.0.114286591066.issue26567@psf.upfronthosting.co.za> Message-ID: <1458212910.74.0.954718494152.issue26567@psf.upfronthosting.co.za> STINNER Victor added the comment: I used this patch to identify a ResourceWarning in test_faulthandler when the test is interrupted by CTRL+c: it's really efficient! I will be very useful to identify all ResourceWarning that I saw in test_asyncio, like the ones seen on the AIX buildbot. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 07:15:02 2016 From: report at bugs.python.org (STINNER Victor) Date: Thu, 17 Mar 2016 11:15:02 +0000 Subject: [issue26470] Make OpenSSL module compatible with OpenSSL 1.1.0 In-Reply-To: <1456920893.87.0.933592382559.issue26470@psf.upfronthosting.co.za> Message-ID: <1458213302.29.0.732628140053.issue26470@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- nosy: -haypo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 07:52:24 2016 From: report at bugs.python.org (Alex Walters) Date: Thu, 17 Mar 2016 11:52:24 +0000 Subject: [issue26580] Documentation for ftplib still references ftpmirror.py Message-ID: <1458215544.62.0.0104806566658.issue26580@psf.upfronthosting.co.za> New submission from Alex Walters: in #23130 ftpmirror.py was removed from the python source distribution. The documentation still references this, and sends people looking for the file (ostensibly as an example of how to use ftplib). ---------- assignee: docs at python components: Documentation messages: 261908 nosy: docs at python, tritium priority: normal severity: normal status: open title: Documentation for ftplib still references ftpmirror.py versions: Python 2.7, Python 3.2, Python 3.3, Python 3.4, Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 08:00:36 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 17 Mar 2016 12:00:36 +0000 Subject: [issue26581] Double coding cookie Message-ID: <1458216036.14.0.237579161127.issue26581@psf.upfronthosting.co.za> New submission from Serhiy Storchaka: When Python source file contains double coding cookies on different lines, the first wins. When it contains double coding cookies on the same line, the last wins. PEP 263 was sufficiently vague about this. Now this is clarified (22490711c870). The first coding cookie should always win. Proposed patch fixes Python tokenizer, the tokenize module, and other places. Tests are taken from issue25643. ---------- components: Interpreter Core, Library (Lib) files: tokenize_double_coding.patch keywords: patch messages: 261909 nosy: gvanrossum, haypo, serhiy.storchaka priority: normal severity: normal stage: patch review status: open title: Double coding cookie type: behavior versions: Python 2.7, Python 3.5, Python 3.6 Added file: http://bugs.python.org/file42185/tokenize_double_coding.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 08:04:22 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 17 Mar 2016 12:04:22 +0000 Subject: [issue25643] Python tokenizer rewriting In-Reply-To: <1447723653.14.0.424824913135.issue25643@psf.upfronthosting.co.za> Message-ID: <1458216262.61.0.273049874241.issue25643@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- dependencies: +Double coding cookie _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 08:29:28 2016 From: report at bugs.python.org (Stefan Behnel) Date: Thu, 17 Mar 2016 12:29:28 +0000 Subject: [issue26519] Cython doesn't work anymore on Python 3.6 In-Reply-To: <1457539317.39.0.81348046338.issue26519@psf.upfronthosting.co.za> Message-ID: <1458217768.8.0.00141991870754.issue26519@psf.upfronthosting.co.za> Stefan Behnel added the comment: Our CI build server says it's all fine. The fix will eventually be released, certainly before Py3.6 comes out. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 10:45:53 2016 From: report at bugs.python.org (awilfox) Date: Thu, 17 Mar 2016 14:45:53 +0000 Subject: [issue26582] asyncio documentation links to wrong CancelledError Message-ID: <1458225953.38.0.399231880747.issue26582@psf.upfronthosting.co.za> New submission from awilfox: In the 3.5 and 3.6a0 documentation for asyncio, "CancelledError" is linked to the concurrent.futures.CancelledError. This led me to try catching that exception and finding that it did not work correctly at all. Only after searching for asyncio example code and seeing how other people caught asyncio.CancelledError did I realise the issue. The fact asyncio.CancelledError even exists isn't actually documented, and I believe that is why the :exc: reference is linking to the wrong module. ---------- assignee: docs at python components: Documentation messages: 261911 nosy: awilfox, docs at python priority: normal severity: normal status: open title: asyncio documentation links to wrong CancelledError versions: Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 10:49:41 2016 From: report at bugs.python.org (STINNER Victor) Date: Thu, 17 Mar 2016 14:49:41 +0000 Subject: [issue26582] asyncio documentation links to wrong CancelledError In-Reply-To: <1458225953.38.0.399231880747.issue26582@psf.upfronthosting.co.za> Message-ID: <1458226181.22.0.905471216031.issue26582@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- nosy: +haypo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 10:53:08 2016 From: report at bugs.python.org (Paulo Costa) Date: Thu, 17 Mar 2016 14:53:08 +0000 Subject: [issue26270] Support for read()/write()/select() on asyncio In-Reply-To: <1454451619.12.0.0280470843365.issue26270@psf.upfronthosting.co.za> Message-ID: <1458226388.1.0.426194358662.issue26270@psf.upfronthosting.co.za> Paulo Costa added the comment: Thanks for the replies. What I'm actually trying to do is to access from a character file from /dev/input/event*. Streams are pretty much what I want to use but (as far as I can tell) asyncio's streams only support network and unix sockets. Files are left behind. Anyway, despite the existence of streams and protocols, I still believe that `asyncio.read()`, `asyncio.write()` and `asyncio.select()` would be nice-to-have low-level APIs. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 10:57:15 2016 From: report at bugs.python.org (STINNER Victor) Date: Thu, 17 Mar 2016 14:57:15 +0000 Subject: [issue26270] Support for read()/write()/select() on asyncio In-Reply-To: <1454451619.12.0.0280470843365.issue26270@psf.upfronthosting.co.za> Message-ID: <1458226635.69.0.873800282494.issue26270@psf.upfronthosting.co.za> STINNER Victor added the comment: > Anyway, despite the existence of streams and protocols, I still believe that `asyncio.read()`, `asyncio.write()` and `asyncio.select()` would be nice-to-have low-level APIs. You can probably develop your own helper functions based on existing asyncio function. I'm opposed to add such helper functions since it doesn't fit into the design of asyncio. Please read a little bit more about event loops and how asyncio is design. Don't hesitate to come back if you have something concrete, but IMHO this discussion should be moved to the python-tulip Google Groups rather than a *bug tracker*. I close the issue. ---------- resolution: -> not a bug status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 10:58:34 2016 From: report at bugs.python.org (Guido van Rossum) Date: Thu, 17 Mar 2016 14:58:34 +0000 Subject: [issue26270] Support for read()/write()/select() on asyncio In-Reply-To: <1454451619.12.0.0280470843365.issue26270@psf.upfronthosting.co.za> Message-ID: <1458226714.21.0.69780979223.issue26270@psf.upfronthosting.co.za> Guido van Rossum added the comment: Regular are left behind because select() won't work on them. However we do support certain file descriptors (e.g. pipes) and it makes sense to support device "files". Can you come up with a new API that lets you pass a file descriptor and wrap it in a stream? ---------- resolution: not a bug -> status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 12:23:17 2016 From: report at bugs.python.org (Charalampos Stratakis) Date: Thu, 17 Mar 2016 16:23:17 +0000 Subject: [issue17167] python man page contains $Date$ in page footer In-Reply-To: <1360400635.24.0.00924107320182.issue17167@psf.upfronthosting.co.za> Message-ID: <1458231797.33.0.166293023707.issue17167@psf.upfronthosting.co.za> Changes by Charalampos Stratakis : ---------- versions: +Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 12:31:34 2016 From: report at bugs.python.org (STINNER Victor) Date: Thu, 17 Mar 2016 16:31:34 +0000 Subject: [issue26519] Cython doesn't work anymore on Python 3.6 In-Reply-To: <1457539317.39.0.81348046338.issue26519@psf.upfronthosting.co.za> Message-ID: <1458232294.29.0.520773601236.issue26519@psf.upfronthosting.co.za> STINNER Victor added the comment: > Our CI build server says it's all fine. The fix will eventually be released, certainly before Py3.6 comes out. Ok, fine :-) ---------- resolution: -> third party status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 12:32:13 2016 From: report at bugs.python.org (STINNER Victor) Date: Thu, 17 Mar 2016 16:32:13 +0000 Subject: [issue13601] sys.stderr should be line-buffered when stderr is not a TTY In-Reply-To: <1323868292.46.0.495967266587.issue13601@psf.upfronthosting.co.za> Message-ID: <1458232333.92.0.0849835801911.issue13601@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- title: sys.stderr should always be line-buffered -> sys.stderr should be line-buffered when stderr is not a TTY _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 12:32:47 2016 From: report at bugs.python.org (STINNER Victor) Date: Thu, 17 Mar 2016 16:32:47 +0000 Subject: [issue13601] sys.stderr should be line-buffered when stderr is not a TTY In-Reply-To: <1323868292.46.0.495967266587.issue13601@psf.upfronthosting.co.za> Message-ID: <1458232367.69.0.958496384332.issue13601@psf.upfronthosting.co.za> STINNER Victor added the comment: I changed the title, since sys.stderr is already line-buffered when stderr is a TTY. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 12:38:36 2016 From: report at bugs.python.org (Marc Abramowitz) Date: Thu, 17 Mar 2016 16:38:36 +0000 Subject: [issue23239] SSL match_hostname does not accept IP Address In-Reply-To: <1421226292.77.0.451398063166.issue23239@psf.upfronthosting.co.za> Message-ID: <1458232716.09.0.49921325462.issue23239@psf.upfronthosting.co.za> Marc Abramowitz added the comment: Patch to update the comment to remove "IP addresses are not accepted for *hostname*", because supported for IP addresses was added earlier by @pitrou in https://hg.python.org/cpython/rev/b15a5f239e8a ---------- nosy: +Marc.Abramowitz Added file: http://bugs.python.org/file42186/ip_certs_comment.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 12:39:39 2016 From: report at bugs.python.org (STINNER Victor) Date: Thu, 17 Mar 2016 16:39:39 +0000 Subject: [issue26554] Missing fclose In-Reply-To: <1457949701.38.0.834751371072.issue26554@psf.upfronthosting.co.za> Message-ID: <1458232779.45.0.174469794426.issue26554@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- keywords: +easy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 12:39:54 2016 From: report at bugs.python.org (STINNER Victor) Date: Thu, 17 Mar 2016 16:39:54 +0000 Subject: [issue26554] PC\bdist_wininst\install.c: Missing call to fclose() In-Reply-To: <1457949701.38.0.834751371072.issue26554@psf.upfronthosting.co.za> Message-ID: <1458232794.52.0.378945435189.issue26554@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- title: Missing fclose -> PC\bdist_wininst\install.c: Missing call to fclose() _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 12:44:13 2016 From: report at bugs.python.org (SilentGhost) Date: Thu, 17 Mar 2016 16:44:13 +0000 Subject: [issue26580] Documentation for ftplib still references ftpmirror.py In-Reply-To: <1458215544.62.0.0104806566658.issue26580@psf.upfronthosting.co.za> Message-ID: <1458233053.94.0.283642112588.issue26580@psf.upfronthosting.co.za> SilentGhost added the comment: This patch removes the offending paragraph. ---------- keywords: +patch nosy: +SilentGhost stage: -> patch review type: -> behavior versions: +Python 3.6 Added file: http://bugs.python.org/file42187/issue26580.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 13:04:01 2016 From: report at bugs.python.org (STINNER Victor) Date: Thu, 17 Mar 2016 17:04:01 +0000 Subject: [issue23890] assertRaises increases reference counter In-Reply-To: <1428518225.53.0.665360255509.issue23890@psf.upfronthosting.co.za> Message-ID: <1458234241.56.0.649374159521.issue23890@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- nosy: +haypo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 13:05:11 2016 From: report at bugs.python.org (STINNER Victor) Date: Thu, 17 Mar 2016 17:05:11 +0000 Subject: [issue24294] DeprecationWarnings should be visible by default in the interactive REPL In-Reply-To: <1432713990.67.0.935342603332.issue24294@psf.upfronthosting.co.za> Message-ID: <1458234311.37.0.9850426335.issue24294@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- nosy: +haypo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 13:16:47 2016 From: report at bugs.python.org (Peter Inglesby) Date: Thu, 17 Mar 2016 17:16:47 +0000 Subject: [issue26583] test_timestamp_overflow fails Message-ID: <1458235007.87.0.738177495403.issue26583@psf.upfronthosting.co.za> New submission from Peter Inglesby: I get the following test failure against changeset 100576 on OSX 10.9.5: $ ./python.exe -m test test_import [1/1] test_import test test_import failed -- Traceback (most recent call last): File "/Users/peteringlesby/src/cpython/Lib/test/test_import/__init__.py", line 301, in test_timestamp_overflow os.stat(compiled) FileNotFoundError: [Errno 2] No such file or directory: '__pycache__/@test_68937_tmp.cpython-36.pyc' 1 test failed: test_import ---------- messages: 261919 nosy: inglesp priority: normal severity: normal status: open title: test_timestamp_overflow fails versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 13:18:06 2016 From: report at bugs.python.org (Ismail Donmez) Date: Thu, 17 Mar 2016 17:18:06 +0000 Subject: [issue25720] Fix curses module compilation with ncurses6 In-Reply-To: <1448365148.0.0.732837314732.issue25720@psf.upfronthosting.co.za> Message-ID: <1458235086.56.0.725548493834.issue25720@psf.upfronthosting.co.za> Ismail Donmez added the comment: ping? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 13:23:38 2016 From: report at bugs.python.org (SilentGhost) Date: Thu, 17 Mar 2016 17:23:38 +0000 Subject: [issue26583] test_timestamp_overflow fails In-Reply-To: <1458235007.87.0.738177495403.issue26583@psf.upfronthosting.co.za> Message-ID: <1458235418.67.0.355416143896.issue26583@psf.upfronthosting.co.za> Changes by SilentGhost : ---------- components: +Macintosh, Tests nosy: +ned.deily, ronaldoussoren type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 13:32:52 2016 From: report at bugs.python.org (Peter Inglesby) Date: Thu, 17 Mar 2016 17:32:52 +0000 Subject: [issue26560] Error in assertion in wsgiref.handlers.BaseHandler.start_response In-Reply-To: <1457979107.59.0.709846628148.issue26560@psf.upfronthosting.co.za> Message-ID: <1458235972.53.0.0857887520229.issue26560@psf.upfronthosting.co.za> Peter Inglesby added the comment: I found it while reading the source. Patch attached. ---------- keywords: +patch Added file: http://bugs.python.org/file42188/issue26560.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 13:41:13 2016 From: report at bugs.python.org (Ned Deily) Date: Thu, 17 Mar 2016 17:41:13 +0000 Subject: [issue26583] test_timestamp_overflow fails In-Reply-To: <1458235007.87.0.738177495403.issue26583@psf.upfronthosting.co.za> Message-ID: <1458236473.52.0.370126875121.issue26583@psf.upfronthosting.co.za> Ned Deily added the comment: Sorry, I am unable to reproduce this on either 10.9.5 or current 10.11.3 OS X systems. Is there something unusual about the working directory you are running the tests from, like residing on an NFS or other networked file system? Any special ./configure options? Does the test always fail? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 14:00:50 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 17 Mar 2016 18:00:50 +0000 Subject: [issue25720] Fix curses module compilation with ncurses6 In-Reply-To: <1448365148.0.0.732837314732.issue25720@psf.upfronthosting.co.za> Message-ID: <1458237650.12.0.0439608036417.issue25720@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: I suspect that the patch can break build with non-ncurses implementations or with old ncurses (when is_pad() was added?). Needed more direct feature check. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 14:20:00 2016 From: report at bugs.python.org (Eric Snow) Date: Thu, 17 Mar 2016 18:20:00 +0000 Subject: [issue26584] pyclbr module needs to be more flexible on loader support Message-ID: <1458238800.08.0.676127110581.issue26584@psf.upfronthosting.co.za> New submission from Eric Snow: (see issue26569) The pyclbr module is showing its age (born 1995). It assumes there are only 2 module types (builtin and source-based), particularly in readmodule() and readmodule_ex(). Really it should be source-based and "everything else". For instance, it does not handle namespace packages correctly, since the spec.loader is set to None there. It also doesn't handle frozen modules (e.g. "./python Lib/pyclbr.py _frozen_importlib"). This is likewise a problem for other/custom loaders that don't match the expectations of pyclbr. Here are some things that should be done: * replace custom introspection code with newer tools like importlib.util.module_from_spec() * special-case namespace modules (since their spec.loader is None); this is probably a moot point if module_from_spec() gets used * ignore more than just builtins; explicitly check for importlib.abc.SourceLoader? * make use of similar tools in the inspect module? ---------- components: Library (Lib) messages: 261924 nosy: brett.cannon, eric.snow, ncoghlan priority: normal severity: normal stage: test needed status: open title: pyclbr module needs to be more flexible on loader support type: behavior versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 14:22:24 2016 From: report at bugs.python.org (Eric Snow) Date: Thu, 17 Mar 2016 18:22:24 +0000 Subject: [issue26569] pyclbr.readmodule() and pyclbr.readmodule_ex() don't support namespace packages In-Reply-To: <1458082581.41.0.63127238645.issue26569@psf.upfronthosting.co.za> Message-ID: <1458238944.46.0.693774217707.issue26569@psf.upfronthosting.co.za> Eric Snow added the comment: Yeah, I've opened issue26584 to keep the matters separate. We can address a more comprehensive cleanup there. ---------- resolution: -> fixed stage: commit review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 14:22:55 2016 From: report at bugs.python.org (Eric Snow) Date: Thu, 17 Mar 2016 18:22:55 +0000 Subject: [issue26569] pyclbr.readmodule() and pyclbr.readmodule_ex() don't support namespace packages In-Reply-To: <1458082581.41.0.63127238645.issue26569@psf.upfronthosting.co.za> Message-ID: <1458238975.74.0.811949259225.issue26569@psf.upfronthosting.co.za> Eric Snow added the comment: And thanks for addressing this here. :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 14:37:42 2016 From: report at bugs.python.org (Peter Inglesby) Date: Thu, 17 Mar 2016 18:37:42 +0000 Subject: [issue26583] test_timestamp_overflow fails In-Reply-To: <1458235007.87.0.738177495403.issue26583@psf.upfronthosting.co.za> Message-ID: <1458239862.54.0.875607202974.issue26583@psf.upfronthosting.co.za> Peter Inglesby added the comment: I can reproduce it reliably. I ran ./configure with --with-pydebug. I'm not using NFS, and I'm not aware of anything else unusual about my filesystem. The fact that a timestamp overflows in the failing test is a red herring -- the following also fails, with os.stat raising FileNotFoundError: def test_without_timestamp_overflow(self): sys.path.insert(0, os.curdir) try: source = TESTFN + ".py" compiled = importlib.util.cache_from_source(source) with open(source, 'w') as f: pass __import__(TESTFN) os.stat(compiled) finally: del sys.path[0] remove_files(TESTFN) I've verified that TESTFN does get imported by writing 'print("hello")' to the source file. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 14:43:05 2016 From: report at bugs.python.org (Alexander Mohr) Date: Thu, 17 Mar 2016 18:43:05 +0000 Subject: [issue21423] concurrent.futures.ThreadPoolExecutor/ProcessPoolExecutor should accept an initializer argument In-Reply-To: <1399160288.58.0.274862722075.issue21423@psf.upfronthosting.co.za> Message-ID: <1458240185.82.0.764363600145.issue21423@psf.upfronthosting.co.za> Alexander Mohr added the comment: any chance if this getting into 3.5.2? I have some gross code to get around it (setting global properties) ---------- nosy: +thehesiod _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 14:50:25 2016 From: report at bugs.python.org (Peter Inglesby) Date: Thu, 17 Mar 2016 18:50:25 +0000 Subject: [issue26583] test_timestamp_overflow fails In-Reply-To: <1458235007.87.0.738177495403.issue26583@psf.upfronthosting.co.za> Message-ID: <1458240625.77.0.627930395204.issue26583@psf.upfronthosting.co.za> Peter Inglesby added the comment: The problem is that I have PYTHONDONTWRITEBYTECODE set in my environment. Should the setUp and tearDown methods ensure that PYTHONDONTWRITEBYTECODE is cleared and reset? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 15:23:33 2016 From: report at bugs.python.org (Ned Deily) Date: Thu, 17 Mar 2016 19:23:33 +0000 Subject: [issue26583] test_timestamp_overflow of test_importlib fails if PYTHONDONTWRITEBYTECODE is set In-Reply-To: <1458235007.87.0.738177495403.issue26583@psf.upfronthosting.co.za> Message-ID: <1458242613.58.0.263233442958.issue26583@psf.upfronthosting.co.za> Ned Deily added the comment: Ah, setting PYTHONDONTWRITEBYTECODE explains it. When running the tests via "make test", python is invoked with -E to avoid issues like that. But here's a patch that skips test_timestamp_overflow if bytecode files cannot be written (Issue20796 documents a similar problem and workaround for test_import). ---------- components: -Macintosh keywords: +patch nosy: +brett.cannon -ronaldoussoren stage: -> patch review title: test_timestamp_overflow fails -> test_timestamp_overflow of test_importlib fails if PYTHONDONTWRITEBYTECODE is set versions: +Python 3.5 Added file: http://bugs.python.org/file42189/issue26583.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 15:50:36 2016 From: report at bugs.python.org (Brett Cannon) Date: Thu, 17 Mar 2016 19:50:36 +0000 Subject: [issue26583] test_timestamp_overflow of test_importlib fails if PYTHONDONTWRITEBYTECODE is set In-Reply-To: <1458235007.87.0.738177495403.issue26583@psf.upfronthosting.co.za> Message-ID: <1458244236.88.0.337184697481.issue26583@psf.upfronthosting.co.za> Brett Cannon added the comment: LGTM, Ned. ---------- assignee: -> larry nosy: +larry stage: patch review -> commit review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 15:50:49 2016 From: report at bugs.python.org (Brett Cannon) Date: Thu, 17 Mar 2016 19:50:49 +0000 Subject: [issue26583] test_timestamp_overflow of test_importlib fails if PYTHONDONTWRITEBYTECODE is set In-Reply-To: <1458235007.87.0.738177495403.issue26583@psf.upfronthosting.co.za> Message-ID: <1458244249.72.0.164403097272.issue26583@psf.upfronthosting.co.za> Changes by Brett Cannon : ---------- assignee: larry -> ned.deily nosy: -larry _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 15:51:33 2016 From: report at bugs.python.org (Jeff Allen) Date: Thu, 17 Mar 2016 19:51:33 +0000 Subject: [issue26040] Improve coverage and rigour of test.test_math In-Reply-To: <1452181282.79.0.203850145541.issue26040@psf.upfronthosting.co.za> Message-ID: <1458244293.46.0.685539843114.issue26040@psf.upfronthosting.co.za> Changes by Jeff Allen : Added file: http://bugs.python.org/file42190/stat_math.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 15:52:24 2016 From: report at bugs.python.org (Jeff Allen) Date: Thu, 17 Mar 2016 19:52:24 +0000 Subject: [issue26040] Improve coverage and rigour of test.test_math In-Reply-To: <1452181282.79.0.203850145541.issue26040@psf.upfronthosting.co.za> Message-ID: <1458244344.4.0.985515855158.issue26040@psf.upfronthosting.co.za> Changes by Jeff Allen : Removed file: http://bugs.python.org/file41526/stat_math.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 16:22:01 2016 From: report at bugs.python.org (Michael Felt) Date: Thu, 17 Mar 2016 20:22:01 +0000 Subject: [issue26439] ctypes.util.find_library fails when ldconfig/glibc not available (e.g., AIX) In-Reply-To: <1456413023.18.0.874865601403.issue26439@psf.upfronthosting.co.za> Message-ID: <1458246121.76.0.243754196644.issue26439@psf.upfronthosting.co.za> Michael Felt added the comment: Ah, good news - the build is successful ONCE I open the file ./Lib/ctypes/util.py and find the (hiding) tab characters and replace them with 8 space characters. (And I had tried so hard to check for that in advance). So, if you apply the patch - it may need some love. I would be grateful for people (even just one!) looking at it. Michael ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 16:37:52 2016 From: report at bugs.python.org (Jeff Allen) Date: Thu, 17 Mar 2016 20:37:52 +0000 Subject: [issue26040] Improve coverage and rigour of test.test_math In-Reply-To: <1452181282.79.0.203850145541.issue26040@psf.upfronthosting.co.za> Message-ID: <1458247072.21.0.720462524864.issue26040@psf.upfronthosting.co.za> Changes by Jeff Allen : Added file: http://bugs.python.org/file42191/extra_cmath_testcases.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 16:38:36 2016 From: report at bugs.python.org (Jeff Allen) Date: Thu, 17 Mar 2016 20:38:36 +0000 Subject: [issue26040] Improve coverage and rigour of test.test_math In-Reply-To: <1452181282.79.0.203850145541.issue26040@psf.upfronthosting.co.za> Message-ID: <1458247116.03.0.230805884865.issue26040@psf.upfronthosting.co.za> Changes by Jeff Allen : Added file: http://bugs.python.org/file42192/stat_math.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 16:38:50 2016 From: report at bugs.python.org (Jeff Allen) Date: Thu, 17 Mar 2016 20:38:50 +0000 Subject: [issue26040] Improve coverage and rigour of test.test_math In-Reply-To: <1452181282.79.0.203850145541.issue26040@psf.upfronthosting.co.za> Message-ID: <1458247130.48.0.40968145459.issue26040@psf.upfronthosting.co.za> Changes by Jeff Allen : Removed file: http://bugs.python.org/file42190/stat_math.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 16:51:12 2016 From: report at bugs.python.org (Jeff Allen) Date: Thu, 17 Mar 2016 20:51:12 +0000 Subject: [issue26040] Improve coverage and rigour of test.test_math In-Reply-To: <1452181282.79.0.203850145541.issue26040@psf.upfronthosting.co.za> Message-ID: <1458247872.57.0.0817959967559.issue26040@psf.upfronthosting.co.za> Jeff Allen added the comment: Thanks for the prompt acknowledgement and for accepting this to review. I have updated the coverage & tolerance demo program. Usage in the comments (in v3). I have also added the program I used to generate the extra test cases (needs mpmath -- easier to get working than mpf in the original Windows/Jython environment). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 17:24:28 2016 From: report at bugs.python.org (Michael Felt) Date: Thu, 17 Mar 2016 21:24:28 +0000 Subject: [issue26439] ctypes.util.find_library fails when ldconfig/glibc not available (e.g., AIX) In-Reply-To: <1456413023.18.0.874865601403.issue26439@psf.upfronthosting.co.za> Message-ID: <1458249868.12.0.270021532286.issue26439@psf.upfronthosting.co.za> Michael Felt added the comment: fyi: just completed a test both as 32 and 64 bit build. However, openssl-1.0.1.514 does not work in 64-bit mode (packaging error). Fortunately, openssl-1.0.1.515 (released 02-March-2016) fixes that. In short, 64-bit build is dependent on openssl-1.0.1.515 Here is the corrected patch (tabs removed). name: python.Lib.ctypes.160317.patch ---------- Added file: http://bugs.python.org/file42193/python.Lib.ctypes.160317.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 17:42:17 2016 From: report at bugs.python.org (Roundup Robot) Date: Thu, 17 Mar 2016 21:42:17 +0000 Subject: [issue19450] Bug in sqlite in Windows binaries In-Reply-To: <1383131558.55.0.853606379194.issue19450@psf.upfronthosting.co.za> Message-ID: <20160317214214.8599.47977.F175F320@psf.io> Roundup Robot added the comment: New changeset fa68df1d5e65 by Steve Dower in branch '2.7': Issue #19450: Update Windows builds to use SQLite 3.8.11.0. https://hg.python.org/cpython/rev/fa68df1d5e65 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 17:56:39 2016 From: report at bugs.python.org (Steve Dower) Date: Thu, 17 Mar 2016 21:56:39 +0000 Subject: [issue19450] Bug in sqlite in Windows binaries In-Reply-To: <1383131558.55.0.853606379194.issue19450@psf.upfronthosting.co.za> Message-ID: <1458251799.22.0.665399457065.issue19450@psf.upfronthosting.co.za> Steve Dower added the comment: Done. The test_sqlite tests were fine, but that's all I checked. ---------- resolution: -> fixed status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 17:57:14 2016 From: report at bugs.python.org (Roundup Robot) Date: Thu, 17 Mar 2016 21:57:14 +0000 Subject: [issue26583] test_timestamp_overflow of test_importlib fails if PYTHONDONTWRITEBYTECODE is set In-Reply-To: <1458235007.87.0.738177495403.issue26583@psf.upfronthosting.co.za> Message-ID: <20160317215705.53382.20382.A82E394A@psf.io> Roundup Robot added the comment: New changeset 915f158633f4 by Ned Deily in branch '3.5': Issue #26583: Skip test_timestamp_overflow in test_import if bytecode https://hg.python.org/cpython/rev/915f158633f4 New changeset e8cab14d8a47 by Ned Deily in branch 'default': Issue #26583: merge from 3.5 https://hg.python.org/cpython/rev/e8cab14d8a47 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 17:59:29 2016 From: report at bugs.python.org (Ned Deily) Date: Thu, 17 Mar 2016 21:59:29 +0000 Subject: [issue26583] test_timestamp_overflow of test_importlib fails if PYTHONDONTWRITEBYTECODE is set In-Reply-To: <1458235007.87.0.738177495403.issue26583@psf.upfronthosting.co.za> Message-ID: <1458251969.83.0.541553501143.issue26583@psf.upfronthosting.co.za> Ned Deily added the comment: Pushed for release in 3.5.2 and 3.6.0. ---------- resolution: -> fixed stage: commit review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 18:03:43 2016 From: report at bugs.python.org (Roundup Robot) Date: Thu, 17 Mar 2016 22:03:43 +0000 Subject: [issue26313] ssl.py _load_windows_store_certs fails if windows cert store is empty In-Reply-To: <1454962188.81.0.985392423363.issue26313@psf.upfronthosting.co.za> Message-ID: <20160317220324.84286.62940.17EF81B6@psf.io> Roundup Robot added the comment: New changeset 8df52636b0dc by Steve Dower in branch '2.7': Issue #26313: ssl.py _load_windows_store_certs fails if windows cert store is empty. Patch by Baji. https://hg.python.org/cpython/rev/8df52636b0dc ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 18:03:43 2016 From: report at bugs.python.org (Roundup Robot) Date: Thu, 17 Mar 2016 22:03:43 +0000 Subject: [issue26313] ssl.py _load_windows_store_certs fails if windows cert store is empty In-Reply-To: <1454962188.81.0.985392423363.issue26313@psf.upfronthosting.co.za> Message-ID: <20160317220341.974.7745.C12F8623@psf.io> Roundup Robot added the comment: New changeset eb2c2671e7d6 by Steve Dower in branch '3.5': Issue #26313: ssl.py _load_windows_store_certs fails if windows cert store is empty. Patch by Baji. https://hg.python.org/cpython/rev/eb2c2671e7d6 New changeset 97cd199944c3 by Steve Dower in branch 'default': Issue #26313: ssl.py _load_windows_store_certs fails if windows cert store is empty. Patch by Baji. https://hg.python.org/cpython/rev/97cd199944c3 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 18:04:16 2016 From: report at bugs.python.org (Steve Dower) Date: Thu, 17 Mar 2016 22:04:16 +0000 Subject: [issue26313] ssl.py _load_windows_store_certs fails if windows cert store is empty In-Reply-To: <1454962188.81.0.985392423363.issue26313@psf.upfronthosting.co.za> Message-ID: <1458252256.44.0.903063464476.issue26313@psf.upfronthosting.co.za> Steve Dower added the comment: Thanks! Fixed for 3.6, 3.5 and 2.7. ---------- resolution: -> fixed stage: -> resolved status: open -> closed versions: +Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 22:01:09 2016 From: report at bugs.python.org (Martin Panter) Date: Fri, 18 Mar 2016 02:01:09 +0000 Subject: [issue22854] Documentation/implementation out of sync for IO In-Reply-To: <1415804787.06.0.347049835041.issue22854@psf.upfronthosting.co.za> Message-ID: <1458266469.18.0.355069840094.issue22854@psf.upfronthosting.co.za> Martin Panter added the comment: Thanks for looking at this Serhiy. Here is patch v2, merged with 3.6 branch; some doc string changes were redundant with upstream Arg Clinic changes. However looking at this again, I think we should be cautious changing the documented exceptions for the base classes, since that is changing the API. E.g. perhaps it would be safer to leave the exception for fileno() as OSError (aka IOError). It it actually causing a problem? Or the API changes should be reserved for 3.6 only. ---------- Added file: http://bugs.python.org/file42194/UnsupportedOperation.v2.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 22:58:20 2016 From: report at bugs.python.org (Xiang Zhang) Date: Fri, 18 Mar 2016 02:58:20 +0000 Subject: [issue26578] Bad BaseHTTPRequestHandler response when using HTTP/0.9 In-Reply-To: <1458200556.85.0.71774056033.issue26578@psf.upfronthosting.co.za> Message-ID: <1458269900.26.0.438206073792.issue26578@psf.upfronthosting.co.za> Changes by Xiang Zhang : ---------- nosy: +gregory.p.smith, martin.panter _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 23:01:26 2016 From: report at bugs.python.org (Xiang Zhang) Date: Fri, 18 Mar 2016 03:01:26 +0000 Subject: [issue26578] Bad BaseHTTPRequestHandler response when using HTTP/0.9 In-Reply-To: <1458200556.85.0.71774056033.issue26578@psf.upfronthosting.co.za> Message-ID: <1458270086.32.0.528335772443.issue26578@psf.upfronthosting.co.za> Changes by Xiang Zhang : ---------- type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 23:18:06 2016 From: report at bugs.python.org (Xiang Zhang) Date: Fri, 18 Mar 2016 03:18:06 +0000 Subject: [issue26585] Use html.escape to replace _quote_html in http.server Message-ID: <1458271086.94.0.0961534377342.issue26585@psf.upfronthosting.co.za> New submission from Xiang Zhang: In http.server, _quote_html is used to escape content for BaseHTTPServer. The function has already been implemented by html.escape. ---------- components: Library (Lib) files: _quote_html_to_html_escape.patch keywords: patch messages: 261943 nosy: xiang.zhang priority: normal severity: normal status: open title: Use html.escape to replace _quote_html in http.server type: enhancement versions: Python 3.6 Added file: http://bugs.python.org/file42195/_quote_html_to_html_escape.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 23:47:46 2016 From: report at bugs.python.org (Xiang Zhang) Date: Fri, 18 Mar 2016 03:47:46 +0000 Subject: [issue26585] Use html.escape to replace _quote_html in http.server In-Reply-To: <1458271086.94.0.0961534377342.issue26585@psf.upfronthosting.co.za> Message-ID: <1458272866.71.0.576050096566.issue26585@psf.upfronthosting.co.za> Xiang Zhang added the comment: It's BaseHTTPRequestHandler, not BaseHTTPServer. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 23:57:03 2016 From: report at bugs.python.org (Nathaniel Smith) Date: Fri, 18 Mar 2016 03:57:03 +0000 Subject: [issue26530] tracemalloc: add C API to manually track/untrack memory allocations In-Reply-To: <1457619430.68.0.0968942184372.issue26530@psf.upfronthosting.co.za> Message-ID: <1458273423.3.0.273373089171.issue26530@psf.upfronthosting.co.za> Nathaniel Smith added the comment: I think we're talking past each other :-). > If I change tracemalloc, it's not to fullfit numpy requirements, it must remain very generic Nothing about what I'm saying is relevant to numpy -- the patch attached to this bug report is already plenty for what numpy needs. (Well, it still needs a public API like PyMem_Track/Untrack or something, but never mind for now.) The only reason I'm speaking up now is that if you're adding a manual track/untrack API, then a relatively trivial addition now makes tracemalloc vastly more powerful, so I don't want to miss this opportunity. > void* allows to implement the rejected option of also storing the C filename an C line number: And if you want to attach some extra metadata to traces, then that's an interesting idea that I can potentially imagine various use cases for. But it's not the idea I'm talking about :-). (FWIW, I think the biggest challenge for your idea will be how the allocation sites -- which might be in arbitrary user code -- are supposed to figure out what kind of metadata they should be attaching. And if it's information that tracemalloc can compute itself -- like C backtraces -- then there's no reason for it to be in the public API, which is the thing I'm concerned about here.) What I'm talking about is different: I think it should be possible to re-use the tracemalloc infrastructure to track other resources besides "heap allocations". So for my use case, it's crucial that we index by (domain, pointer), because the address 0xdeadbeef on the heap is different from the address 0xdeadbeef on the GPU. We'll never want to group by pointer alone without the domain, because that would cause us to actually misinterpret the data (if I do PyMem_Track("gpu", 0xdeadbeef); PyMem_Untrack("heap", 0xdeadbeef), then this should not cause tracemalloc to forget about the gpu allocation! I think this is very different than your C backtrace example). And, it's always obvious to callers what kind of thing to pass here, because they know perfectly well whether they just allocated memory on the heap or on the GPU, so the public API is an appropriate place for this information. And, it's immediately obvious that for this use case, there will only be a few different domains in use at one time, so it's very inefficient to literally store (domain, pointer) pairs -- replacing the current pointer => trace design with a domain => (pointer => trace) design would indeed require changing tracemalloc's design a bit, but not, I think, in any fundamental way? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 00:06:16 2016 From: report at bugs.python.org (Xiang Zhang) Date: Fri, 18 Mar 2016 04:06:16 +0000 Subject: [issue26586] Simple enhancement to BaseHTTPRequestHandler Message-ID: <1458273976.86.0.666454727881.issue26586@psf.upfronthosting.co.za> New submission from Xiang Zhang: This patch propose several simple enhancement to BaseHTTPRequestHandler. It removes some redundant code and add handler for too many headers. ---------- components: Library (Lib) files: simple_enhancement.patch keywords: patch messages: 261946 nosy: xiang.zhang priority: normal severity: normal status: open title: Simple enhancement to BaseHTTPRequestHandler type: enhancement versions: Python 3.6 Added file: http://bugs.python.org/file42196/simple_enhancement.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 02:19:53 2016 From: report at bugs.python.org (Aatish Neupane) Date: Fri, 18 Mar 2016 06:19:53 +0000 Subject: [issue26553] Write HTTP in uppercase In-Reply-To: <1457936613.19.0.773642660577.issue26553@psf.upfronthosting.co.za> Message-ID: <1458281993.28.0.469139044853.issue26553@psf.upfronthosting.co.za> Changes by Aatish Neupane : Added file: http://bugs.python.org/file42197/fix_2.7.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 02:20:13 2016 From: report at bugs.python.org (Aatish Neupane) Date: Fri, 18 Mar 2016 06:20:13 +0000 Subject: [issue26553] Write HTTP in uppercase In-Reply-To: <1457936613.19.0.773642660577.issue26553@psf.upfronthosting.co.za> Message-ID: <1458282013.21.0.918388838065.issue26553@psf.upfronthosting.co.za> Changes by Aatish Neupane : Added file: http://bugs.python.org/file42198/fix_3.5.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 02:20:49 2016 From: report at bugs.python.org (Aatish Neupane) Date: Fri, 18 Mar 2016 06:20:49 +0000 Subject: [issue26553] Write HTTP in uppercase In-Reply-To: <1457936613.19.0.773642660577.issue26553@psf.upfronthosting.co.za> Message-ID: <1458282049.41.0.776572261067.issue26553@psf.upfronthosting.co.za> Changes by Aatish Neupane : Added file: http://bugs.python.org/file42199/fix_3.6.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 02:21:52 2016 From: report at bugs.python.org (Aatish Neupane) Date: Fri, 18 Mar 2016 06:21:52 +0000 Subject: [issue26553] Write HTTP in uppercase In-Reply-To: <1457936613.19.0.773642660577.issue26553@psf.upfronthosting.co.za> Message-ID: <1458282112.78.0.621501284341.issue26553@psf.upfronthosting.co.za> Aatish Neupane added the comment: I have attached the patches fixing numerous case errors. ---------- nosy: +aatishnn _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 03:09:48 2016 From: report at bugs.python.org (STINNER Victor) Date: Fri, 18 Mar 2016 07:09:48 +0000 Subject: [issue26530] tracemalloc: add C API to manually track/untrack memory allocations In-Reply-To: <1458273423.3.0.273373089171.issue26530@psf.upfronthosting.co.za> Message-ID: STINNER Victor added the comment: Instead of having to change the API for tracking GPU memory, I suggest to try a hack. Memory allocations use an alignement. For pymalloc, it's 8 bytes for example. On a GPU I expect at least 2 bytes or more likey something much bigger like 16 bytes. For malloc, I also expect at least 2 bytes. If it's the minimum is 2 bytes, good. Use the lowest bit as a "GPU" flag! pointer|1. Tracemalloc doesn't give access to pointers in its API, so it shouldn't matter. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 03:21:46 2016 From: report at bugs.python.org (Martin Panter) Date: Fri, 18 Mar 2016 07:21:46 +0000 Subject: [issue26578] Bad BaseHTTPRequestHandler response when using HTTP/0.9 In-Reply-To: <1458200556.85.0.71774056033.issue26578@psf.upfronthosting.co.za> Message-ID: <1458285706.07.0.695241054068.issue26578@psf.upfronthosting.co.za> Martin Panter added the comment: As I understand it, you are saying if you override the undocumented (but publicly-named) default_request_version attribute, HTTP 0.9 requests no longer work. I suspect it is even broken by default. My understanding is with HTTP 0.9 you should be able to send b"GET \r\n" and get a response, but Python?s server will deadlock waiting for a second blank line or EOF. It looks like this deadlock has been there since ~forever (1995). See Issue 10721 which already proposes to remove 0.9 server support. I would be weakly in favour of this (or more strongly if someone can prove my theory that the current support is broken). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 03:31:06 2016 From: report at bugs.python.org (Martin Panter) Date: Fri, 18 Mar 2016 07:31:06 +0000 Subject: [issue26585] Use html.escape to replace _quote_html in http.server In-Reply-To: <1458271086.94.0.0961534377342.issue26585@psf.upfronthosting.co.za> Message-ID: <1458286266.38.0.579400027436.issue26585@psf.upfronthosting.co.za> Martin Panter added the comment: Removing the redundant _quote_html() function seems like a good idea to me. I wonder if the code should be using the html.escape(..., quote=False) option though, because it does not need to encode quote signs. It might be good to add a test. It looks like there may not be anything testing the HTML encoding. ---------- nosy: +martin.panter _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 03:33:57 2016 From: report at bugs.python.org (Martin Panter) Date: Fri, 18 Mar 2016 07:33:57 +0000 Subject: [issue26585] Use html.escape to replace _quote_html in http.server In-Reply-To: <1458271086.94.0.0961534377342.issue26585@psf.upfronthosting.co.za> Message-ID: <1458286437.11.0.856417407392.issue26585@psf.upfronthosting.co.za> Changes by Martin Panter : ---------- stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 03:37:20 2016 From: report at bugs.python.org (Xiang Zhang) Date: Fri, 18 Mar 2016 07:37:20 +0000 Subject: [issue26585] Use html.escape to replace _quote_html in http.server In-Reply-To: <1458271086.94.0.0961534377342.issue26585@psf.upfronthosting.co.za> Message-ID: <1458286640.12.0.32154090436.issue26585@psf.upfronthosting.co.za> Xiang Zhang added the comment: At first I also want to use html.escape(..., quote=False) since the spec only asks to escape quote signs in attribute. But after some search on Google, there are articles recommends escaping quote in content too: https://www.owasp.org/index.php/XSS_%28Cross_Site_Scripting%29_Prevention_Cheat_Sheet ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 05:35:55 2016 From: report at bugs.python.org (Xiang Zhang) Date: Fri, 18 Mar 2016 09:35:55 +0000 Subject: [issue26578] Bad BaseHTTPRequestHandler response when using HTTP/0.9 In-Reply-To: <1458200556.85.0.71774056033.issue26578@psf.upfronthosting.co.za> Message-ID: <1458293755.71.0.185205341147.issue26578@psf.upfronthosting.co.za> Xiang Zhang added the comment: I think you are right. Simply run http.server.test() and then telnet to send "GET /", the client hangs. Or add a timeout to BaseHTTPRequestHandler, you can see the timeout error on server output. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 06:02:30 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 18 Mar 2016 10:02:30 +0000 Subject: [issue22854] Documentation/implementation out of sync for IO In-Reply-To: <1415804787.06.0.347049835041.issue22854@psf.upfronthosting.co.za> Message-ID: <1458295350.26.0.590823266185.issue22854@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: I have doubts about changing OSError to UnsupportedOperation in the documentation of readable() and writable(). Some implementations can try to do an IO operation without checking readable() and writable() flags. I have lesser doubt about using half-closed pipes in tests. May be it is safe, I don't know. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 06:04:44 2016 From: report at bugs.python.org (Roundup Robot) Date: Fri, 18 Mar 2016 10:04:44 +0000 Subject: [issue26563] PyMem_Malloc(): check that the GIL is hold in debug hooks In-Reply-To: <1457995973.59.0.0490877458577.issue26563@psf.upfronthosting.co.za> Message-ID: <20160318100438.964.51925.69BCAF50@psf.io> Roundup Robot added the comment: New changeset 7b079adb0774 by Victor Stinner in branch 'default': Enhance documentation on malloc debug hooks https://hg.python.org/cpython/rev/7b079adb0774 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 06:04:44 2016 From: report at bugs.python.org (Roundup Robot) Date: Fri, 18 Mar 2016 10:04:44 +0000 Subject: [issue26516] Add PYTHONMALLOC env var and add support for malloc debug hooks in release mode In-Reply-To: <1457522115.12.0.78692190259.issue26516@psf.upfronthosting.co.za> Message-ID: <20160318100438.964.96571.3C552205@psf.io> Roundup Robot added the comment: New changeset 7b079adb0774 by Victor Stinner in branch 'default': Enhance documentation on malloc debug hooks https://hg.python.org/cpython/rev/7b079adb0774 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 06:04:45 2016 From: report at bugs.python.org (Roundup Robot) Date: Fri, 18 Mar 2016 10:04:45 +0000 Subject: [issue26564] Malloc debug hooks: display memory block traceback on error In-Reply-To: <1458002396.02.0.186265116381.issue26564@psf.upfronthosting.co.za> Message-ID: <20160318100438.964.13855.C317590D@psf.io> Roundup Robot added the comment: New changeset 7b079adb0774 by Victor Stinner in branch 'default': Enhance documentation on malloc debug hooks https://hg.python.org/cpython/rev/7b079adb0774 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 06:12:06 2016 From: report at bugs.python.org (Martin Panter) Date: Fri, 18 Mar 2016 10:12:06 +0000 Subject: [issue26586] Simple enhancement to BaseHTTPRequestHandler In-Reply-To: <1458273976.86.0.666454727881.issue26586@psf.upfronthosting.co.za> Message-ID: <1458295926.76.0.0426336215561.issue26586@psf.upfronthosting.co.za> Martin Panter added the comment: Thanks for the patch, it looks good in general. I left some comments and suggestions. ---------- nosy: +martin.panter stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 06:23:00 2016 From: report at bugs.python.org (Wolfgang Langner) Date: Fri, 18 Mar 2016 10:23:00 +0000 Subject: [issue26587] Possible duplicate entries in sys.path if .pth files are used with zip's Message-ID: <1458296580.88.0.236395091392.issue26587@psf.upfronthosting.co.za> New submission from Wolfgang Langner: In site.py there is the internal function _init_pathinfo() This function builds a set of path entries from sys.path. This is used to avoid duplicate entries in sys.path. But this function has a check if it is a directory with os.path.isdir(...). All this is fine as long as someone has a .zip file in sys.path or a zipfile subpath. Then the path entry is not part of the set. With this duplicate detection with none directories does not work. The fix is as simple as removing the os.path.isdir(...) line and fixing the indent. Also the docstring should be modified. Detected by using this function in a project reusing addsitedir(...) functionality to add another path with .pth processing. ---------- components: Library (Lib) messages: 261958 nosy: tds333 priority: normal severity: normal status: open title: Possible duplicate entries in sys.path if .pth files are used with zip's type: enhancement versions: Python 2.7, Python 3.4, Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 06:27:04 2016 From: report at bugs.python.org (Antoine Pitrou) Date: Fri, 18 Mar 2016 10:27:04 +0000 Subject: [issue26530] tracemalloc: add C API to manually track/untrack memory allocations In-Reply-To: <1458273423.3.0.273373089171.issue26530@psf.upfronthosting.co.za> Message-ID: <56EBD7F5.5000700@free.fr> Antoine Pitrou added the comment: Le 18/03/2016 04:57, Nathaniel Smith a ?crit : > > What I'm talking about is different: I think it should be possible > to re-use the tracemalloc infrastructure to track other resources besides "heap allocations". So for my use case, it's crucial that we index by (domain, pointer), because the address 0xdeadbeef on the heap is different from the address 0xdeadbeef on the GPU. We'll never want to group by pointer alone without the domain, because that would cause us to actually misinterpret the data (if I do PyMem_Track("gpu", 0xdeadbeef); PyMem_Untrack("heap", 0xdeadbeef), then this should not cause tracemalloc to forget about the gpu allocation! I think this is very different than your C backtrace example). FWIW, LLVM calls the "domain" "address space", and simply uses an integer for it (0 being the default CPU-addressable address space). You can probably restrict yourself to 8-bit address spaces... ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 06:27:34 2016 From: report at bugs.python.org (Antoine Pitrou) Date: Fri, 18 Mar 2016 10:27:34 +0000 Subject: [issue26530] tracemalloc: add C API to manually track/untrack memory allocations In-Reply-To: Message-ID: <56EBD814.1020104@free.fr> Antoine Pitrou added the comment: Le 18/03/2016 08:09, STINNER Victor a ?crit : > > If it's the minimum is 2 bytes, good. Use the lowest bit as a "GPU" flag! > pointer|1. So you guarantee tracemalloc itself won't use such a hack for other purposes? ;-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 06:35:38 2016 From: report at bugs.python.org (STINNER Victor) Date: Fri, 18 Mar 2016 10:35:38 +0000 Subject: [issue26530] tracemalloc: add C API to manually track/untrack memory allocations In-Reply-To: <1457619430.68.0.0968942184372.issue26530@psf.upfronthosting.co.za> Message-ID: <1458297338.01.0.0450328155143.issue26530@psf.upfronthosting.co.za> STINNER Victor added the comment: > So you guarantee tracemalloc itself won't use such a hack for other purposes? ;-) As the defacto maintainer of the module, yes, I can guarantee that. > FWIW, LLVM calls the "domain" "address space", and simply uses an > integer for it (0 being the default CPU-addressable address space). You > can probably restrict yourself to 8-bit address spaces... I understood that we have the CPU and GPU address spaces. Do you know other address spaces? I only care of address spaces where two equal pointers point to two different memory blocks. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 06:36:52 2016 From: report at bugs.python.org (Martin Panter) Date: Fri, 18 Mar 2016 10:36:52 +0000 Subject: [issue10721] Remove HTTP 0.9 server support In-Reply-To: <1292523705.43.0.300913774105.issue10721@psf.upfronthosting.co.za> Message-ID: <1458297412.3.0.319220545851.issue10721@psf.upfronthosting.co.za> Martin Panter added the comment: Does this need any deprecation cycle, or can we just remove everything immediately in 3.6? I suspect that the HTTP 0.9 support never properly worked, but I don?t have enough info to be sure. Wouldn?t a HTTP 0.9 request send b"GET \r\n" with a single line, and then wait for a response? If so, Python?s server hangs waiting for a second blank line (or EOF), so the protocol will deadlock. In any case, I would be in favour of removing HTTP 0.9 support. Senthil: do you know of actual clients that do HTTP 0.9 requests? I left a review comment. The patch will also need manual merging with current code. ---------- nosy: +martin.panter versions: +Python 3.6 -Python 3.4, Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 06:37:46 2016 From: report at bugs.python.org (Martin Panter) Date: Fri, 18 Mar 2016 10:37:46 +0000 Subject: [issue10721] Remove HTTP 0.9 server support In-Reply-To: <1292523705.43.0.300913774105.issue10721@psf.upfronthosting.co.za> Message-ID: <1458297466.76.0.0822850198825.issue10721@psf.upfronthosting.co.za> Martin Panter added the comment: Also I guess documentation should be added somewhere, even if there is no deprecation step. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 06:48:47 2016 From: report at bugs.python.org (Martin Panter) Date: Fri, 18 Mar 2016 10:48:47 +0000 Subject: [issue26553] Write HTTP in uppercase In-Reply-To: <1457936613.19.0.773642660577.issue26553@psf.upfronthosting.co.za> Message-ID: <1458298127.06.0.141606631067.issue26553@psf.upfronthosting.co.za> Martin Panter added the comment: The three fix_x.y patches look good to me. I pointed out one more fix on the review. I think there are plenty more similar changes that could be made if somebody wanted to. ---------- nosy: +martin.panter stage: needs patch -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 06:49:39 2016 From: report at bugs.python.org (STINNER Victor) Date: Fri, 18 Mar 2016 10:49:39 +0000 Subject: [issue26530] tracemalloc: add C API to manually track/untrack memory allocations In-Reply-To: <1458297338.01.0.0450328155143.issue26530@psf.upfronthosting.co.za> Message-ID: STINNER Victor added the comment: If you consider that using least signifiant bits to store an identifier of the address space is a bad idea, I'm open to discuss how tracemalloc should be extended to support this use case. -- malloc in POSIX standard: http://pubs.opengroup.org/onlinepubs/009695399/functions/malloc.html "The pointer returned if the allocation succeeds shall be suitably aligned so that it may be assigned to a pointer to any type of object and then used to access such an object in the space allocated (until the space is explicitly freed or reallocated)." Linux manual page has a simpler definition: "The malloc() and calloc() functions return a pointer to the allocated memory, which is suitably aligned for any built-in type." malloc of the GNU libc: "The address of a block returned by malloc or realloc in GNU systems is always a multiple of eight (or sixteen on 64-bit systems)." http://www.gnu.org/software/libc/manual/html_node/Aligned-Memory-Blocks.html Random Google link for GPU: "cudaMalloc() returns memory which is aligned at 256 bytes." (8 bits) http://www.dmi.unict.it/~bilotta/gpgpu/notes/09-optimization.html "Minimum alignment (bytes) for any datatype: 128" http://unix.stackexchange.com/questions/187245/how-to-get-the-size-of-gpu-memory-available-for-opencl ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 06:51:20 2016 From: report at bugs.python.org (STINNER Victor) Date: Fri, 18 Mar 2016 10:51:20 +0000 Subject: [issue26530] tracemalloc: add C API to manually track/untrack memory allocations In-Reply-To: <1457619430.68.0.0968942184372.issue26530@psf.upfronthosting.co.za> Message-ID: <1458298280.98.0.368081532097.issue26530@psf.upfronthosting.co.za> STINNER Victor added the comment: > So you guarantee tracemalloc itself won't use such a hack for other purposes? ;-) Hum, maybe we can make the "hack" "official": add two C macro to store and retrieve the domain from a pointer. The macro can validate that the domain is smaller or equal to 8 using an assertion (only in debug mode?). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 06:52:30 2016 From: report at bugs.python.org (Antoine Pitrou) Date: Fri, 18 Mar 2016 10:52:30 +0000 Subject: [issue26530] tracemalloc: add C API to manually track/untrack memory allocations In-Reply-To: <1457619430.68.0.0968942184372.issue26530@psf.upfronthosting.co.za> Message-ID: <1458298350.27.0.902833547242.issue26530@psf.upfronthosting.co.za> Antoine Pitrou added the comment: A n-GPU system will have n+1 address spaces. Such systems exist in high-performance computing. You can also probably find weird systems (embedded, mostly, I'd say) with more than two address spaces. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 07:07:17 2016 From: report at bugs.python.org (Xiang Zhang) Date: Fri, 18 Mar 2016 11:07:17 +0000 Subject: [issue26586] Simple enhancement to BaseHTTPRequestHandler In-Reply-To: <1458273976.86.0.666454727881.issue26586@psf.upfronthosting.co.za> Message-ID: <1458299237.23.0.901747583984.issue26586@psf.upfronthosting.co.za> Xiang Zhang added the comment: Thanks for your review. I have made some changes according to it. Status code 431 is returned when the header line is too long or there are too many headers. And I think the short message is OK and we can provide the exception message in the content message. As for the style, I don't know why I made that change. Quite sorry for make the noise. ---------- Added file: http://bugs.python.org/file42200/simple_enhancement_v2.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 07:42:14 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 18 Mar 2016 11:42:14 +0000 Subject: [issue26553] Write HTTP in uppercase In-Reply-To: <1457936613.19.0.773642660577.issue26553@psf.upfronthosting.co.za> Message-ID: <1458301334.17.0.327715909359.issue26553@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Similar changes could be made in docstrings and comments. But changing error messages can be not safe and could be made only in 3.6. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 08:25:29 2016 From: report at bugs.python.org (Roundup Robot) Date: Fri, 18 Mar 2016 12:25:29 +0000 Subject: [issue26580] Documentation for ftplib still references ftpmirror.py In-Reply-To: <1458215544.62.0.0104806566658.issue26580@psf.upfronthosting.co.za> Message-ID: <20160318122522.84282.14943.3253CB33@psf.io> Roundup Robot added the comment: New changeset 23ad18068814 by Berker Peksag in branch '3.5': Issue #26580: Remove outdated reference to ftpmirror https://hg.python.org/cpython/rev/23ad18068814 New changeset 48e106bf2add by Berker Peksag in branch 'default': Issue #26580: Remove outdated reference to ftpmirror https://hg.python.org/cpython/rev/48e106bf2add ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 08:26:49 2016 From: report at bugs.python.org (Berker Peksag) Date: Fri, 18 Mar 2016 12:26:49 +0000 Subject: [issue26580] Documentation for ftplib still references ftpmirror.py In-Reply-To: <1458215544.62.0.0104806566658.issue26580@psf.upfronthosting.co.za> Message-ID: <1458304009.05.0.35610798765.issue26580@psf.upfronthosting.co.za> Berker Peksag added the comment: Thanks! ---------- nosy: +berker.peksag resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: -Python 2.7, Python 3.2, Python 3.3, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 10:02:11 2016 From: report at bugs.python.org (Aatish Neupane) Date: Fri, 18 Mar 2016 14:02:11 +0000 Subject: [issue26553] Write HTTP in uppercase In-Reply-To: <1457936613.19.0.773642660577.issue26553@psf.upfronthosting.co.za> Message-ID: <1458309731.95.0.56975450779.issue26553@psf.upfronthosting.co.za> Changes by Aatish Neupane : Added file: http://bugs.python.org/file42201/2_fix_2.7.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 10:02:24 2016 From: report at bugs.python.org (Aatish Neupane) Date: Fri, 18 Mar 2016 14:02:24 +0000 Subject: [issue26553] Write HTTP in uppercase In-Reply-To: <1457936613.19.0.773642660577.issue26553@psf.upfronthosting.co.za> Message-ID: <1458309744.11.0.658108665547.issue26553@psf.upfronthosting.co.za> Changes by Aatish Neupane : Added file: http://bugs.python.org/file42202/2_fix_3.5.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 10:02:32 2016 From: report at bugs.python.org (Aatish Neupane) Date: Fri, 18 Mar 2016 14:02:32 +0000 Subject: [issue26553] Write HTTP in uppercase In-Reply-To: <1457936613.19.0.773642660577.issue26553@psf.upfronthosting.co.za> Message-ID: <1458309752.77.0.0187718276806.issue26553@psf.upfronthosting.co.za> Changes by Aatish Neupane : Added file: http://bugs.python.org/file42203/2_fix_3.6.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 10:05:09 2016 From: report at bugs.python.org (Aatish Neupane) Date: Fri, 18 Mar 2016 14:05:09 +0000 Subject: [issue26553] Write HTTP in uppercase In-Reply-To: <1457936613.19.0.773642660577.issue26553@psf.upfronthosting.co.za> Message-ID: <1458309909.6.0.876068947611.issue26553@psf.upfronthosting.co.za> Aatish Neupane added the comment: I found some other similar errors with the suggestion from the patch review. I have uploaded the new patches as 2_fix* . ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 11:09:22 2016 From: report at bugs.python.org (Mark Lawrence) Date: Fri, 18 Mar 2016 15:09:22 +0000 Subject: [issue10721] Remove HTTP 0.9 server support In-Reply-To: <1292523705.43.0.300913774105.issue10721@psf.upfronthosting.co.za> Message-ID: <1458313762.1.0.534763842473.issue10721@psf.upfronthosting.co.za> Changes by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 12:18:18 2016 From: report at bugs.python.org (Ezio Melotti) Date: Fri, 18 Mar 2016 16:18:18 +0000 Subject: [issue26240] Docstring of the subprocess module should be cleaned up In-Reply-To: <1454131083.41.0.870668221205.issue26240@psf.upfronthosting.co.za> Message-ID: <1458317898.85.0.226560870589.issue26240@psf.upfronthosting.co.za> Changes by Ezio Melotti : ---------- keywords: +easy nosy: +ezio.melotti type: -> enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 12:19:31 2016 From: report at bugs.python.org (Ezio Melotti) Date: Fri, 18 Mar 2016 16:19:31 +0000 Subject: [issue26246] Code output toggle button uses removed jQuery method In-Reply-To: <1454234717.37.0.159058452495.issue26246@psf.upfronthosting.co.za> Message-ID: <1458317971.05.0.0183307215159.issue26246@psf.upfronthosting.co.za> Ezio Melotti added the comment: Thanks both for spotting the bug and fixing it! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 12:20:07 2016 From: report at bugs.python.org (Ezio Melotti) Date: Fri, 18 Mar 2016 16:20:07 +0000 Subject: [issue26248] Improve scandir DirEntry docs, especially re symlinks and caching In-Reply-To: <1454258622.6.0.285150622743.issue26248@psf.upfronthosting.co.za> Message-ID: <1458318007.7.0.689403782998.issue26248@psf.upfronthosting.co.za> Changes by Ezio Melotti : ---------- stage: -> resolved type: -> enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 12:26:20 2016 From: report at bugs.python.org (SilentGhost) Date: Fri, 18 Mar 2016 16:26:20 +0000 Subject: [issue26587] Possible duplicate entries in sys.path if .pth files are used with zip's In-Reply-To: <1458296580.88.0.236395091392.issue26587@psf.upfronthosting.co.za> Message-ID: <1458318380.16.0.0794191582105.issue26587@psf.upfronthosting.co.za> SilentGhost added the comment: Could you provide a code example of your using addsitedir that results in duplicates? ---------- nosy: +SilentGhost stage: -> test needed versions: -Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 12:55:56 2016 From: report at bugs.python.org (Xiang Zhang) Date: Fri, 18 Mar 2016 16:55:56 +0000 Subject: [issue26585] Use html.escape to replace _quote_html in http.server In-Reply-To: <1458271086.94.0.0961534377342.issue26585@psf.upfronthosting.co.za> Message-ID: <1458320156.67.0.417555764128.issue26585@psf.upfronthosting.co.za> Xiang Zhang added the comment: I add two tests for html escaping. One for the error message and the other for display name in SimpleHTTPRequesthandler. ---------- Added file: http://bugs.python.org/file42204/_quote_html_to_html_escape_v2.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 12:58:02 2016 From: report at bugs.python.org (Zachary Ware) Date: Fri, 18 Mar 2016 16:58:02 +0000 Subject: [issue25934] ICC compiler: ICC treats denormal floating point numbers as 0.0 In-Reply-To: <1450911743.93.0.393041043786.issue25934@psf.upfronthosting.co.za> Message-ID: <1458320282.45.0.955791986454.issue25934@psf.upfronthosting.co.za> Zachary Ware added the comment: I closed this prematurely: I successfully added /fp:strict to ICC builds, but it didn't fix the underlying issue. ---------- resolution: fixed -> stage: resolved -> status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 12:58:58 2016 From: report at bugs.python.org (Nathaniel Smith) Date: Fri, 18 Mar 2016 16:58:58 +0000 Subject: [issue26530] tracemalloc: add C API to manually track/untrack memory allocations In-Reply-To: <1457619430.68.0.0968942184372.issue26530@psf.upfronthosting.co.za> Message-ID: <1458320338.42.0.67865683056.issue26530@psf.upfronthosting.co.za> Nathaniel Smith added the comment: There are other leakable resources besides heap and GPU memory -- shmem segments and file descriptors are two that I thought of earlier, but there are probably others too. (Note that not all file descriptors are associated with a python file object.) I guess one could hack most of these things into pointer bit tricks somehow, but I don't really see the appeal myself :-). It's fine for an internal implementation trick, but a very pythonic public api... > Tracemalloc doesn't give access to pointers in its API, so it shouldn't matter. This is actually a problem with this scheme... One would like to be able to get separate statistical reports for different resources. Also, tracemalloc is awesome (really), but there are potentially other consumers of the hookable allocation scheme too that might choose to expose more or less information; we shouldn't forget about them entirely :-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 13:14:47 2016 From: report at bugs.python.org (Xiang Zhang) Date: Fri, 18 Mar 2016 17:14:47 +0000 Subject: [issue26585] Use html.escape to replace _quote_html in http.server In-Reply-To: <1458271086.94.0.0961534377342.issue26585@psf.upfronthosting.co.za> Message-ID: <1458321287.8.0.258733820182.issue26585@psf.upfronthosting.co.za> Xiang Zhang added the comment: make some change to test for html escape in SimpleHTTPRequestHandler ---------- Added file: http://bugs.python.org/file42205/_quote_html_to_html_escape_v3.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 13:30:31 2016 From: report at bugs.python.org (Roundup Robot) Date: Fri, 18 Mar 2016 17:30:31 +0000 Subject: [issue26271] freeze.py makefile uses the wrong flags variables In-Reply-To: <1454454135.77.0.499921177416.issue26271@psf.upfronthosting.co.za> Message-ID: <20160318173028.8615.83645.F2F1108A@psf.io> Roundup Robot added the comment: New changeset 599328247e84 by Brett Cannon in branch '3.5': Issue #26271: Fix the Freeze tool to use variables passed in from the https://hg.python.org/cpython/rev/599328247e84 New changeset 364895e54bb0 by Brett Cannon in branch 'default': Merge for issue #26271 https://hg.python.org/cpython/rev/364895e54bb0 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 13:31:03 2016 From: report at bugs.python.org (Brett Cannon) Date: Fri, 18 Mar 2016 17:31:03 +0000 Subject: [issue26271] freeze.py makefile uses the wrong flags variables In-Reply-To: <1454454135.77.0.499921177416.issue26271@psf.upfronthosting.co.za> Message-ID: <1458322263.19.0.107606476015.issue26271@psf.upfronthosting.co.za> Brett Cannon added the comment: Thanks for the patch, Daniel! Added you to the ACKS file. ---------- stage: commit review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 14:13:30 2016 From: report at bugs.python.org (Roundup Robot) Date: Fri, 18 Mar 2016 18:13:30 +0000 Subject: [issue26250] no document for sqlite3.Cursor.connection In-Reply-To: <1454262712.53.0.251399487214.issue26250@psf.upfronthosting.co.za> Message-ID: <20160318181315.84264.21484.5C9F494F@psf.io> Roundup Robot added the comment: New changeset 52660878c833 by Ezio Melotti in branch '3.5': #26250: document the sqlite3.Cursor.connection attribute. Initial patches by Aviv Palivoda and Varpu Rantala. https://hg.python.org/cpython/rev/52660878c833 New changeset 6fed752fd88e by Ezio Melotti in branch 'default': #26250: merge with 3.5. https://hg.python.org/cpython/rev/6fed752fd88e New changeset 6dcf60bf855b by Ezio Melotti in branch '2.7': #26250: document the sqlite3.Cursor.connection attribute. Initial patches by Aviv Palivoda and Varpu Rantala. https://hg.python.org/cpython/rev/6dcf60bf855b ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 14:14:13 2016 From: report at bugs.python.org (Ezio Melotti) Date: Fri, 18 Mar 2016 18:14:13 +0000 Subject: [issue26250] no document for sqlite3.Cursor.connection In-Reply-To: <1454262712.53.0.251399487214.issue26250@psf.upfronthosting.co.za> Message-ID: <1458324853.66.0.304517506221.issue26250@psf.upfronthosting.co.za> Ezio Melotti added the comment: Fixed, thanks for the report and the patches! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 14:20:07 2016 From: report at bugs.python.org (Ezio Melotti) Date: Fri, 18 Mar 2016 18:20:07 +0000 Subject: [issue26257] Eliminate buffer_tests.py In-Reply-To: <1454323795.43.0.12298865479.issue26257@psf.upfronthosting.co.za> Message-ID: <1458325207.16.0.360273382692.issue26257@psf.upfronthosting.co.za> Changes by Ezio Melotti : ---------- nosy: +ezio.melotti, serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 14:23:02 2016 From: report at bugs.python.org (Ezio Melotti) Date: Fri, 18 Mar 2016 18:23:02 +0000 Subject: [issue26258] readline module for python 3.x on windows In-Reply-To: <1454329288.94.0.0141088037674.issue26258@psf.upfronthosting.co.za> Message-ID: <1458325382.53.0.935860810382.issue26258@psf.upfronthosting.co.za> Ezio Melotti added the comment: I'm going to close this, but you can try bringing this up on python-list or python-ideas to see if there's any existing solution that could perhaps be included in Python. ---------- nosy: +ezio.melotti resolution: -> postponed stage: -> resolved status: open -> closed type: -> enhancement versions: +Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 14:28:06 2016 From: report at bugs.python.org (Ezio Melotti) Date: Fri, 18 Mar 2016 18:28:06 +0000 Subject: [issue26264] keyword module missing async and await keywords In-Reply-To: <1454378786.53.0.925531991818.issue26264@psf.upfronthosting.co.za> Message-ID: <1458325686.09.0.833733995002.issue26264@psf.upfronthosting.co.za> Ezio Melotti added the comment: > Depending on the purpose of the syntax highlighting or code analysis, > it might be better for these to be listed as keywords now, rather than > waiting until 3.7. I agree, especially considering that it takes time before syntax highlighters update their keywords list and users update their syntax highlighters. Would this be doable, considering that the list is generated automatically? Are there any other downsides in doing it? ---------- nosy: +ezio.melotti _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 14:54:29 2016 From: report at bugs.python.org (Roundup Robot) Date: Fri, 18 Mar 2016 18:54:29 +0000 Subject: [issue26252] Add an example to importlib docs on setting up an importer In-Reply-To: <1454262973.06.0.14692878532.issue26252@psf.upfronthosting.co.za> Message-ID: <20160318185427.946.36094.FAF5C4EE@psf.io> Roundup Robot added the comment: New changeset dc24ab548e2b by Brett Cannon in branch 'default': Issue #26252: Add an example on how to register a finder https://hg.python.org/cpython/rev/dc24ab548e2b ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 14:55:46 2016 From: report at bugs.python.org (Brett Cannon) Date: Fri, 18 Mar 2016 18:55:46 +0000 Subject: [issue26252] Add an example to importlib docs on setting up an importer In-Reply-To: <1454262973.06.0.14692878532.issue26252@psf.upfronthosting.co.za> Message-ID: <1458327346.42.0.190718632945.issue26252@psf.upfronthosting.co.za> Brett Cannon added the comment: I added an example on how to register both a meta path and path entry finder. It's a rather simple example, but hopefully using the classes that importlib uses will help also point people towards the appropriate classes to learn about for their own needs. ---------- resolution: -> fixed stage: needs patch -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 14:59:15 2016 From: report at bugs.python.org (Ezio Melotti) Date: Fri, 18 Mar 2016 18:59:15 +0000 Subject: [issue26283] zipfile can not handle the path build by os.path.join() In-Reply-To: <1454552368.89.0.734714115407.issue26283@psf.upfronthosting.co.za> Message-ID: <1458327555.05.0.187280421395.issue26283@psf.upfronthosting.co.za> Ezio Melotti added the comment: I don't think this is a bug. The ZIP format specification requires the use of forward slashes[0]: 4.4.17 file name: (Variable) 4.4.17.1 The name of the file, with optional relative path. The path stored MUST not contain a drive or device letter, or a leading slash. All slashes MUST be forward slashes '/' as opposed to backwards slashes '\' for compatibility with Amiga and UNIX file systems etc. os.path.join() will use different path separators depending on the system. If you don't want to hardcode the slashes in a string literal, you can simply use '/'.join(...) instead of os.path.join(). [0]: https://pkware.cachefly.net/webdocs/casestudies/APPNOTE.TXT ---------- nosy: +ezio.melotti resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 15:28:55 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 18 Mar 2016 19:28:55 +0000 Subject: [issue26257] Eliminate buffer_tests.py In-Reply-To: <1454323795.43.0.12298865479.issue26257@psf.upfronthosting.co.za> Message-ID: <1458329335.66.0.664683935127.issue26257@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: It looks to me that all tests from CommonTest except test_capitalize_nonascii can be merged into BaseTest. A number of tests from MixinStrUnicodeUserStringTest could be applied to bytes and bytearray too. I think we should left only two classes in string_tests: common tests for str, UserString, bytes and bytearray, and common tests for str and UserString that are not applicable to bytes and bytearray. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 15:37:16 2016 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 18 Mar 2016 19:37:16 +0000 Subject: [issue26546] Provide translated french translation on docs.python.org In-Reply-To: <1457794223.79.0.618185263259.issue26546@psf.upfronthosting.co.za> Message-ID: <1458329836.22.0.589041175926.issue26546@psf.upfronthosting.co.za> Terry J. Reedy added the comment: I agree on the url. It can always redirect to a CCTLD if there is one. You *might* want to discuss the how on python-ideas list. ---------- nosy: +terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 15:44:29 2016 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 18 Mar 2016 19:44:29 +0000 Subject: [issue26553] Write HTTP in uppercase In-Reply-To: <1457936613.19.0.773642660577.issue26553@psf.upfronthosting.co.za> Message-ID: <1458330269.76.0.053990997217.issue26553@psf.upfronthosting.co.za> Terry J. Reedy added the comment: Aatish, please sign the CLA https://www.python.org/psf/contrib/ https://www.python.org/psf/contrib/contrib-form/ ---------- nosy: +terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 16:05:04 2016 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 18 Mar 2016 20:05:04 +0000 Subject: [issue26576] Tweak wording of decorator docos In-Reply-To: <1458196198.66.0.0478952577579.issue26576@psf.upfronthosting.co.za> Message-ID: <1458331504.67.0.877826787804.issue26576@psf.upfronthosting.co.za> Terry J. Reedy added the comment: Guido, the discrepancy between the decorator doc's 'equivalent code' and actual, optimized, behavior with regard to skipping an intermediate binding of the function to the name came up soon after decorators were added. I cannot find the issue, but as I remember, you said at the time that the doc's 'equivalent' code was good enough, and perhaps that you did not want to force the optimization on other implementations (not sure of this latter). This issue has come up often enough on Python list and SO that many think that the actual behavior should be documented. But should it be documented as a guaranteed language feature or as just an optional optimization? ---------- nosy: +gvanrossum, terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 16:24:25 2016 From: report at bugs.python.org (Roundup Robot) Date: Fri, 18 Mar 2016 20:24:25 +0000 Subject: [issue26095] Update porting HOWTO to special-case Python 2 code, not Python 3 In-Reply-To: <1452651397.71.0.110404454924.issue26095@psf.upfronthosting.co.za> Message-ID: <20160318202420.53386.59889.053ECB65@psf.io> Roundup Robot added the comment: New changeset a2bf6d1e018e by Brett Cannon in branch 'default': Merge for issue #26095 https://hg.python.org/cpython/rev/a2bf6d1e018e ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 16:24:39 2016 From: report at bugs.python.org (Brett Cannon) Date: Fri, 18 Mar 2016 20:24:39 +0000 Subject: [issue26095] Update porting HOWTO to special-case Python 2 code, not Python 3 In-Reply-To: <1452651397.71.0.110404454924.issue26095@psf.upfronthosting.co.za> Message-ID: <1458332679.62.0.206207436118.issue26095@psf.upfronthosting.co.za> Changes by Brett Cannon : ---------- resolution: -> fixed stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 16:26:09 2016 From: report at bugs.python.org (Brett Cannon) Date: Fri, 18 Mar 2016 20:26:09 +0000 Subject: [issue26281] Clear sys.path_importer_cache from importlib.invalidate_caches() In-Reply-To: <1454533860.47.0.453601441471.issue26281@psf.upfronthosting.co.za> Message-ID: <1458332769.33.0.395214295177.issue26281@psf.upfronthosting.co.za> Brett Cannon added the comment: Eric's convinced me this isn't worth it. ---------- resolution: -> rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 16:31:37 2016 From: report at bugs.python.org (Brett Cannon) Date: Fri, 18 Mar 2016 20:31:37 +0000 Subject: [issue23723] Provide a way to disable bytecode staleness checks In-Reply-To: <1426875282.27.0.254210392532.issue23723@psf.upfronthosting.co.za> Message-ID: <1458333097.77.0.346236639752.issue23723@psf.upfronthosting.co.za> Brett Cannon added the comment: I realized that importlib.abc.SourceLoader.path_stats() provides a way to override stat collection and basically hard-code the stat number for all files from an import perspective. So if people simply generated their bytecode with a static timestamp and overrode this method then they would get the effect they want. ---------- resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 16:46:20 2016 From: report at bugs.python.org (Robert Kuska) Date: Fri, 18 Mar 2016 20:46:20 +0000 Subject: [issue23857] Make default HTTPS certificate verification setting configurable In-Reply-To: <1428057486.92.0.857087998573.issue23857@psf.upfronthosting.co.za> Message-ID: <1458333980.35.0.31143163373.issue23857@psf.upfronthosting.co.za> Robert Kuska added the comment: If test fail it will print out non-telling message which make debugging a little bit hard: FAIL: test__https_verify_envvar (test.test_ssl.ContextTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/builddir/build/BUILD/Python-2.7.5/Lib/test/test_ssl.py", line 1143, in test__https_verify_envvar assert_python_ok("-c", https_is_verified, **extra_env) File "/builddir/build/BUILD/Python-2.7.5/Lib/test/script_helper.py", line 55, in assert_python_ok return _assert_python(True, *args, **env_vars) File "/builddir/build/BUILD/Python-2.7.5/Lib/test/script_helper.py", line 47, in _assert_python "stderr follows:\n%s" % (rc, err.decode('ascii', 'ignore'))) AssertionError: Process return code is 1, stderr follows: Would be possible to change following code which is being executed: + https_is_verified = """import ssl, sys;\ + sys.exit(ssl._create_default_https_context is not + ssl.create_default_context)""" into something like https_is_verified = """import ssl, sys;\ value = ssl._create_default_https_context is not ssl.create_default_context;\ sys.exit('ssl._create_default_https_context should be set to verified' if value else value)""" So traceback will look like this: ... "stderr follows:\n%s" % (rc, err.decode('ascii', 'ignore'))) AssertionError: Process return code is 1, stderr follows: ssl._create_default_https_context should be set to verified ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 17:22:22 2016 From: report at bugs.python.org (Brett Cannon) Date: Fri, 18 Mar 2016 21:22:22 +0000 Subject: [issue26396] Create json.JSONType In-Reply-To: <1456015468.57.0.0882861590724.issue26396@psf.upfronthosting.co.za> Message-ID: <1458336142.92.0.280165922807.issue26396@psf.upfronthosting.co.za> Brett Cannon added the comment: Here is a preliminary patch with docs. I didn't do any tests because I just don't know what kind of test we would want. Use isinstance() to make sure it covers the types we expect? And I'm not sure how to test the key type for mappings. ---------- keywords: +patch stage: needs patch -> patch review Added file: http://bugs.python.org/file42206/jsontype.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 17:39:27 2016 From: report at bugs.python.org (STINNER Victor) Date: Fri, 18 Mar 2016 21:39:27 +0000 Subject: [issue26588] _tracemalloc: add support for multiple address spaces (domains) Message-ID: <1458337167.06.0.908004959718.issue26588@psf.upfronthosting.co.za> New submission from STINNER Victor: The tracemalloc module uses a hashtable: pointer (void*) => trace. Some embedded devices use multiple address spaces. Each GPU also has its own address space. CUDA, OpenCL and OpenGL should also be seen as different address spaces. In the issue #26530, it was proposed (required?) to support multiple addresses spaces to be able to use tracemalloc in numpy. Attached patch enhances tracemalloc to use (pointer: void*, domain: unsigned int) as key in the hashtable. A (pointer, domain) key is stored in a hashtable entry. In the patch, the domain is hardcoded to 0, but the issue #26530 will add new C functions to track/untrack memory blocks, and this new functions will have a domain parameter. The patch changes how a key is passed to the hashtable API: pass a *pointer* to a key rather than directly the key value. Because of that, the patch is quite long. The patch also removes the unused function _Py_hashtable_hash_int(). _Py_HASHTABLE_ENTRY_DATA() macro now requires the hashtable to get the key size, since the offset of data now depends on the key size. ---------- components: Extension Modules files: tracemalloc.patch keywords: patch messages: 261997 nosy: haypo, njs, pitrou priority: normal severity: normal status: open title: _tracemalloc: add support for multiple address spaces (domains) type: enhancement versions: Python 3.6 Added file: http://bugs.python.org/file42207/tracemalloc.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 17:48:03 2016 From: report at bugs.python.org (Antoine Pitrou) Date: Fri, 18 Mar 2016 21:48:03 +0000 Subject: [issue26588] _tracemalloc: add support for multiple address spaces (domains) In-Reply-To: <1458337167.06.0.908004959718.issue26588@psf.upfronthosting.co.za> Message-ID: <56EC7790.3020806@free.fr> Antoine Pitrou added the comment: Le 18/03/2016 22:39, STINNER Victor a ?crit : > > In the issue #26530, it was proposed (required?) to support multiple addresses spaces to be able to use tracemalloc in numpy. Only proposed :-) Numpy itself only works on the CPU, however Nathaniel may have other use cases of his own. Also, Numba allows use of the Numpy API (part thereof, anyway) on GPUs. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 17:59:23 2016 From: report at bugs.python.org (STINNER Victor) Date: Fri, 18 Mar 2016 21:59:23 +0000 Subject: [issue26530] tracemalloc: add C API to manually track/untrack memory allocations In-Reply-To: <1457619430.68.0.0968942184372.issue26530@psf.upfronthosting.co.za> Message-ID: <1458338363.49.0.604205320109.issue26530@psf.upfronthosting.co.za> STINNER Victor added the comment: Nathaniel Smith: > There are other leakable resources besides heap and GPU memory -- shmem segments and file descriptors are two that I thought of earlier, but there are probably others too. (Note that not all file descriptors are associated with a python file object.) I guess one could hack most of these things into pointer bit tricks somehow, but I don't really see the appeal myself :-). It's fine for an internal implementation trick, but a very pythonic public api... Ok ok, you convinced me. I opened the issue #26588: "_tracemalloc: add support for multiple address spaces (domains)". Hum, the idea of tracking file descriptors is appealing. In practice, I suggest to simply use Py_uintptr_t type in the new C API rather than void*. So it's more obvious that tracemalloc doesn't care of the value, it only requires the value to be unique. FYI On Windows, handles and file descriptors are also different namespaces. You can get a handle and a file descriptor which have the same value but are identify different objects. I don't know shmem. -- Another different idea would be to annotate a "color" to a memory allocator. For example, group memory only used internally, and memory to store user data. For a network application, you can imagine an identifier per request and then group all allocations of this request. It sounds very similar to the domain idea, but there is a very important difference: the API proposed in issue #26588 requires to pass domain to track *and* untrack functions. The problem with coloring allocations is that the color is known when the memory is allocated, but the function releasing the memory can be very far, and it can simply be the garbage collector. So the color must be stored in the hashtable *value* (the trace), whereas the domain is stored in the hashtable *key* (a tuple (pointer, domain)). Since no user directly asked this feature, I propose to defer this issue and focus on the concrete issue #26588 to support tracking GPU(s) memory. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 18:02:32 2016 From: report at bugs.python.org (Jakub Stasiak) Date: Fri, 18 Mar 2016 22:02:32 +0000 Subject: [issue25609] Add a ContextManager ABC and type In-Reply-To: <1447355679.68.0.225089426373.issue25609@psf.upfronthosting.co.za> Message-ID: <1458338552.01.0.0371095185761.issue25609@psf.upfronthosting.co.za> Changes by Jakub Stasiak : ---------- nosy: +jstasiak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 18:23:16 2016 From: report at bugs.python.org (Raymond Hettinger) Date: Fri, 18 Mar 2016 22:23:16 +0000 Subject: [issue26589] Add HTTP Response code 451 Message-ID: <1458339796.0.0.55641326492.issue26589@psf.upfronthosting.co.za> New submission from Raymond Hettinger: https://tools.ietf.org/html/rfc7725 ---------- components: Library (Lib) files: code451.diff keywords: patch messages: 262000 nosy: rhettinger priority: normal severity: normal stage: patch review status: open title: Add HTTP Response code 451 type: enhancement versions: Python 3.6 Added file: http://bugs.python.org/file42208/code451.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 18:32:17 2016 From: report at bugs.python.org (Martin Panter) Date: Fri, 18 Mar 2016 22:32:17 +0000 Subject: [issue26585] Use html.escape to replace _quote_html in http.server In-Reply-To: <1458271086.94.0.0961534377342.issue26585@psf.upfronthosting.co.za> Message-ID: <1458340337.14.0.954654033689.issue26585@psf.upfronthosting.co.za> Martin Panter added the comment: Thanks for the tests. I left a couple comments. About encoding quotes: Personally I don?t see much value unless you are encoding an attribute value, in which case I would prefer to use xml.sax.saxutils.quoteattr(). Encoded quotes would only become useful if the ?error_message_format? attribute was modified. A more practical downside is that if ?error_content_type? is set to say text/plain, we are adding two somewhat common characters that will get messed up. E.g. the ?explain? string for 429 Too Many Requests will include the double-quoted "rate limiting". And an apostrophe could easily be given in a custom error message, e.g. ?Can't write a clean error message?. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 18:49:08 2016 From: report at bugs.python.org (Brett Cannon) Date: Fri, 18 Mar 2016 22:49:08 +0000 Subject: [issue25609] Add a ContextManager ABC and type In-Reply-To: <1447355679.68.0.225089426373.issue25609@psf.upfronthosting.co.za> Message-ID: <1458341348.78.0.477324089828.issue25609@psf.upfronthosting.co.za> Brett Cannon added the comment: Here is an initial patch to add AbstractContextManager and ContextManagerType to contextlib. There are no tests yet as I want to make sure this looks okay first. ---------- keywords: +patch stage: needs patch -> patch review Added file: http://bugs.python.org/file42209/contextmanagertype.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 18:50:03 2016 From: report at bugs.python.org (STINNER Victor) Date: Fri, 18 Mar 2016 22:50:03 +0000 Subject: [issue26588] _tracemalloc: add support for multiple address spaces (domains) In-Reply-To: <1458337167.06.0.908004959718.issue26588@psf.upfronthosting.co.za> Message-ID: <1458341403.4.0.796776255672.issue26588@psf.upfronthosting.co.za> STINNER Victor added the comment: Patch version 2: - modify _tracemalloc._get_traces() to include domain in traces - add tracemalloc.DomainFilter(domain) - add domain optional parameter to tracemalloc.Filter constructor Currently, Snapshot._group_by() ignores domain information. I don't know how the domain should be exposed, *if* it should be exposed. By the way, maybe we don't need to export the domain at the Python level at all? (Don't expose it in _tracemalloc._get_traces()). ---------- Added file: http://bugs.python.org/file42210/tracemalloc-2.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 18:54:27 2016 From: report at bugs.python.org (STINNER Victor) Date: Fri, 18 Mar 2016 22:54:27 +0000 Subject: [issue26588] _tracemalloc: add support for multiple address spaces (domains) In-Reply-To: <1458337167.06.0.908004959718.issue26588@psf.upfronthosting.co.za> Message-ID: <1458341667.62.0.870155811581.issue26588@psf.upfronthosting.co.za> STINNER Victor added the comment: > Also, Numba allows use of the Numpy API (part thereof, anyway) on GPUs. Do you mean that Numba requires supporting multiple address spaces to be able to use tracemalloc? Or that supporting multiple address spaces would also to *also* track GPU memory allocations? A friend told me that CUDA, OpenGL and OpenCL can (should?) be seen as 3 different address spaces. These libraries don't expose directly addresses in the GPU address space, but may use handles. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 19:36:49 2016 From: report at bugs.python.org (STINNER Victor) Date: Fri, 18 Mar 2016 23:36:49 +0000 Subject: [issue26588] _tracemalloc: add support for multiple address spaces (domains) In-Reply-To: <1458337167.06.0.908004959718.issue26588@psf.upfronthosting.co.za> Message-ID: <1458344209.01.0.154516474558.issue26588@psf.upfronthosting.co.za> STINNER Victor added the comment: Patch 3: - avoid the memory overhead of storing domain if domains are not used - add optional use_domain parameter to tracemalloc.start() - by default, no change: use a C void* (pointer) as key for the trace hashtable - if start() is called with use_domain=True, use (pointer: void*, domain: unsigned int) key for the trace hashtable ---------- Added file: http://bugs.python.org/file42211/tracemalloc-3.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 19:38:06 2016 From: report at bugs.python.org (STINNER Victor) Date: Fri, 18 Mar 2016 23:38:06 +0000 Subject: [issue26588] _tracemalloc: add support for multiple address spaces (domains) In-Reply-To: <1458337167.06.0.908004959718.issue26588@psf.upfronthosting.co.za> Message-ID: <1458344286.34.0.207529779721.issue26588@psf.upfronthosting.co.za> STINNER Victor added the comment: Hum, on OpenStack it's common for me to work on a patch serie. Since our development workflow doesn't support that, I used a single patch. It's hard to review it, all changes are merged into one big patch :-/ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 20:00:31 2016 From: report at bugs.python.org (Martin Panter) Date: Sat, 19 Mar 2016 00:00:31 +0000 Subject: [issue20186] Derby #18: Convert 31 sites to Argument Clinic across 23 files In-Reply-To: <1389140586.13.0.921060348978.issue20186@psf.upfronthosting.co.za> Message-ID: <1458345631.85.0.973608520962.issue20186@psf.upfronthosting.co.za> Changes by Martin Panter : Added file: http://bugs.python.org/file33425/heapq_clinic.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 20:23:49 2016 From: report at bugs.python.org (Roundup Robot) Date: Sat, 19 Mar 2016 00:23:49 +0000 Subject: [issue26567] ResourceWarning: Use tracemalloc to display the traceback where an object was allocated when a ResourceWarning is emitted In-Reply-To: <1458047716.42.0.114286591066.issue26567@psf.upfronthosting.co.za> Message-ID: <20160319002346.84266.11862.CAA890AD@psf.io> Roundup Robot added the comment: New changeset 2428d794b0e1 by Victor Stinner in branch 'default': On ResourceWarning, log traceback where the object was allocated https://hg.python.org/cpython/rev/2428d794b0e1 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 20:23:49 2016 From: report at bugs.python.org (Roundup Robot) Date: Sat, 19 Mar 2016 00:23:49 +0000 Subject: [issue26568] Add a new warnings.showmsg() function taking a warnings.WarningMessage object In-Reply-To: <1458052320.63.0.791464551893.issue26568@psf.upfronthosting.co.za> Message-ID: <20160319002346.84266.39328.6C14817F@psf.io> Roundup Robot added the comment: New changeset 79888b970cc4 by Victor Stinner in branch 'default': Add _showwarnmsg() and _formatwarnmsg() to warnings https://hg.python.org/cpython/rev/79888b970cc4 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 20:26:19 2016 From: report at bugs.python.org (STINNER Victor) Date: Sat, 19 Mar 2016 00:26:19 +0000 Subject: [issue26568] Add a new warnings.showwarnmsg() function taking a warnings.WarningMessage object In-Reply-To: <1458052320.63.0.791464551893.issue26568@psf.upfronthosting.co.za> Message-ID: <1458347179.4.0.870058031875.issue26568@psf.upfronthosting.co.za> STINNER Victor added the comment: I pushed a change which adds a private _showwarnmsg(), but I'm still interested to make this new function public! I pushed the change to unblock the issue #26567. ---------- title: Add a new warnings.showmsg() function taking a warnings.WarningMessage object -> Add a new warnings.showwarnmsg() function taking a warnings.WarningMessage object _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 20:33:05 2016 From: report at bugs.python.org (Martin Panter) Date: Sat, 19 Mar 2016 00:33:05 +0000 Subject: [issue20186] Derby #18: Convert 31 sites to Argument Clinic across 23 files In-Reply-To: <1389140586.13.0.921060348978.issue20186@psf.upfronthosting.co.za> Message-ID: <1458347585.86.0.529672405606.issue20186@psf.upfronthosting.co.za> Martin Panter added the comment: Summary of the work here as I pass through :) Files already done: Objects/memoryobject.c: converted to signatures without Arg Clinic (Py 3.5) Modules/_opcode.c: Issue 19674 (3.4). Only one function I can see there (Larry?s original post says two sites). Modules/_io/_iomodule.c: part of Georg?s modules_issue20186.patch, but already handled in Issue 20175 (3.5) Files being worked on: Modules/_operator.c: patch by Tal, ready for commit? Modules/_lsprof.c: Georg?s modules_issue20186.patch Modules/_heapqmodule.c: restored Georg?s patch; looks like he meant to add it to the main patch but it got lost Objects/enumobject.c: patch by Tal Modules/symtablemodule.c: Georg?s modules_issue20186.patch Modules/mathmodule.c: patch by Tal Modules/_tracemalloc.c: modules_issue20186.patch; needs update from review comments Modules/_csv.c: modules_issue20186.patch; couple of review comments That leaves the following files from OP: Objects/tupleobject.c: 2 sites Objects/descrobject.c: 2 sites Objects/complexobject.c: 2 sites Objects/weakrefobject.c: 1 sites Objects/structseq.c: 1 sites Objects/rangeobject.c: 1 sites Objects/object.c: 1 sites Objects/moduleobject.c: 1 sites Objects/funcobject.c: 1 sites Objects/fileobject.c: 1 sites Objects/codeobject.c: 1 sites Objects/boolobject.c: 1 sites ---------- nosy: +martin.panter _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 21:19:12 2016 From: report at bugs.python.org (Roundup Robot) Date: Sat, 19 Mar 2016 01:19:12 +0000 Subject: [issue26568] Add a new warnings.showwarnmsg() function taking a warnings.WarningMessage object In-Reply-To: <1458052320.63.0.791464551893.issue26568@psf.upfronthosting.co.za> Message-ID: <20160319011903.30607.97974.F6829ABE@psf.io> Roundup Robot added the comment: New changeset 9c92352324e8 by Victor Stinner in branch 'default': Fix test_logging https://hg.python.org/cpython/rev/9c92352324e8 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 21:25:59 2016 From: report at bugs.python.org (STINNER Victor) Date: Sat, 19 Mar 2016 01:25:59 +0000 Subject: [issue26567] ResourceWarning: Use tracemalloc to display the traceback where an object was allocated when a ResourceWarning is emitted In-Reply-To: <1458047716.42.0.114286591066.issue26567@psf.upfronthosting.co.za> Message-ID: <1458350759.2.0.352065324425.issue26567@psf.upfronthosting.co.za> STINNER Victor added the comment: It looks like io.FileIO has a strong implementation of the destructor. If the object becomes alive again because of random code called in the destructor, the object is not removed. socket and os.scandir have a classical unsafe destructor. Moreover, I'm no more sure about the chosen design. When warnings.catch_warnings() is used and an unclosed io.FileIO is destroyed, the object is kept alive because it is stored in the "source" attribute of a warnings.WarningMessage. I don't know if keeping WarningMessaging alive longer than the call to showwarning() (or _showarnmsg) is a common use case or not. The issue #26568 wants to promote the WarningMessage class, so some users may start to keep it alive. An alternative is to format the object traceback and pass the traceback to WarningMessage. It requires to decide the format of the traceback (list of ..., string, something else?). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 21:28:47 2016 From: report at bugs.python.org (STINNER Victor) Date: Sat, 19 Mar 2016 01:28:47 +0000 Subject: [issue26567] ResourceWarning: Use tracemalloc to display the traceback where an object was allocated when a ResourceWarning is emitted In-Reply-To: <1458047716.42.0.114286591066.issue26567@psf.upfronthosting.co.za> Message-ID: <1458350927.22.0.285725348594.issue26567@psf.upfronthosting.co.za> STINNER Victor added the comment: When warnings._showwarnmsg(), the io.FileIO object is not closed yet, so all attributes are accessible, which can be useful. Hopefully, the file is closed even if it is kept alive by the warning logger. So maybe it's ok to keep the Python object alive, if the underlying resource (the file descriptor) is released. I mean, it's not a big deal. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 21:31:15 2016 From: report at bugs.python.org (STINNER Victor) Date: Sat, 19 Mar 2016 01:31:15 +0000 Subject: [issue26590] socket destructor: implement finalizer Message-ID: <1458351075.41.0.994766438444.issue26590@psf.upfronthosting.co.za> New submission from STINNER Victor: The PEP 442 helped to make object finalization safer, but it's just an API, it's not widely used in the Python core yet. io.FileIO has a nice implementation, but socket.socket and os.scandir don't. I noticed this while working on the issue #26567 which indirectly resurected a destroyed socket (in test_socket). As I workaround, I reverted my change on socket destructor, but I'm interested to enhance socket destructor to be able to use the new tracemalloc feature of the warnings module. ---------- messages: 262014 nosy: haypo, pitrou priority: normal severity: normal status: open title: socket destructor: implement finalizer type: enhancement versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 21:31:33 2016 From: report at bugs.python.org (STINNER Victor) Date: Sat, 19 Mar 2016 01:31:33 +0000 Subject: [issue26567] ResourceWarning: Use tracemalloc to display the traceback where an object was allocated when a ResourceWarning is emitted In-Reply-To: <1458047716.42.0.114286591066.issue26567@psf.upfronthosting.co.za> Message-ID: <1458351093.65.0.0370544656667.issue26567@psf.upfronthosting.co.za> STINNER Victor added the comment: For socket & scandir, I opened the issue #26590: "socket destructor: implement finalizer". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 21:52:05 2016 From: report at bugs.python.org (Roundup Robot) Date: Sat, 19 Mar 2016 01:52:05 +0000 Subject: [issue26567] ResourceWarning: Use tracemalloc to display the traceback where an object was allocated when a ResourceWarning is emitted In-Reply-To: <1458047716.42.0.114286591066.issue26567@psf.upfronthosting.co.za> Message-ID: <20160319015201.13992.8249.6C3CCB59@psf.io> Roundup Robot added the comment: New changeset b8acf98beca9 by Victor Stinner in branch 'default': Try to fix test_warnings on Windows https://hg.python.org/cpython/rev/b8acf98beca9 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 22:37:56 2016 From: report at bugs.python.org (Aatish Neupane) Date: Sat, 19 Mar 2016 02:37:56 +0000 Subject: [issue26553] Write HTTP in uppercase In-Reply-To: <1457936613.19.0.773642660577.issue26553@psf.upfronthosting.co.za> Message-ID: <1458355076.03.0.484095861485.issue26553@psf.upfronthosting.co.za> Aatish Neupane added the comment: I already did that. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 23:57:38 2016 From: report at bugs.python.org (Dario Giovannetti) Date: Sat, 19 Mar 2016 03:57:38 +0000 Subject: [issue16142] ArgumentParser inconsistent with parse_known_args In-Reply-To: <1349448801.58.0.783623579173.issue16142@psf.upfronthosting.co.za> Message-ID: <1458359858.42.0.120097648099.issue16142@psf.upfronthosting.co.za> Changes by Dario Giovannetti : ---------- nosy: +kynikos _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 19 00:00:48 2016 From: report at bugs.python.org (Aatish Neupane) Date: Sat, 19 Mar 2016 04:00:48 +0000 Subject: [issue26554] PC\bdist_wininst\install.c: Missing call to fclose() In-Reply-To: <1457949701.38.0.834751371072.issue26554@psf.upfronthosting.co.za> Message-ID: <1458360048.15.0.896769986868.issue26554@psf.upfronthosting.co.za> Changes by Aatish Neupane : ---------- keywords: +patch Added file: http://bugs.python.org/file42212/issue26554.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 19 01:07:31 2016 From: report at bugs.python.org (Xiang Zhang) Date: Sat, 19 Mar 2016 05:07:31 +0000 Subject: [issue26585] Use html.escape to replace _quote_html in http.server In-Reply-To: <1458271086.94.0.0961534377342.issue26585@psf.upfronthosting.co.za> Message-ID: <1458364051.13.0.204702776274.issue26585@psf.upfronthosting.co.za> Xiang Zhang added the comment: Thanks for your review. Set quote to False when html.escape is OK to me. But except for the usage in BaseHTTPRequestHandler, I think we should also set quote to False for the usage in SimpleHTTPRequestHandler since they do not appear in attribute either. And I left a reply to your comment. How do you think about these? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 19 02:32:07 2016 From: report at bugs.python.org (Martin Panter) Date: Sat, 19 Mar 2016 06:32:07 +0000 Subject: [issue23214] BufferedReader.read1(size) signature incompatible with BufferedIOBase.read1(size=-1) In-Reply-To: <1420854382.8.0.44417983014.issue23214@psf.upfronthosting.co.za> Message-ID: <1458369127.79.0.56325535419.issue23214@psf.upfronthosting.co.za> Martin Panter added the comment: Okay here is a patch implementing read1(-1) in BufferedReader and BytesIO (my original proposal). Other changes: * Changed read1(size=-1) ? read1([size]), because BufferedReader and BytesIO do not accept keyword arguments (see also Issue 23738) * Defined size=-1 to mean an arbitrary non-zero size * Change BufferedReader.read1() to return a buffer of data * Change BytesIO.read1() to read until EOF * Add tests to complement existing read1(size) tests for BufferedReader (includes BufferedRandom), BufferedRWPair, and BytesIO ---------- keywords: +patch stage: -> patch review Added file: http://bugs.python.org/file42213/read1-arbitrary.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 19 03:06:36 2016 From: report at bugs.python.org (Berker Peksag) Date: Sat, 19 Mar 2016 07:06:36 +0000 Subject: [issue26560] Error in assertion in wsgiref.handlers.BaseHandler.start_response In-Reply-To: <1457979107.59.0.709846628148.issue26560@psf.upfronthosting.co.za> Message-ID: <1458371196.8.0.971155861558.issue26560@psf.upfronthosting.co.za> Berker Peksag added the comment: Thanks for the patch, Peter! I've simplified the test a bit and commit it. ---------- resolution: -> fixed stage: needs patch -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 19 03:09:18 2016 From: report at bugs.python.org (Raymond Hettinger) Date: Sat, 19 Mar 2016 07:09:18 +0000 Subject: [issue26576] Tweak wording of decorator docos In-Reply-To: <1458196198.66.0.0478952577579.issue26576@psf.upfronthosting.co.za> Message-ID: <1458371358.32.0.664739092652.issue26576@psf.upfronthosting.co.za> Raymond Hettinger added the comment: Elsewhere we use "roughly equivalent to" instead of "broadly equivalent to". The latter seems a little bit off the mark. ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 19 03:04:51 2016 From: report at bugs.python.org (Roundup Robot) Date: Sat, 19 Mar 2016 07:04:51 +0000 Subject: [issue26560] Error in assertion in wsgiref.handlers.BaseHandler.start_response In-Reply-To: <1457979107.59.0.709846628148.issue26560@psf.upfronthosting.co.za> Message-ID: <20160319070448.48780.41186.5936310B@psf.io> Roundup Robot added the comment: New changeset 60f01a8a71ef by Berker Peksag in branch '3.5': Issue #26560: Avoid potential ValueError in BaseHandler.start_response https://hg.python.org/cpython/rev/60f01a8a71ef New changeset ae1d12f09392 by Berker Peksag in branch 'default': Issue #26560: Avoid potential ValueError in BaseHandler.start_response https://hg.python.org/cpython/rev/ae1d12f09392 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 19 03:15:20 2016 From: report at bugs.python.org (Chris Angelico) Date: Sat, 19 Mar 2016 07:15:20 +0000 Subject: [issue26576] Tweak wording of decorator docos In-Reply-To: <1458196198.66.0.0478952577579.issue26576@psf.upfronthosting.co.za> Message-ID: <1458371720.07.0.680068311749.issue26576@psf.upfronthosting.co.za> Chris Angelico added the comment: Sure - changing it to "roughly". I started with that wording, and then changed to "broadly", for reasons which I now can't remember - so they can't have been too important. Consistency wins. ---------- Added file: http://bugs.python.org/file42214/deco-docos.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 19 02:59:23 2016 From: report at bugs.python.org (Larry Hastings) Date: Sat, 19 Mar 2016 06:59:23 +0000 Subject: [issue20186] Derby #18: Convert 31 sites to Argument Clinic across 23 files In-Reply-To: <1389140586.13.0.921060348978.issue20186@psf.upfronthosting.co.za> Message-ID: <1458370763.0.0.452362219368.issue20186@psf.upfronthosting.co.za> Larry Hastings added the comment: > Modules/_opcode.c: Issue 19674 (3.4). Only one function I can see there (Larry?s original post says two sites). I produced the post with a big grep through the codebase. Which was quite a while ago now. Code changes and moves around; if you can only find one site in the current file I believe you. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 19 02:51:10 2016 From: report at bugs.python.org (Larry Hastings) Date: Sat, 19 Mar 2016 06:51:10 +0000 Subject: [issue26556] Update expat to 2.2.1 In-Reply-To: <1457951495.3.0.910401967595.issue26556@psf.upfronthosting.co.za> Message-ID: <1458370270.97.0.877612171495.issue26556@psf.upfronthosting.co.za> Larry Hastings added the comment: Christian: Is that CVE the same crash as reported by mail by Gustavo Grieco? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 19 02:59:19 2016 From: report at bugs.python.org (Martin Panter) Date: Sat, 19 Mar 2016 06:59:19 +0000 Subject: [issue26585] Use html.escape to replace _quote_html in http.server In-Reply-To: <1458271086.94.0.0961534377342.issue26585@psf.upfronthosting.co.za> Message-ID: <1458370759.02.0.304749870769.issue26585@psf.upfronthosting.co.za> Martin Panter added the comment: Yeah I would be happy if you want to change to html.escape(quote=False) in list_directory() as well. BTW I am getting Undelivered Mail replies from the review comments. I guess they might be getting rejected due to looking like spam (they tend to be classified as spam by default for me, something about how the server sends them). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 19 03:48:41 2016 From: report at bugs.python.org (jason crockett) Date: Sat, 19 Mar 2016 07:48:41 +0000 Subject: [issue26591] datetime datetime.time to datetime.time comparison does nothing Message-ID: <1458373720.99.0.780228236927.issue26591@psf.upfronthosting.co.za> New submission from jason crockett: if datetime.time(#blah) > datetime.time(#blah): [a] [b] does nothing.. it doesnt raise an error. it doesnt run the if function even though the printout of variables compared says it should. 22:15:00 [a] 16:00:00 [b] True 22:20:00 16:00:00 True 22:25:00 16:00:00 ---------- components: Extension Modules messages: 262027 nosy: jason crockett priority: normal severity: normal status: open title: datetime datetime.time to datetime.time comparison does nothing versions: Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 19 04:27:52 2016 From: report at bugs.python.org (Martin Panter) Date: Sat, 19 Mar 2016 08:27:52 +0000 Subject: [issue17605] mingw-meta: build interpeter core In-Reply-To: <1364762524.12.0.901415822586.issue17605@psf.upfronthosting.co.za> Message-ID: <1458376072.42.0.955501290511.issue17605@psf.upfronthosting.co.za> Changes by Martin Panter : ---------- dependencies: +mingw: detect REPARSE_DATA_BUFFER _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 19 04:54:32 2016 From: report at bugs.python.org (Martin Panter) Date: Sat, 19 Mar 2016 08:54:32 +0000 Subject: [issue26257] Eliminate buffer_tests.py In-Reply-To: <1454323795.43.0.12298865479.issue26257@psf.upfronthosting.co.za> Message-ID: <1458377672.59.0.669481746471.issue26257@psf.upfronthosting.co.za> Martin Panter added the comment: Yes what you say about re-arranging the methods in string_tests.py makes sense to me. There might also be some factorizing possible between specific methods in test_bytes.py and the (currently) string-only test methods. But I would like to handle these as separate steps, to keep the patch size under control, ensure we don?t lose any important test cases in the process, etc. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 19 05:01:06 2016 From: report at bugs.python.org (Roundup Robot) Date: Sat, 19 Mar 2016 09:01:06 +0000 Subject: [issue26567] ResourceWarning: Use tracemalloc to display the traceback where an object was allocated when a ResourceWarning is emitted In-Reply-To: <1458047716.42.0.114286591066.issue26567@psf.upfronthosting.co.za> Message-ID: <20160319090103.98659.74669.E6B53FBA@psf.io> Roundup Robot added the comment: New changeset 543639cdfdb9 by Victor Stinner in branch 'default': Try again to fix test_warnings on Windows https://hg.python.org/cpython/rev/543639cdfdb9 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 19 05:33:45 2016 From: report at bugs.python.org (Roundup Robot) Date: Sat, 19 Mar 2016 09:33:45 +0000 Subject: [issue26567] ResourceWarning: Use tracemalloc to display the traceback where an object was allocated when a ResourceWarning is emitted In-Reply-To: <1458047716.42.0.114286591066.issue26567@psf.upfronthosting.co.za> Message-ID: <20160319093342.19467.14250.6E563A35@psf.io> Roundup Robot added the comment: New changeset 691fba640266 by Victor Stinner in branch 'default': Issue #26567: enhance ResourceWarning example https://hg.python.org/cpython/rev/691fba640266 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 19 05:38:39 2016 From: report at bugs.python.org (STINNER Victor) Date: Sat, 19 Mar 2016 09:38:39 +0000 Subject: [issue26590] socket destructor: implement finalizer In-Reply-To: <1458351075.41.0.994766438444.issue26590@psf.upfronthosting.co.za> Message-ID: <1458380319.54.0.526630948366.issue26590@psf.upfronthosting.co.za> STINNER Victor added the comment: Attached patch adds a finalizer to _socket.socket() and use PyErr_ResourceWarning() to log the traceback where the socket was created in the warning logger (if tracemalloc is enabled, see issue #26567). ---------- keywords: +patch Added file: http://bugs.python.org/file42215/sock_finalize.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 19 05:39:29 2016 From: report at bugs.python.org (STINNER Victor) Date: Sat, 19 Mar 2016 09:39:29 +0000 Subject: [issue26590] socket destructor: implement finalizer In-Reply-To: <1458351075.41.0.994766438444.issue26590@psf.upfronthosting.co.za> Message-ID: <1458380369.32.0.376739166969.issue26590@psf.upfronthosting.co.za> STINNER Victor added the comment: It's unclear to me if it's needed to call the following code in sock_dealloc(): + if (PyObject_CallFinalizerFromDealloc((PyObject *)s) < 0) + return; It looks like this code is not needed, since sock_finalize() is called before sock_dealloc(). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 19 05:40:07 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 19 Mar 2016 09:40:07 +0000 Subject: [issue26257] Eliminate buffer_tests.py In-Reply-To: <1454323795.43.0.12298865479.issue26257@psf.upfronthosting.co.za> Message-ID: <1458380407.71.0.774518406207.issue26257@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: I meant that the patch can be smaller if move more tests from CommonTest to BaseTest without changing order. Here is smaller patch. ---------- Added file: http://bugs.python.org/file42216/buffer_tests_2.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 19 05:43:04 2016 From: report at bugs.python.org (Roundup Robot) Date: Sat, 19 Mar 2016 09:43:04 +0000 Subject: [issue18787] Misleading error from getspnam function of spwd module In-Reply-To: <1376971981.98.0.467831293927.issue18787@psf.upfronthosting.co.za> Message-ID: <20160319094301.8599.67604.49E71654@psf.io> Roundup Robot added the comment: New changeset a1d738158390 by Berker Peksag in branch 'default': Issue #18787: spwd.getspnam() now raises a PermissionError if the user https://hg.python.org/cpython/rev/a1d738158390 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 19 05:44:42 2016 From: report at bugs.python.org (Berker Peksag) Date: Sat, 19 Mar 2016 09:44:42 +0000 Subject: [issue18787] Misleading error from getspnam function of spwd module In-Reply-To: <1376971981.98.0.467831293927.issue18787@psf.upfronthosting.co.za> Message-ID: <1458380682.29.0.526846138967.issue18787@psf.upfronthosting.co.za> Changes by Berker Peksag : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 19 06:05:05 2016 From: report at bugs.python.org (Antoine Pitrou) Date: Sat, 19 Mar 2016 10:05:05 +0000 Subject: [issue26590] socket destructor: implement finalizer In-Reply-To: <1458351075.41.0.994766438444.issue26590@psf.upfronthosting.co.za> Message-ID: <1458381905.27.0.290915671908.issue26590@psf.upfronthosting.co.za> Antoine Pitrou added the comment: sock_finalize() is only called explicitly if there is a reference cycle. This is why sock_dealloc() has to call it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 19 06:22:58 2016 From: report at bugs.python.org (Tal Einat) Date: Sat, 19 Mar 2016 10:22:58 +0000 Subject: [issue20186] Derby #18: Convert 31 sites to Argument Clinic across 23 files In-Reply-To: <1389140586.13.0.921060348978.issue20186@psf.upfronthosting.co.za> Message-ID: <1458382978.64.0.560059154064.issue20186@psf.upfronthosting.co.za> Tal Einat added the comment: My patches haven't been looked at for a while, anyone considering them should make sure they still apply cleanly and don't break anything. Here their status as far as I can tell: Quite a bit of work went into Modules/_operator.c, and it got an "LGTM" from Serhiy, so it should probably go in after a quick check. Modules/mathmodule.c was also in a good state when I left it, and it underwent some review from Serhiy whose comments were implemented. It should probably be good to go after a thorough review. Objects/enumobject.c is simpler but requires review. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 19 06:38:34 2016 From: report at bugs.python.org (Stefan Behnel) Date: Sat, 19 Mar 2016 10:38:34 +0000 Subject: [issue26331] Tokenizer: allow underscores for grouping in numeric literals In-Reply-To: <1455126624.48.0.163167904941.issue26331@psf.upfronthosting.co.za> Message-ID: <1458383914.19.0.303581669379.issue26331@psf.upfronthosting.co.za> Stefan Behnel added the comment: Nice one. While reimplementing it for Cython, I noticed that the grammar described in the PEP isn't exactly as it's implemented, though. The grammar says digit (["_"] digit)* whereas the latest patch (v4) says `digit` (`digit` | "_")* and also implements it that way. The former doesn't allow underscores at the end of a literal. And the regexes in tokenize.py seem happy to accept "0x___", for example. Is that intended? ---------- nosy: +scoder _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 19 07:15:40 2016 From: report at bugs.python.org (Roundup Robot) Date: Sat, 19 Mar 2016 11:15:40 +0000 Subject: [issue19265] Increased test coverage for datetime pickling In-Reply-To: <1381836280.6.0.648453742391.issue19265@psf.upfronthosting.co.za> Message-ID: <20160319111537.61613.93260.E9F140E6@psf.io> Roundup Robot added the comment: New changeset c6649d4477ab by Berker Peksag in branch '3.5': Issue #19265: Improve test coverage of datetime.tzinfo https://hg.python.org/cpython/rev/c6649d4477ab New changeset f1539e7607e4 by Berker Peksag in branch 'default': Issue #19265: Improve test coverage of datetime.tzinfo https://hg.python.org/cpython/rev/f1539e7607e4 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 19 07:16:23 2016 From: report at bugs.python.org (Berker Peksag) Date: Sat, 19 Mar 2016 11:16:23 +0000 Subject: [issue19265] Increased test coverage for datetime pickling In-Reply-To: <1381836280.6.0.648453742391.issue19265@psf.upfronthosting.co.za> Message-ID: <1458386183.56.0.535010671971.issue19265@psf.upfronthosting.co.za> Berker Peksag added the comment: Thanks for the patch, Colin! ---------- nosy: +berker.peksag resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.5, Python 3.6 -Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 19 07:33:01 2016 From: report at bugs.python.org (Xiang Zhang) Date: Sat, 19 Mar 2016 11:33:01 +0000 Subject: [issue26585] Use html.escape to replace _quote_html in http.server In-Reply-To: <1458271086.94.0.0961534377342.issue26585@psf.upfronthosting.co.za> Message-ID: <1458387181.17.0.104132716421.issue26585@psf.upfronthosting.co.za> Xiang Zhang added the comment: OK. You left the comment preferring using ascii or utf-8 to encode the filename in test. But actually the response SimpeHTTPRequestHandler send is explicitly encoded in filesystemdefaultencoding. So in such a case, am I doing right? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 19 07:40:03 2016 From: report at bugs.python.org (Xiang Zhang) Date: Sat, 19 Mar 2016 11:40:03 +0000 Subject: [issue26585] Use html.escape to replace _quote_html in http.server In-Reply-To: <1458271086.94.0.0961534377342.issue26585@psf.upfronthosting.co.za> Message-ID: <1458387603.02.0.249863384905.issue26585@psf.upfronthosting.co.za> Xiang Zhang added the comment: Oops. You have already left new comment. No notify either. :( I like the idea that extract the actual encoding from response header. I will update my patch then. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 19 08:03:12 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 19 Mar 2016 12:03:12 +0000 Subject: [issue19265] Increased test coverage for datetime pickling In-Reply-To: <1381836280.6.0.648453742391.issue19265@psf.upfronthosting.co.za> Message-ID: <1458388992.23.0.477238876983.issue19265@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: These lines should be removed again after applying the patch for issue26579. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 19 08:04:32 2016 From: report at bugs.python.org (Berker Peksag) Date: Sat, 19 Mar 2016 12:04:32 +0000 Subject: [issue26579] Support pickling slots in subclasses of common classes In-Reply-To: <1458204186.54.0.651323931278.issue26579@psf.upfronthosting.co.za> Message-ID: <1458389072.03.0.717484811787.issue26579@psf.upfronthosting.co.za> Changes by Berker Peksag : ---------- nosy: +berker.peksag _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 19 08:32:11 2016 From: report at bugs.python.org (Georg Brandl) Date: Sat, 19 Mar 2016 12:32:11 +0000 Subject: [issue26331] Tokenizer: allow underscores for grouping in numeric literals In-Reply-To: <1455126624.48.0.163167904941.issue26331@psf.upfronthosting.co.za> Message-ID: <1458390731.72.0.276067827753.issue26331@psf.upfronthosting.co.za> Georg Brandl added the comment: The last patch isn't up to date with the PEP; Serhiy's patch is the closest one. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 19 08:43:37 2016 From: report at bugs.python.org (Nick Coghlan) Date: Sat, 19 Mar 2016 12:43:37 +0000 Subject: [issue25609] Add a ContextManager ABC and type In-Reply-To: <1447355679.68.0.225089426373.issue25609@psf.upfronthosting.co.za> Message-ID: <1458391417.78.0.301046712667.issue25609@psf.upfronthosting.co.za> Nick Coghlan added the comment: * the ABC should have a structural __issubclass__ check looking for __enter__ and __exit__ methods * I agree with making __exit__ abstract (if you don't define it, you don't need a context manager), but does __enter__ need to be abstract? The "return self" default is a good one in many cases where the resource is acquired in __new__ or __init__. * the docs for the ABC are potentially confusing, as they describe what the default implementation does, without making it clear that it's only the default implementation and *permitted* return behaviour is more flexible than that. * I'd prefer not to have contextlib depend on typing, so the generic type definition should probably be in the typing module (similar to the abc-vs-type split for collections). That should also make backporting easier - the ABC can go back via contextlib2, while the generic type can go back via the comment-based typehinting variant ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 19 09:07:01 2016 From: report at bugs.python.org (STINNER Victor) Date: Sat, 19 Mar 2016 13:07:01 +0000 Subject: [issue26590] socket destructor: implement finalizer In-Reply-To: <1458381905.27.0.290915671908.issue26590@psf.upfronthosting.co.za> Message-ID: STINNER Victor added the comment: 2016-03-19 11:05 GMT+01:00 Antoine Pitrou : > sock_finalize() is only called explicitly if there is a reference cycle. This is why sock_dealloc() has to call it. I'm fine with keeping sock_dealloc() to call sock_finalize(), but I would like to understand. Example: --- import socket s=socket.socket() s=None --- With this code, sock_finalize() is called before sock_dealloc(): #0 sock_finalize (s=0x7ffff0730c28) at /home/haypo/prog/python/default/Modules/socketmodule.c:4172 #1 0x00000000004d8f59 in PyObject_CallFinalizer (self=) at Objects/object.c:294 #2 0x00000000004d8fcd in PyObject_CallFinalizerFromDealloc (self=) at Objects/object.c:311 #3 0x00000000004f2c8f in subtype_dealloc (self=) at Objects/typeobject.c:1154 #4 0x00000000004dc8ae in _Py_Dealloc (op=) at Objects/object.c:1783 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 19 09:14:01 2016 From: report at bugs.python.org (STINNER Victor) Date: Sat, 19 Mar 2016 13:14:01 +0000 Subject: [issue26590] socket destructor: implement finalizer In-Reply-To: <1458351075.41.0.994766438444.issue26590@psf.upfronthosting.co.za> Message-ID: <1458393241.38.0.0615974432269.issue26590@psf.upfronthosting.co.za> STINNER Victor added the comment: @Antoine: Since you wrote the PEP 442, would you reviewing sock_finalize.patch? I'm only interested to modify Python 3.6, the bug was only trigerred when I changed the code to log a warning. Before, the socket object was not passed to the warning logger so it worked fine. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 19 09:15:09 2016 From: report at bugs.python.org (Antoine Pitrou) Date: Sat, 19 Mar 2016 13:15:09 +0000 Subject: [issue26590] socket destructor: implement finalizer In-Reply-To: Message-ID: <56ED50DA.5020709@free.fr> Antoine Pitrou added the comment: Le 19/03/2016 14:07, STINNER Victor a ?crit : > > Example: > --- > import socket > s=socket.socket() > s=None > --- > > With this code, sock_finalize() is called before sock_dealloc(): > > #0 sock_finalize (s=0x7ffff0730c28) at > /home/haypo/prog/python/default/Modules/socketmodule.c:4172 > #1 0x00000000004d8f59 in PyObject_CallFinalizer (self= remote 0x7ffff0730c28>) at Objects/object.c:294 > #2 0x00000000004d8fcd in PyObject_CallFinalizerFromDealloc > (self=) at Objects/object.c:311 > #3 0x00000000004f2c8f in subtype_dealloc (self= 0x7ffff0730c28>) at Objects/typeobject.c:1154 Ah, that's probably because socket.socket is a Python subclass. What happens if you use _socket.socket directly instead? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 19 09:18:30 2016 From: report at bugs.python.org (STINNER Victor) Date: Sat, 19 Mar 2016 13:18:30 +0000 Subject: [issue26590] socket destructor: implement finalizer In-Reply-To: <56ED50DA.5020709@free.fr> Message-ID: STINNER Victor added the comment: Antoine Pitrou added the comment: > Ah, that's probably because socket.socket is a Python subclass. > What happens if you use _socket.socket directly instead? Oh, I forgot this sublte implementation detail, _socket.socket base class vs socket.socket sublcass. Example with _socket: --- import _socket s=_socket.socket() s=None --- Ok, in this case sock_finalize() is called by sock_dealloc(). --- #0 sock_finalize (s=0x7ffff7eaad60) at /home/haypo/prog/python/default/Modules/socketmodule.c:4172 #1 0x00000000004d8f59 in PyObject_CallFinalizer (self=<_socket.socket at remote 0x7ffff7eaad60>) at Objects/object.c:294 #2 0x00000000004d8fcd in PyObject_CallFinalizerFromDealloc (self=<_socket.socket at remote 0x7ffff7eaad60>) at Objects/object.c:311 #3 0x00007ffff04e326a in sock_dealloc (s=0x7ffff7eaad60) at /home/haypo/prog/python/default/Modules/socketmodule.c:4192 #4 0x00000000004dc8ae in _Py_Dealloc (op=<_socket.socket at remote 0x7ffff7eaad60>) at Objects/object.c:1783 --- ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 19 09:34:14 2016 From: report at bugs.python.org (STINNER Victor) Date: Sat, 19 Mar 2016 13:34:14 +0000 Subject: [issue26592] _warnings.warn_explicit() should try to import the warnings module Message-ID: <1458394454.81.0.10940568277.issue26592@psf.upfronthosting.co.za> New submission from STINNER Victor: The issue #26567 enhanced the warnings module to pass the destroyed object on ResourceWarning. The implementation to log the traceback where the object was allocated is non trivial, so I chose to only implement it in Python. Problem: _warnings.warn_explicit() is lazy, it tries to get the warnings module from sys.modules, but it uses its own logger if the warnings is not imported yet. As a consequence, the traceback where the object was allocated is only logged if tracemalloc is tracing Python memory allocations *and* if the warnings module is already imported. I suggest to modify _warnings.warn_explicit() to import the warnings if it's not imported yet. There are maybe issues to import a module during Python finalization? A comprise is to not try to import when Python finalization has started. Example: --- #import warnings import tracemalloc tracemalloc.start(10) f = open("/etc/issue") f = None --- Current output: --- x.py:5: ResourceWarning: unclosed file <_io.TextIOWrapper name='/etc/issue' mode='r' encoding='UTF-8'> f = None --- Output if you uncomment the "import warnings": --- x.py:5: ResourceWarning: unclosed file <_io.TextIOWrapper name='/etc/issue' mode='r' encoding='UTF-8'> f = None Object allocated at (most recent call first): File "x.py", lineno 4 f = open("/etc/issue") --- Attached patch tries to import warnings if source object is set but not after the Pythin finalization has started. ---------- files: warnings_import.patch keywords: patch messages: 262049 nosy: haypo priority: normal severity: normal status: open title: _warnings.warn_explicit() should try to import the warnings module type: enhancement versions: Python 3.6 Added file: http://bugs.python.org/file42217/warnings_import.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 19 11:07:20 2016 From: report at bugs.python.org (Stefan Behnel) Date: Sat, 19 Mar 2016 15:07:20 +0000 Subject: [issue26331] Tokenizer: allow underscores for grouping in numeric literals In-Reply-To: <1455126624.48.0.163167904941.issue26331@psf.upfronthosting.co.za> Message-ID: <1458400040.94.0.092776359998.issue26331@psf.upfronthosting.co.za> Stefan Behnel added the comment: Ah, thanks. Here's my implementation then: https://github.com/cython/cython/pull/499/files It seems that tests for valid complex literals are missing. I've added these to the end of the list: '1_00_00.5j', '1_00_00.5e5', '1_00_00j', '1_00_00e5_1', '1e1_0', '.1_4', '.1_4e1', '.1_4j', ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 19 11:26:20 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 19 Mar 2016 15:26:20 +0000 Subject: [issue26581] Double coding cookie In-Reply-To: <1458216036.14.0.237579161127.issue26581@psf.upfronthosting.co.za> Message-ID: <1458401180.24.0.681283568648.issue26581@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: I just tested with Emacs, and it looks that when specify different codings on two different lines, the first coding wins, but when specify different codings on the same line, the last coding wins. Therefore current CPython behavior can be correct, and the regular expression in PEP 263 should be changed to use greedy repetition. ---------- nosy: +lemburg, loewis _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 19 12:12:07 2016 From: report at bugs.python.org (Guido van Rossum) Date: Sat, 19 Mar 2016 16:12:07 +0000 Subject: [issue26581] Double coding cookie In-Reply-To: <1458401180.24.0.681283568648.issue26581@psf.upfronthosting.co.za> Message-ID: Guido van Rossum added the comment: Do you have write permission to the PEP? Just update it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 19 12:37:37 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 19 Mar 2016 16:37:37 +0000 Subject: [issue26581] Double coding cookie In-Reply-To: <1458216036.14.0.237579161127.issue26581@psf.upfronthosting.co.za> Message-ID: <1458405457.27.0.683153036646.issue26581@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Yes, I have. But I were not sure what behavior should be correct in Python. On one side, always choosing the first declaration (on the same or on different lines) looks more consistent. On other side, current behavior was in CPython from the initial implementing PEP 263 in issue526840 and it matches Emacs behavior (if I understand this correctly). I can update the regular expression, but may be this obscure corner case needs the verbal explanation. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 19 12:48:13 2016 From: report at bugs.python.org (Guido van Rossum) Date: Sat, 19 Mar 2016 16:48:13 +0000 Subject: [issue26581] Double coding cookie In-Reply-To: <1458405457.27.0.683153036646.issue26581@psf.upfronthosting.co.za> Message-ID: Guido van Rossum added the comment: Right. Please go ahead with both. I am fine with defining the current behavior correct. --Guido (mobile) On Mar 19, 2016 9:37 AM, "Serhiy Storchaka" wrote: > > Serhiy Storchaka added the comment: > > Yes, I have. But I were not sure what behavior should be correct in > Python. On one side, always choosing the first declaration (on the same or > on different lines) looks more consistent. On other side, current behavior > was in CPython from the initial implementing PEP 263 in issue526840 and it > matches Emacs behavior (if I understand this correctly). > > I can update the regular expression, but may be this obscure corner case > needs the verbal explanation. > > ---------- > > _______________________________________ > Python tracker > > _______________________________________ > ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 19 12:49:44 2016 From: report at bugs.python.org (Julien) Date: Sat, 19 Mar 2016 16:49:44 +0000 Subject: [issue26546] Provide translated french translation on docs.python.org In-Reply-To: <1457794223.79.0.618185263259.issue26546@psf.upfronthosting.co.za> Message-ID: <1458406184.68.0.596355037996.issue26546@psf.upfronthosting.co.za> Julien added the comment: You're right Terry, I posted on python ideas in case someone comes with a good idea, I also explained my vision in a lot of details to gather the widest feedback possible on each point that came to my mind: https://mail.python.org/pipermail/python-ideas/2016-March/038879.html ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 19 13:39:02 2016 From: report at bugs.python.org (Guido van Rossum) Date: Sat, 19 Mar 2016 17:39:02 +0000 Subject: [issue25609] Add a ContextManager ABC and type In-Reply-To: <1447355679.68.0.225089426373.issue25609@psf.upfronthosting.co.za> Message-ID: <1458409142.73.0.751191083001.issue25609@psf.upfronthosting.co.za> Guido van Rossum added the comment: Agreed on all points with Nick. We can add ContextManager (not ContextManagerType) to typing.py in 3.5.2 (it's provisional). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 19 14:13:41 2016 From: report at bugs.python.org (Xiang Zhang) Date: Sat, 19 Mar 2016 18:13:41 +0000 Subject: [issue26585] Use html.escape to replace _quote_html in http.server In-Reply-To: <1458271086.94.0.0961534377342.issue26585@psf.upfronthosting.co.za> Message-ID: <1458411221.93.0.878647063412.issue26585@psf.upfronthosting.co.za> Xiang Zhang added the comment: The uploaded patch is updated. Hope you have time to review. ---------- Added file: http://bugs.python.org/file42218/_quote_html_to_html_escape_v4.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 19 16:26:24 2016 From: report at bugs.python.org (Christian Heimes) Date: Sat, 19 Mar 2016 20:26:24 +0000 Subject: [issue26556] Update expat to 2.2.1 In-Reply-To: <1457951495.3.0.910401967595.issue26556@psf.upfronthosting.co.za> Message-ID: <1458419184.79.0.800390566425.issue26556@psf.upfronthosting.co.za> Christian Heimes added the comment: No, the other problem is CVE-2016-0718. We are still looking into the matter. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 19 19:37:28 2016 From: report at bugs.python.org (Mandeep Singh Grang) Date: Sat, 19 Mar 2016 23:37:28 +0000 Subject: [issue26587] Possible duplicate entries in sys.path if .pth files are used with zip's In-Reply-To: <1458296580.88.0.236395091392.issue26587@psf.upfronthosting.co.za> Message-ID: <1458430648.81.0.56970802193.issue26587@psf.upfronthosting.co.za> Mandeep Singh Grang added the comment: Here is a testcase to reproduce the issue: > cat test.py import site, sys site.addsitedir('/foo/bar') print (sys.path) This prints just a single instance of '/foo/bar': ['/local/mnt/workspace/python/tst', '/foo/bar', '/usr/local/lib/python36.zip', '/local/mnt/workspace/python/src/Lib', '/local/mnt/workspace/python/src/Lib/plat-linux', '/local/mnt/workspace/python/build/build/lib.linux-x86_64-3.6-pydebug'] Now if we explicitly set PYTHONPATH to include '/foo/bar' > export PYTHONPATH=/foo/bar and then run test.py here is the output: ['/local/mnt/workspace/python/tst', '/foo/bar', '/usr/local/lib/python36.zip', '/local/mnt/workspace/python/src/Lib', '/local/mnt/workspace/python/src/Lib/plat-linux', '/local/mnt/workspace/python/build/build/lib.linux-x86_64-3.6-pydebug', '/foo/bar'] We see that there are duplicate entries for '/foo/bar'. As Wolfgang rightly said the issue comes from the check for "if os.path.isdir(dir)" inside _init_pathinfo() in site.py. On removing this check I no longer see the duplicate entry for '/foo/bar'. But since this is the first bug I am looking at I am not sure of the implications of removing this check. Can someone please confirm that what I see is indeed a failing test case, or is this the intended behavior? Thanks, Mandeep ---------- nosy: +Mandeep Singh Grang _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 03:26:33 2016 From: report at bugs.python.org (Andrew Szeto) Date: Sun, 20 Mar 2016 07:26:33 +0000 Subject: [issue26593] silly typo in logging cookbook Message-ID: <1458458793.09.0.189282246745.issue26593@psf.upfronthosting.co.za> New submission from Andrew Szeto: In all versions of https://docs.python.org/3/howto/logging-cookbook.html, there is a very silly typo. It bothered me, and I wanted to get a taste of the patching workflow for contribution to Python, so I figured I'd write a patch. ---------- assignee: docs at python components: Documentation files: doc-logging-cookbook-capitalization.patch keywords: patch messages: 262060 nosy: Andrew Szeto, docs at python priority: normal severity: normal status: open title: silly typo in logging cookbook 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/file42219/doc-logging-cookbook-capitalization.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 03:40:49 2016 From: report at bugs.python.org (Martin Panter) Date: Sun, 20 Mar 2016 07:40:49 +0000 Subject: [issue13501] Make libedit support more generic; port readline / libedit to FreeBSD In-Reply-To: <1322579942.3.0.601983912656.issue13501@psf.upfronthosting.co.za> Message-ID: <1458459649.11.0.796204133461.issue13501@psf.upfronthosting.co.za> Martin Panter added the comment: Quoting Ned: ?The current behavior is: enable building readline with GNU readline if found on the search paths, . . . and, if not found and on OS X, use editline if found on the search paths. Some build scripts depend on that behavior.? Can you point out any logic (e.g. in configure.ac) that handles this? I suspect you might be mistaken. My understanding is that we always include and always link against -lreadline, regardless of platform. My guess is that on OS X, the include file and library are actually pointers to Editline code, rather than Gnu code. This is in contrast to my situation on Arch Linux, where I can install both the Gnu ?readline? and the ?libedit? packages without conflict. Gnu Readline is accessible via and -lreadline, and Editline?s Readline compatibility is accessible via and -ledit. So I suspect there is no special on-OS-X condition to change or remove (if we ignore those #ifdef __APPLE__ bug workarounds for the moment). Maybe I should drop that DEFAULT_LIBREADLINE business from the patch. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 03:50:41 2016 From: report at bugs.python.org (Xiang Zhang) Date: Sun, 20 Mar 2016 07:50:41 +0000 Subject: [issue26585] Use html.escape to replace _quote_html in http.server In-Reply-To: <1458271086.94.0.0961534377342.issue26585@psf.upfronthosting.co.za> Message-ID: <1458460241.73.0.0700255228318.issue26585@psf.upfronthosting.co.za> Xiang Zhang added the comment: Thanks for the reviews. I have updated the patch. ---------- Added file: http://bugs.python.org/file42220/_quote_html_to_html_escape_v5.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 03:52:09 2016 From: report at bugs.python.org (Xiang Zhang) Date: Sun, 20 Mar 2016 07:52:09 +0000 Subject: [issue26586] Simple enhancement to BaseHTTPRequestHandler In-Reply-To: <1458273976.86.0.666454727881.issue26586@psf.upfronthosting.co.za> Message-ID: <1458460329.06.0.24852942508.issue26586@psf.upfronthosting.co.za> Xiang Zhang added the comment: Ping. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 06:07:38 2016 From: report at bugs.python.org (Elena Oat) Date: Sun, 20 Mar 2016 10:07:38 +0000 Subject: [issue26545] os.walk is limited by python's recursion limit In-Reply-To: <1457744340.04.0.931517157669.issue26545@psf.upfronthosting.co.za> Message-ID: <1458468458.25.0.169596565912.issue26545@psf.upfronthosting.co.za> Elena Oat added the comment: I've actually tried to test the recursion limit on my Mac OS X. It seems that I cannot create any subdirectories after around 500 subdir depth. I guess it's related to the allowed path length (<1024 chars?). ---------- nosy: +Elena.Oat _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 06:50:00 2016 From: report at bugs.python.org (Roundup Robot) Date: Sun, 20 Mar 2016 10:50:00 +0000 Subject: [issue26593] silly typo in logging cookbook In-Reply-To: <1458458793.09.0.189282246745.issue26593@psf.upfronthosting.co.za> Message-ID: <20160320104957.13992.65382.615BCF50@psf.io> Roundup Robot added the comment: New changeset 8d41ce2cde18 by Berker Peksag in branch '3.5': Issue #26593: Fix typo in logging HOWTO https://hg.python.org/cpython/rev/8d41ce2cde18 New changeset 8b85df50d906 by Berker Peksag in branch 'default': Issue #26593: Fix typo in logging HOWTO https://hg.python.org/cpython/rev/8b85df50d906 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 06:50:50 2016 From: report at bugs.python.org (Berker Peksag) Date: Sun, 20 Mar 2016 10:50:50 +0000 Subject: [issue26593] silly typo in logging cookbook In-Reply-To: <1458458793.09.0.189282246745.issue26593@psf.upfronthosting.co.za> Message-ID: <1458471050.38.0.859981790928.issue26593@psf.upfronthosting.co.za> Berker Peksag added the comment: Thanks for the patch, Andrew. ---------- nosy: +berker.peksag resolution: -> fixed stage: -> resolved status: open -> closed versions: -Python 2.7, Python 3.2, Python 3.3, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 07:25:42 2016 From: report at bugs.python.org (STINNER Victor) Date: Sun, 20 Mar 2016 11:25:42 +0000 Subject: [issue26567] ResourceWarning: Use tracemalloc to display the traceback where an object was allocated when a ResourceWarning is emitted In-Reply-To: <1458047716.42.0.114286591066.issue26567@psf.upfronthosting.co.za> Message-ID: <1458473142.78.0.477213641139.issue26567@psf.upfronthosting.co.za> STINNER Victor added the comment: Cool, test_warnings, test_logging, etc. pass again on Windows buildbots. I close the issue. As I wrote, I opened a second issue for socket & os.scandir. ---------- resolution: -> fixed status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 07:28:45 2016 From: report at bugs.python.org (Manvi B) Date: Sun, 20 Mar 2016 11:28:45 +0000 Subject: [issue26506] hex() documentation: mention "%x" % int In-Reply-To: <1457372823.56.0.270827849914.issue26506@psf.upfronthosting.co.za> Message-ID: <1458473325.09.0.136595066983.issue26506@psf.upfronthosting.co.za> Manvi B added the comment: Modified documentation for the functions bin(), hex() and oct() as mentioned in the comments. Submitted the patch. ---------- keywords: +patch nosy: +Manvi B Added file: http://bugs.python.org/file42221/issue26506.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 07:32:05 2016 From: report at bugs.python.org (Elena Oat) Date: Sun, 20 Mar 2016 11:32:05 +0000 Subject: [issue19164] Update uuid.UUID TypeError exception: integer should not be an argument. In-Reply-To: <1380885490.13.0.480584034262.issue19164@psf.upfronthosting.co.za> Message-ID: <1458473525.23.0.570072950839.issue19164@psf.upfronthosting.co.za> Elena Oat added the comment: I tested the patch and it seems fine. Also ran tests for uuid.py and it they passed. ---------- nosy: +Elena.Oat _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 07:35:06 2016 From: report at bugs.python.org (Ezio Melotti) Date: Sun, 20 Mar 2016 11:35:06 +0000 Subject: [issue26466] could not build python 2.7.11 on AIX In-Reply-To: <1456844902.77.0.455974310535.issue26466@psf.upfronthosting.co.za> Message-ID: <1458473706.25.0.585475029801.issue26466@psf.upfronthosting.co.za> Changes by Ezio Melotti : ---------- resolution: -> fixed stage: -> resolved type: -> compile error _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 07:53:07 2016 From: report at bugs.python.org (SilentGhost) Date: Sun, 20 Mar 2016 11:53:07 +0000 Subject: [issue26587] Possible duplicate entries in sys.path if .pth files are used with zip's In-Reply-To: <1458296580.88.0.236395091392.issue26587@psf.upfronthosting.co.za> Message-ID: <1458474787.36.0.877813536394.issue26587@psf.upfronthosting.co.za> SilentGhost added the comment: Thanks for this, Mandeep. I don't think it is entirely the same issue that Wolfgang is describing. He's particularly concerned about the clash of .zip files from the sys.path with ones coming from .pth files for example. And while the proposed fix would resolve the issue, I don't feel it would be entirely correct. For the record, I'm not even sure sys.path is guaranteed to be contain no duplicates, at least I wasn't able to find a statement to that effect in the docs. In any case, I'm adding Brett here who was seemingly the last one to touch that bit of code. I'm also attaching a path with what I think is a more appropriate and smaller fix. ---------- keywords: +patch nosy: +brett.cannon stage: test needed -> patch review Added file: http://bugs.python.org/file42222/issue26587.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 08:06:45 2016 From: report at bugs.python.org (Nick Coghlan) Date: Sun, 20 Mar 2016 12:06:45 +0000 Subject: [issue23857] Make default HTTPS certificate verification setting configurable In-Reply-To: <1428057486.92.0.857087998573.issue23857@psf.upfronthosting.co.za> Message-ID: <1458475605.15.0.930314530826.issue23857@psf.upfronthosting.co.za> Nick Coghlan added the comment: As Robert suggested, I tweaked the envvar tests to be more self-explanatory: https_is_verified = """import ssl, sys; \ status = "Error: _create_default_https_context does not verify certs" \ if ssl._create_default_https_context is \ ssl._create_unverified_context \ else None; \ sys.exit(status)""" https_is_not_verified = """import ssl, sys; \ status = "Error: _create_default_https_context verifies certs" \ if ssl._create_default_https_context is \ ssl.create_default_context \ else None; \ sys.exit(status)""" I'm going to check this in as is and mark the PEP as Final. If anyone spots any minor cleanup issues, feel free to comment on them here, otherwise I'd suggest either opening a new issue or reopening this one for any larger concerns. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 08:38:56 2016 From: report at bugs.python.org (Erwin Berkouwer) Date: Sun, 20 Mar 2016 12:38:56 +0000 Subject: [issue26594] Tutorial example IndentationError? Message-ID: <1458477536.83.0.48504738422.issue26594@psf.upfronthosting.co.za> New submission from Erwin Berkouwer: being totally new to Python, I tried actually doing the examples from the beginners guide (real RTFM ;-) however I fail at the first example, with an error message that I don't understand. please clarify. attached file is screenprint from documentation, below what's on my screen (note I keyed in the example, no copy/paste, but I think correctly) Also adding spaces or a tab doesn't get rid of the error. C:\Users\erwin>python 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. >>> the_world_is_flat = True >>> if the_world_is_flat: ... print("be careful not to fall off!") File "", line 2 print("be careful not to fall off!") ^ IndentationError: expected an indented block ---------- assignee: docs at python components: Documentation files: IndentationError.jpg messages: 262072 nosy: Erwin Berkouwer, docs at python priority: normal severity: normal status: open title: Tutorial example IndentationError? versions: Python 3.5 Added file: http://bugs.python.org/file42223/IndentationError.jpg _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 08:39:29 2016 From: report at bugs.python.org (Roundup Robot) Date: Sun, 20 Mar 2016 12:39:29 +0000 Subject: [issue23857] Make default HTTPS certificate verification setting configurable In-Reply-To: <1428057486.92.0.857087998573.issue23857@psf.upfronthosting.co.za> Message-ID: <20160320123926.954.82412.9D15172E@psf.io> Roundup Robot added the comment: New changeset 7a9c9368d79e by Nick Coghlan in branch '2.7': Issue #23857: Implement PEP 493 https://hg.python.org/cpython/rev/7a9c9368d79e ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 08:51:13 2016 From: report at bugs.python.org (Nick Coghlan) Date: Sun, 20 Mar 2016 12:51:13 +0000 Subject: [issue23857] Make default HTTPS certificate verification setting configurable In-Reply-To: <1428057486.92.0.857087998573.issue23857@psf.upfronthosting.co.za> Message-ID: <1458478273.55.0.891332516256.issue23857@psf.upfronthosting.co.za> Changes by Nick Coghlan : ---------- resolution: -> fixed stage: commit review -> resolved status: open -> closed versions: +Python 2.7 -Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 09:24:01 2016 From: report at bugs.python.org (Chi Hsuan Yen) Date: Sun, 20 Mar 2016 13:24:01 +0000 Subject: [issue20305] Android's incomplete locale.h implementation prevents cross-compilation In-Reply-To: <1390155202.76.0.360148898057.issue20305@psf.upfronthosting.co.za> Message-ID: <1458480241.46.0.405073016175.issue20305@psf.upfronthosting.co.za> Chi Hsuan Yen added the comment: Android NDK provides an "android-support" package [1]. There is no documentation other than README in its git repository, I guess it's a 'compatibility layer' between applications targetting a complete C library and Android's BioniC. With my patchset [2], Python builds and runs on my ASUS Zenfone 2 (Android 5.0.2). Patches proposed in this issue are no longer necessary. [1] https://android.googlesource.com/platform/ndk.git/+/master/sources/android/support/ [2] https://github.com/yan12125/python3-android, see commit 82c971a96021e8f8006755b6963ac39f8a5fa412 and 73c2889c19c0bf259021fcc52a3baf5613b1e075 ---------- nosy: +Chi Hsuan Yen _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 09:28:32 2016 From: report at bugs.python.org (Emanuel Barry) Date: Sun, 20 Mar 2016 13:28:32 +0000 Subject: [issue26546] Provide translated french translation on docs.python.org In-Reply-To: <1457794223.79.0.618185263259.issue26546@psf.upfronthosting.co.za> Message-ID: <1458480512.86.0.0214706719274.issue26546@psf.upfronthosting.co.za> Changes by Emanuel Barry : ---------- nosy: +ebarry stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 09:33:55 2016 From: report at bugs.python.org (Stefan Krah) Date: Sun, 20 Mar 2016 13:33:55 +0000 Subject: [issue20305] Android's incomplete locale.h implementation prevents cross-compilation In-Reply-To: <1390155202.76.0.360148898057.issue20305@psf.upfronthosting.co.za> Message-ID: <1458480835.46.0.365084482177.issue20305@psf.upfronthosting.co.za> Stefan Krah added the comment: Thank you, this is excellent! Does that mean that all locale patches are no longer needed? Here is one left (perhaps accidentally): https://github.com/yan12125/python3-android/blob/cpython-hg/mk/ncurses/android-locale-fixes.patch ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 09:46:10 2016 From: report at bugs.python.org (SilentGhost) Date: Sun, 20 Mar 2016 13:46:10 +0000 Subject: [issue26594] Tutorial example IndentationError? In-Reply-To: <1458477536.83.0.48504738422.issue26594@psf.upfronthosting.co.za> Message-ID: <1458481570.56.0.452768562452.issue26594@psf.upfronthosting.co.za> SilentGhost added the comment: Erwin, you could clearly see in the screenshot that the print call is indented, i.e. it starts in the 5th column, under letter "h" of the_world_is_flat. In what you've typed here one can clearly see that "p" of print is under "i" of if (the 1st column) and is therefore not indented. Indentation is an important part of Python syntax. To properly copy this example from documentation into interpreter you could click on button in the top right corner of the code block - it's cut off in your screenshot, but it looks like a python prompt (>>>). ---------- nosy: +SilentGhost resolution: -> not a bug stage: -> resolved status: open -> closed type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 10:14:22 2016 From: report at bugs.python.org (Emin Ghuliev) Date: Sun, 20 Mar 2016 14:14:22 +0000 Subject: [issue26595] Segfault on Pointer operation Message-ID: <1458483262.43.0.687206003965.issue26595@psf.upfronthosting.co.za> New submission from Emin Ghuliev: I'm trying use a pointer on python script but when executing the following code getting error. (Segmentation fault) dmr at debian:~$ python test.py Segmentation fault self.mem = c_char_p(mem) pointer(self.binning())[0] = 0x41414141 output: [----------------------------------registers-----------------------------------] EAX: 0x0 EBX: 0xb7aee000 --> 0x21e4c ECX: 0x1 EDX: 0x41414141 ('AAAA') ESI: 0x41414141 ('AAAA') EDI: 0x41414141 ('AAAA') EBP: 0xb7b0eb3c --> 0xc ('\x0c') ESP: 0xbfffeb74 --> 0x0 EIP: 0xb7dfc4b6 (<__strlen_sse2_bsf+22>: movdqu xmm1,XMMWORD PTR [edi]) EFLAGS: 0x10287 (CARRY PARITY adjust zero SIGN trap INTERRUPT direction overflow) [-------------------------------------code-------------------------------------] 0xb7dfc4ad <__strlen_sse2_bsf+13>: pxor xmm0,xmm0 0xb7dfc4b1 <__strlen_sse2_bsf+17>: cmp ecx,0x30 0xb7dfc4b4 <__strlen_sse2_bsf+20>: ja 0xb7dfc4cd <__strlen_sse2_bsf+45> => 0xb7dfc4b6 <__strlen_sse2_bsf+22>: movdqu xmm1,XMMWORD PTR [edi] 0xb7dfc4ba <__strlen_sse2_bsf+26>: pcmpeqb xmm0,xmm1 0xb7dfc4be <__strlen_sse2_bsf+30>: pmovmskb edx,xmm0 0xb7dfc4c2 <__strlen_sse2_bsf+34>: test edx,edx 0xb7dfc4c4 <__strlen_sse2_bsf+36>: jne 0xb7dfc539 <__strlen_sse2_bsf+153> [------------------------------------stack-------------------------------------] BUG on ctypes module .//source/cfield.c:1328 static PyObject * z_get(void *ptr, unsigned size) { /* XXX What about invalid pointers ??? */ if (*(void **)ptr) { #if defined(MS_WIN32) && !defined(_WIN32_WCE) if (IsBadStringPtrA(*(char **)ptr, -1)) { PyErr_Format(PyExc_ValueError, "invalid string pointer %p", *(char **)ptr); return NULL; } #endif return PyString_FromString(*(char **)ptr); < === passing pointer as argument } else { Py_INCREF(Py_None); return Py_None; } } ./Objects/stringobject.c: PyObject * PyString_FromString(const char *str = this value assigned to 0x41414141 address) { register size_t size; register PyStringObject *op; assert(str != NULL); size = strlen(str); <==== argument address 0x41414141 ---------- files: alloc.py messages: 262077 nosy: Emin Ghuliev priority: normal severity: normal status: open title: Segfault on Pointer operation Added file: http://bugs.python.org/file42224/alloc.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 10:14:26 2016 From: report at bugs.python.org (Wolfgang Langner) Date: Sun, 20 Mar 2016 14:14:26 +0000 Subject: [issue26587] Possible duplicate entries in sys.path if .pth files are used with zip's In-Reply-To: <1458296580.88.0.236395091392.issue26587@psf.upfronthosting.co.za> Message-ID: <1458483266.48.0.927761028298.issue26587@psf.upfronthosting.co.za> Wolfgang Langner added the comment: Extended unit test for the issue and patch for site.py. ---------- Added file: http://bugs.python.org/file42225/site.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 10:18:35 2016 From: report at bugs.python.org (Emin Ghuliev) Date: Sun, 20 Mar 2016 14:18:35 +0000 Subject: [issue26595] Segfault on Pointer operation In-Reply-To: <1458483262.43.0.687206003965.issue26595@psf.upfronthosting.co.za> Message-ID: <1458483515.89.0.455405201187.issue26595@psf.upfronthosting.co.za> Changes by Emin Ghuliev : ---------- components: +ctypes type: -> crash versions: +Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 10:28:34 2016 From: report at bugs.python.org (Emin Ghuliev) Date: Sun, 20 Mar 2016 14:28:34 +0000 Subject: [issue26595] Segfault on Pointer operation In-Reply-To: <1458483262.43.0.687206003965.issue26595@psf.upfronthosting.co.za> Message-ID: <1458484114.0.0.963473724602.issue26595@psf.upfronthosting.co.za> Changes by Emin Ghuliev : ---------- status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 10:46:35 2016 From: report at bugs.python.org (Berker Peksag) Date: Sun, 20 Mar 2016 14:46:35 +0000 Subject: [issue26267] UUID docs should say how to get "standard form" In-Reply-To: <1454438589.41.0.991764109365.issue26267@psf.upfronthosting.co.za> Message-ID: <1458485195.85.0.374939710586.issue26267@psf.upfronthosting.co.za> Changes by Berker Peksag : ---------- keywords: +easy stage: -> needs patch versions: +Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 10:48:15 2016 From: report at bugs.python.org (Roundup Robot) Date: Sun, 20 Mar 2016 14:48:15 +0000 Subject: [issue19164] Update uuid.UUID TypeError exception: integer should not be an argument. In-Reply-To: <1380885490.13.0.480584034262.issue19164@psf.upfronthosting.co.za> Message-ID: <20160320144809.98667.91158.2ED74896@psf.io> Roundup Robot added the comment: New changeset f736aea929c2 by Berker Peksag in branch '3.5': Issue #19164: Improve exception message of uuid.UUID() https://hg.python.org/cpython/rev/f736aea929c2 New changeset e59b799df6e2 by Berker Peksag in branch 'default': Issue #19164: Improve exception message of uuid.UUID() https://hg.python.org/cpython/rev/e59b799df6e2 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 10:48:58 2016 From: report at bugs.python.org (Berker Peksag) Date: Sun, 20 Mar 2016 14:48:58 +0000 Subject: [issue19164] Update uuid.UUID TypeError exception: integer should not be an argument. In-Reply-To: <1380885490.13.0.480584034262.issue19164@psf.upfronthosting.co.za> Message-ID: <1458485338.89.0.734906241088.issue19164@psf.upfronthosting.co.za> Berker Peksag added the comment: Thanks! ---------- nosy: +berker.peksag resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.6 -Python 2.7, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 11:01:58 2016 From: report at bugs.python.org (SilentGhost) Date: Sun, 20 Mar 2016 15:01:58 +0000 Subject: [issue26267] UUID docs should say how to get "standard form" In-Reply-To: <1454438589.41.0.991764109365.issue26267@psf.upfronthosting.co.za> Message-ID: <1458486118.12.0.2674610349.issue26267@psf.upfronthosting.co.za> Changes by SilentGhost : ---------- nosy: -SilentGhost _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 11:24:09 2016 From: report at bugs.python.org (Berker Peksag) Date: Sun, 20 Mar 2016 15:24:09 +0000 Subject: [issue12813] uuid4 is not tested if a uuid4 system routine isn't present In-Reply-To: <1313995301.93.0.316946106703.issue12813@psf.upfronthosting.co.za> Message-ID: <1458487449.52.0.81633184227.issue12813@psf.upfronthosting.co.za> Berker Peksag added the comment: Since 756d040aa8e8, uuid.uuid4() no longer depends on ctypes. I'll remove the 'requires ctypes' condition from test_uuid4. ---------- nosy: +berker.peksag versions: +Python 3.5, Python 3.6 -Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 11:29:09 2016 From: report at bugs.python.org (Roundup Robot) Date: Sun, 20 Mar 2016 15:29:09 +0000 Subject: [issue12813] uuid4 is not tested if a uuid4 system routine isn't present In-Reply-To: <1313995301.93.0.316946106703.issue12813@psf.upfronthosting.co.za> Message-ID: <20160320152905.30607.76848.6887F758@psf.io> Roundup Robot added the comment: New changeset d9301ebef8d8 by Berker Peksag in branch '3.5': Issue #12813: uuid.uuid4() no longer depends on ctypes https://hg.python.org/cpython/rev/d9301ebef8d8 New changeset 462be0479f11 by Berker Peksag in branch 'default': Issue #12813: uuid.uuid4() no longer depends on ctypes https://hg.python.org/cpython/rev/462be0479f11 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 11:29:59 2016 From: report at bugs.python.org (Berker Peksag) Date: Sun, 20 Mar 2016 15:29:59 +0000 Subject: [issue12813] uuid4 is not tested if a uuid4 system routine isn't present In-Reply-To: <1313995301.93.0.316946106703.issue12813@psf.upfronthosting.co.za> Message-ID: <1458487799.21.0.244627163412.issue12813@psf.upfronthosting.co.za> Berker Peksag added the comment: Thanks for the patch, Matt! ---------- resolution: -> fixed stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 13:14:57 2016 From: report at bugs.python.org (STINNER Victor) Date: Sun, 20 Mar 2016 17:14:57 +0000 Subject: [issue26506] hex() documentation: mention "%x" % int In-Reply-To: <1458473325.09.0.136595066983.issue26506@psf.upfronthosting.co.za> Message-ID: STINNER Victor added the comment: You misunderstood the whole purpose of my issue! You must not write hex()[:2] (it's inefficent)! Please remove it from your patch. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 13:23:44 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 20 Mar 2016 17:23:44 +0000 Subject: [issue26506] hex() documentation: mention "%x" % int In-Reply-To: <1457372823.56.0.270827849914.issue26506@psf.upfronthosting.co.za> Message-ID: <1458494624.56.0.389092859118.issue26506@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: The documentation for hex() doesn't look the bests place for examples of using string formatting. I think it is enough to add short references to corresponding formatting codes. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 15:20:39 2016 From: report at bugs.python.org (Roundup Robot) Date: Sun, 20 Mar 2016 19:20:39 +0000 Subject: [issue18048] Merging test_pep263.py and test_coding.py In-Reply-To: <1369387812.98.0.236232283698.issue18048@psf.upfronthosting.co.za> Message-ID: <20160320192035.84276.19589.75CE73AB@psf.io> Roundup Robot added the comment: New changeset 776e9b8bdd96 by Serhiy Storchaka in branch '2.7': Issue #18048: Rename test_pep263.py to test_source_encoding.py. https://hg.python.org/cpython/rev/776e9b8bdd96 New changeset deadfb03dec0 by Serhiy Storchaka in branch '2.7': Issue #18048: Rename test_coding.py to test_source_encoding.py. https://hg.python.org/cpython/rev/deadfb03dec0 New changeset c42d743779bd by Serhiy Storchaka in branch '2.7': Issue #18048: Merge test_pep263.py and test_coding.py into test_source_encoding.py. https://hg.python.org/cpython/rev/c42d743779bd ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 15:39:03 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 20 Mar 2016 19:39:03 +0000 Subject: [issue18048] Merging test_pep263.py and test_coding.py In-Reply-To: <1369387812.98.0.236232283698.issue18048@psf.upfronthosting.co.za> Message-ID: <1458502743.39.0.902133602348.issue18048@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Backported to 2.7 for the sake of easier backporting new tests. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 15:40:26 2016 From: report at bugs.python.org (Chi Hsuan Yen) Date: Sun, 20 Mar 2016 19:40:26 +0000 Subject: [issue20305] Android's incomplete locale.h implementation prevents cross-compilation In-Reply-To: <1390155202.76.0.360148898057.issue20305@psf.upfronthosting.co.za> Message-ID: <1458502826.81.0.694725228691.issue20305@psf.upfronthosting.co.za> Chi Hsuan Yen added the comment: curses was broken and now it's fixed. Yes - Android's locale patch is no longer necessary in _curses either. However, there are runtime errors: shell at ASUS_Z00E_2:/data/local/tmp $ python3.6 -c 'import curses; curses.initscr()' Traceback (most recent call last): File "", line 1, in File "/data/local/tmp/python3/lib/python3.6/curses/__init__.py", line 30, in initscr fd=_sys.__stdout__.fileno()) _curses.error: setupterm: could not find terminfo database ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 17:29:54 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 20 Mar 2016 21:29:54 +0000 Subject: [issue26581] Double coding cookie In-Reply-To: <1458216036.14.0.237579161127.issue26581@psf.upfronthosting.co.za> Message-ID: <1458509394.74.0.195056915973.issue26581@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Ah, I made a mistake! In 2.7 the first coding on the same line wins. And that behavior was from start. Regression was unintentionally introduced in issue18470. Thus *there is* a bug in Python 3. PEP 263 doesn't need more changes, but Python tokenizer and related tools do. Sorry for misleading. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 17:30:28 2016 From: report at bugs.python.org (Roundup Robot) Date: Sun, 20 Mar 2016 21:30:28 +0000 Subject: [issue26581] Double coding cookie In-Reply-To: <1458216036.14.0.237579161127.issue26581@psf.upfronthosting.co.za> Message-ID: <20160320213026.61605.50008.1785D24B@psf.io> Roundup Robot added the comment: New changeset 23a7481eafd4 by Serhiy Storchaka in branch 'default': Issues #25643, #26581: Added new tests for detecting Python source code encoding. https://hg.python.org/cpython/rev/23a7481eafd4 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 17:30:29 2016 From: report at bugs.python.org (Roundup Robot) Date: Sun, 20 Mar 2016 21:30:29 +0000 Subject: [issue25643] Python tokenizer rewriting In-Reply-To: <1447723653.14.0.424824913135.issue25643@psf.upfronthosting.co.za> Message-ID: <20160320213026.61605.64710.C138AFDE@psf.io> Roundup Robot added the comment: New changeset 23a7481eafd4 by Serhiy Storchaka in branch 'default': Issues #25643, #26581: Added new tests for detecting Python source code encoding. https://hg.python.org/cpython/rev/23a7481eafd4 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 17:51:22 2016 From: report at bugs.python.org (Roundup Robot) Date: Sun, 20 Mar 2016 21:51:22 +0000 Subject: [issue26581] Double coding cookie In-Reply-To: <1458216036.14.0.237579161127.issue26581@psf.upfronthosting.co.za> Message-ID: <20160320215119.61613.18793.98CE3AE0@psf.io> Roundup Robot added the comment: New changeset 1c44cea2ea8f by Serhiy Storchaka in branch '3.5': Issue #26581: Use the first coding cookie on a line, not the last one. https://hg.python.org/cpython/rev/1c44cea2ea8f New changeset 8506d127d482 by Serhiy Storchaka in branch '2.7': Issue #26581: Use the first coding cookie on a line, not the last one. https://hg.python.org/cpython/rev/8506d127d482 New changeset e86cd4a872b8 by Serhiy Storchaka in branch 'default': Issue #26581: Use the first coding cookie on a line, not the last one. https://hg.python.org/cpython/rev/e86cd4a872b8 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 17:52:08 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 20 Mar 2016 21:52:08 +0000 Subject: [issue26581] Double coding cookie In-Reply-To: <1458216036.14.0.237579161127.issue26581@psf.upfronthosting.co.za> Message-ID: <1458510728.63.0.837747049869.issue26581@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- assignee: -> serhiy.storchaka resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 19:33:48 2016 From: report at bugs.python.org (Jose) Date: Sun, 20 Mar 2016 23:33:48 +0000 Subject: [issue26596] numpy.all np.all .all Message-ID: <1458516828.41.0.109347994463.issue26596@psf.upfronthosting.co.za> New submission from Jose: the numpy.all function does not work. I created A = np.random.random((10,1)) np.all(A)<1 gives me False, which is wrong! and B = 2 * A np.all(B)<2 gives me True, which is correct! also np.sum(A) < 10, gives me True, which is correct! ---------- components: Macintosh files: Screen Shot 2016-03-20 at 4.33.22 PM.png messages: 262093 nosy: JoseLight, ned.deily, ronaldoussoren priority: normal severity: normal status: open title: numpy.all np.all .all type: behavior versions: Python 2.7 Added file: http://bugs.python.org/file42226/Screen Shot 2016-03-20 at 4.33.22 PM.png _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 20:06:33 2016 From: report at bugs.python.org (Eryk Sun) Date: Mon, 21 Mar 2016 00:06:33 +0000 Subject: [issue26596] numpy.all np.all .all In-Reply-To: <1458516828.41.0.109347994463.issue26596@psf.upfronthosting.co.za> Message-ID: <1458518793.33.0.983716663106.issue26596@psf.upfronthosting.co.za> Eryk Sun added the comment: NumPy is not part of Python's standard library, so this is a 3rd party problem. However, please don't waste the time of the NumPy developers with this. You either haven't read the documentation or have misread it. numpy.all [1] is an AND reduction over the specified dimension or all dimensions of an array. >>> import numpy as np >>> A = np.random.random((10, 1)) >>> np.all(A) True >>> True < 1 False >>> isinstance(True, int) True >>> int(True) 1 The following checks whether all values are less than 1: >>> A < 1 array([[ True], [ True], [ True], [ True], [ True], [ True], [ True], [ True], [ True], [ True]], dtype=bool) >>> np.all(A < 1) True [1]: http://docs.scipy.org/doc/numpy/reference/generated/numpy.all.html ---------- nosy: +eryksun resolution: -> third party stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 20:10:41 2016 From: report at bugs.python.org (Steven D'Aprano) Date: Mon, 21 Mar 2016 00:10:41 +0000 Subject: [issue26596] numpy.all np.all .all In-Reply-To: <1458516828.41.0.109347994463.issue26596@psf.upfronthosting.co.za> Message-ID: <1458519041.31.0.760335270296.issue26596@psf.upfronthosting.co.za> Steven D'Aprano added the comment: This is not a bug, but behaving correctly. You have: py> A = np.random.random((10,1)) py> np.all(A) True py> np.all(A) < 1 # is True less than 1? False which is correct: True is *not* less than 1. But True *is* less than 2: py> True < 2 True py> np.all(2*A) True Also, for future reference, please do not post screen shoots unless you absolutely have to. Screenshots make it impossible to copy the code from your example, and make it difficult for anyone who is visually impaired and using a screen-reader to contribute. Instead, copy and paste the text from your interpreter. Thank you. ---------- nosy: +steven.daprano _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 20:44:32 2016 From: report at bugs.python.org (Steven D'Aprano) Date: Mon, 21 Mar 2016 00:44:32 +0000 Subject: [issue26597] Document how to cite Python Message-ID: <1458521072.31.0.998709728719.issue26597@psf.upfronthosting.co.za> New submission from Steven D'Aprano: Add either a FAQ or a new page under "Meta Information" in the documentation for how to formally cite Python in scientific papers or other academic situations. See thread on Python-Ideas here for justification and further discussion: https://mail.python.org/pipermail/python-ideas/2016-March/038816.html ---------- assignee: docs at python components: Documentation messages: 262096 nosy: docs at python, steven.daprano priority: normal severity: normal status: open title: Document how to cite Python type: enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 21:03:04 2016 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 21 Mar 2016 01:03:04 +0000 Subject: [issue15660] Clarify 0 prefix for width specifier in str.format doc, In-Reply-To: <1345004440.11.0.680139192916.issue15660@psf.upfronthosting.co.za> Message-ID: <1458522184.16.0.19563176827.issue15660@psf.upfronthosting.co.za> Terry J. Reedy added the comment: You example says to left justify '1' >>> format(1, '<2') '1 ' and then pad with '0' instead of ' '. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 21:06:33 2016 From: report at bugs.python.org (Roundup Robot) Date: Mon, 21 Mar 2016 01:06:33 +0000 Subject: [issue15660] Clarify 0 prefix for width specifier in str.format doc, In-Reply-To: <1345004440.11.0.680139192916.issue15660@psf.upfronthosting.co.za> Message-ID: <20160321010630.84260.68763.01F3FE64@psf.io> Roundup Robot added the comment: New changeset de669512df97 by Terry Jan Reedy in branch '2.7': Issue #15660: Further clarify 0 prefix for width specifier in formats. https://hg.python.org/cpython/rev/de669512df97 New changeset 34cbc5d8a173 by Terry Jan Reedy in branch '3.5': Issue #15660: Further clarify 0 prefix for width specifier in formats. https://hg.python.org/cpython/rev/34cbc5d8a173 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 21:06:59 2016 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 21 Mar 2016 01:06:59 +0000 Subject: [issue15660] Clarify 0 prefix for width specifier in str.format doc, In-Reply-To: <1345004440.11.0.680139192916.issue15660@psf.upfronthosting.co.za> Message-ID: <1458522419.08.0.960792814833.issue15660@psf.upfronthosting.co.za> Changes by Terry J. Reedy : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 21:07:57 2016 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 21 Mar 2016 01:07:57 +0000 Subject: [issue26525] Documentation of ord(c) easy to misread In-Reply-To: <1457599892.41.0.987128084347.issue26525@psf.upfronthosting.co.za> Message-ID: <1458522477.77.0.34378646165.issue26525@psf.upfronthosting.co.za> Changes by Terry J. Reedy : ---------- assignee: docs at python -> terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 21:19:16 2016 From: report at bugs.python.org (Roundup Robot) Date: Mon, 21 Mar 2016 01:19:16 +0000 Subject: [issue26525] Documentation of ord(c) easy to misread In-Reply-To: <1457599892.41.0.987128084347.issue26525@psf.upfronthosting.co.za> Message-ID: <20160321011908.30591.81783.40ADA7C9@psf.io> Roundup Robot added the comment: New changeset c7071c9b8c33 by Terry Jan Reedy in branch '3.5': Issue #26525: Change ord example from nu to more easily recognized Euro sign. https://hg.python.org/cpython/rev/c7071c9b8c33 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 21:19:41 2016 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 21 Mar 2016 01:19:41 +0000 Subject: [issue26525] Documentation of ord(c) easy to misread In-Reply-To: <1457599892.41.0.987128084347.issue26525@psf.upfronthosting.co.za> Message-ID: <1458523181.62.0.124708205369.issue26525@psf.upfronthosting.co.za> Changes by Terry J. Reedy : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 22:47:57 2016 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 21 Mar 2016 02:47:57 +0000 Subject: [issue26597] Document how to cite Python In-Reply-To: <1458521072.31.0.998709728719.issue26597@psf.upfronthosting.co.za> Message-ID: <1458528477.98.0.896382458836.issue26597@psf.upfronthosting.co.za> Terry J. Reedy added the comment: Either a new page under 'Meta' or combined with 'Copyright'. For future reference, sys has multiple information constants and functions. Indeed, 'copyright' is an alias for sys.copyright, added by the site module. Sys would, I think, be the best place to put a citation() function, should you propose one. It would then be indexed, but not intrusive on startup. ---------- nosy: +terry.reedy versions: +Python 2.7, Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 01:05:16 2016 From: report at bugs.python.org (Simon) Date: Mon, 21 Mar 2016 05:05:16 +0000 Subject: [issue26598] Embbedable zip does not import modules in (zip)subdirectory Message-ID: <1458536716.69.0.0292011453311.issue26598@psf.upfronthosting.co.za> New submission from Simon: I downloaded the Embeddable zip file from the Python site, (https://www.python.org/downloads/release/python-351/) and rand the code below. When I run the code below certain modules are not imported while others are imported fine. The modules that are not imported seem to be the ones sub-directories within the zip file. (omitted obvious code, error checking and some cleanup) ... int main() { // ... Py_SetProgramName(L"AAAAA"); Py_SetPath(L"path\\to\\python35.zip"); // embeddable from the python site. Py_Initialize(); PyThreadState *mainstate = PyThreadState_Get(); PyInterpreterState* mainInterpreterState = mainstate->interp; PyObject *main_module = PyImport_AddModule("__main__"); PyObject *main_dict = PyModule_GetDict(main_module); PyObject *local_dic = PyDict_New(); const char* s = "import ctypes\n"; PyObject * PyRes = PyRun_String(s, Py_file_input, main_dict, local_dic); PyObject* ex = PyErr_Occurred(); if (NULL != ex) { // didn't work, import error. } } The exact same code above manages to import other modules as long as they are located inside the root of the zip file. modules like json/ctypes and so on are not imported as they are in a sub directory. ---------- messages: 262101 nosy: SimonG, amaury.forgeotdarc, belopolsky, meador.inge, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: Embbedable zip does not import modules in (zip)subdirectory type: behavior versions: Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 02:29:35 2016 From: report at bugs.python.org (Simon) Date: Mon, 21 Mar 2016 06:29:35 +0000 Subject: [issue26598] Embbedable zip does not import modules in (zip)subdirectory In-Reply-To: <1458536716.69.0.0292011453311.issue26598@psf.upfronthosting.co.za> Message-ID: <1458541775.64.0.393260191995.issue26598@psf.upfronthosting.co.za> Changes by Simon : ---------- components: +Interpreter Core, Windows _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 03:41:09 2016 From: report at bugs.python.org (=?utf-8?b?SMawbmcgTmd1eeG7hW4gVmnhu4d0?=) Date: Mon, 21 Mar 2016 07:41:09 +0000 Subject: [issue26599] segfault at 24 error 6 in python Message-ID: <1458546069.08.0.503097736938.issue26599@psf.upfronthosting.co.za> New submission from H?ng Nguy?n Vi?t: I'm running Python 2.7.6-8ubuntu0.2 amd64 on Ubuntu 14.04 with kernel 3.13.0-52-generic and got this segfault errors every time I ran /usr/local/sentry/bin/sentry cleanup from sentry 7.4.1 (https://github.com/getsentry/sentry/tree/7.4.1) [22209647.263243] /usr/local/sent[11702]: segfault at 24 ip 00000000005377c7 sp 00007ffc05c8f930 error 6 in python[400000+2bc000] [22295939.402502] /usr/local/sent[390]: segfault at 24 ip 00000000005377c7 sp 00007ffdd3e66ca0 error 6 in python[400000+2bc000] [22296013.421469] /usr/local/sent[891]: segfault at 24 ip 0000000000558077 sp 00007fffc16e5e50 error 6 in python[400000+2bc000] [22296046.492933] /usr/local/sent[1059]: segfault at 24 ip 00000000005377c7 sp 00007ffc84414130 error 6 in python[400000+2bc000] [22296379.961611] /usr/local/sent[2512]: segfault at 24 ip 00000000005377c7 sp 00007ffca4920410 error 6 in python[400000+2bc000] [22297323.455115] /usr/local/sent[7184]: segfault at 24 ip 00000000005377c7 sp 00007fff61f88d50 error 6 in python[400000+2bc000] [22297362.031536] /usr/local/sent[7377]: segfault at 24 ip 00000000005377c7 sp 00007ffc99085470 error 6 in python[400000+2bc000] [22297587.731566] /usr/local/sent[8287]: segfault at 24 ip 00000000004e265f sp 00007ffd70af3eb0 error 6 in python[400000+2bc000] [22298739.800342] /usr/local/sent[27513]: segfault at 24 ip 00000000005377c7 sp 00007ffcaf9f2050 error 6 in python[400000+2bc000] This happened every time I ran /usr/local/sentry/bin/sentry cleanup from sentry 7.4.1 ---------- components: Interpreter Core messages: 262102 nosy: hvnsweeting priority: normal severity: normal status: open title: segfault at 24 error 6 in python type: crash versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 03:50:31 2016 From: report at bugs.python.org (SilentGhost) Date: Mon, 21 Mar 2016 07:50:31 +0000 Subject: [issue26599] segfault at 24 error 6 in python In-Reply-To: <1458546069.08.0.503097736938.issue26599@psf.upfronthosting.co.za> Message-ID: <1458546631.21.0.276546867301.issue26599@psf.upfronthosting.co.za> SilentGhost added the comment: This very much looks like a sentry problem. I'd suggest reporting it on their bug tracker. ---------- nosy: +SilentGhost resolution: -> third party stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 04:13:06 2016 From: report at bugs.python.org (=?utf-8?q?Stanis=C5=82aw_Skonieczny_=28Uosiu=29?=) Date: Mon, 21 Mar 2016 08:13:06 +0000 Subject: [issue26600] MagickMock __str__ sometimes returns MagickMock instead of str Message-ID: <1458547986.83.0.630762686391.issue26600@psf.upfronthosting.co.za> New submission from Stanis?aw Skonieczny (Uosiu): This bug results in raising TypeError: __str__ returned non-string (type MagicMock) Following program can reproduce it: ``` from threading import Thread from mock.mock import MagicMock def main(): mocks = [MagicMock() for _ in range(1000)] def in_thread(): for m in mocks: str(m) threads = [Thread(target=in_thread) for _ in range(10)] for thread in threads: thread.start() for thread in threads: thread.join() if __name__ == '__main__': main() ``` For me it rasies few times: ``` Exception in thread Thread-6: Traceback (most recent call last): File "/usr/local/lib/python3.5/threading.py", line 923, in _bootstrap_inner self.run() File "/usr/local/lib/python3.5/threading.py", line 871, in run self._target(*self._args, **self._kwargs) File "../misc/magic_mock_str_bug.py", line 11, in in_thread str(m) TypeError: __str__ returned non-string (type MagicMock) ``` ---------- components: Library (Lib) messages: 262104 nosy: Stanis?aw Skonieczny (Uosiu) priority: normal severity: normal status: open title: MagickMock __str__ sometimes returns MagickMock instead of str type: behavior versions: Python 2.7, Python 3.2, Python 3.3, Python 3.4, Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 04:33:19 2016 From: report at bugs.python.org (Matt Pr) Date: Mon, 21 Mar 2016 08:33:19 +0000 Subject: [issue11874] argparse assertion failure with brackets in metavars In-Reply-To: <1303201252.58.0.236363581255.issue11874@psf.upfronthosting.co.za> Message-ID: <1458549199.89.0.825783841759.issue11874@psf.upfronthosting.co.za> Matt Pr added the comment: Same AssertionError is also caused by having certain "choices". Python 2.7.10 global_options.add_argument('--field-sep', choices=[',',';','|','\t'], required=True, help='Field separator that separates columns in a row.') Removing required=True or removing the tab (\t) from the options both work around this usage formatter issue for me. I know this is an old issue but figured I would add another repro case to help whoever might work on this. ---------- nosy: +mattpr _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 04:33:31 2016 From: report at bugs.python.org (Manvi B) Date: Mon, 21 Mar 2016 08:33:31 +0000 Subject: [issue26506] hex() documentation: mention "%x" % int In-Reply-To: <1457372823.56.0.270827849914.issue26506@psf.upfronthosting.co.za> Message-ID: <1458549211.83.0.947169567432.issue26506@psf.upfronthosting.co.za> Manvi B added the comment: Removed hex()[:2] from the patch. ---------- Added file: http://bugs.python.org/file42227/issue26506.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 04:42:38 2016 From: report at bugs.python.org (Manvi B) Date: Mon, 21 Mar 2016 08:42:38 +0000 Subject: [issue26506] hex() documentation: mention "%x" % int In-Reply-To: <1457372823.56.0.270827849914.issue26506@psf.upfronthosting.co.za> Message-ID: <1458549758.39.0.693673856036.issue26506@psf.upfronthosting.co.za> Manvi B added the comment: Modified the patch with '%x' % value. ---------- Added file: http://bugs.python.org/file42228/issue26506.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 05:00:55 2016 From: report at bugs.python.org (STINNER Victor) Date: Mon, 21 Mar 2016 09:00:55 +0000 Subject: [issue26506] hex() documentation: mention "%x" % int In-Reply-To: <1457372823.56.0.270827849914.issue26506@psf.upfronthosting.co.za> Message-ID: <1458550855.3.0.364320158397.issue26506@psf.upfronthosting.co.za> STINNER Victor added the comment: Serhiy Storchaka: > The documentation for hex() doesn't look the bests place for examples of using string formatting. I think it is enough to add short references to corresponding formatting codes. I like Manvi B's patch with many examples. It's hard to read formatting strings, it's hard to compute the result, so full examples are just more obvious. I don't think that it hurts to add many formatting examples. I expect that most users will combine the result of bin/hex/oct with another string, so suggesting using formatting functions will probably help them to simplify the code. For example, print("x=", hex(x), "y=", hex(y)) can be written: print("x=%#x y=%#x" % (x, y)) or print("x={:#x} y={:#x}".format(x, y)) or print(f"x={x:#x} y={y:#x}") The first expression using hex() adds spaces after "=", but well, it's just to give a simple example. IMHO formatting strings are more readable. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 05:02:17 2016 From: report at bugs.python.org (Ezio Melotti) Date: Mon, 21 Mar 2016 09:02:17 +0000 Subject: [issue26506] hex() documentation: mention "%x" % int In-Reply-To: <1457372823.56.0.270827849914.issue26506@psf.upfronthosting.co.za> Message-ID: <1458550937.63.0.494399019322.issue26506@psf.upfronthosting.co.za> Ezio Melotti added the comment: > The documentation for hex() doesn't look the bests place for examples > of using string formatting. I think it is enough to add short > references to corresponding formatting codes. I think those examples take too much space compared to the actual docs of the functions. I can think of 3 possible solutions: 1) keep the examples but condense them so that they don't take so much space: >>> n = 255 >>> f'{n:#x}', format(n, '#x'), '%#x' % n ('0xff', '0xff', '0xff') >>> f'{n:x}', format(n, 'x'), '%x' % n ('ff', 'ff', 'ff') >>> f'{n:X}', format(n, 'X'), '%X' % n ('FF', 'FF', 'FF') or >>> '%#x' % 255, '%x' % 255, '%X' % 255 ('0xff', 'ff', 'FF') >>> format(255, '#x'), format(255, 'x'), format(255, 'X') ('0xff', 'ff', 'FF') >>> f'{255:#x}', f'{255:x}', f'{255:X}' ('0xff', 'ff', 'FF') (the latter should only go in 3.6 though) 2) add a direct link to https://docs.python.org/3/library/string.html#format-examples where there are already some examples (more can be added if needed); 3) add a single footnote for all 3 functions that includes examples using old/new string formatting and f-strings, mentions the fact that # can be used to omit the prefix and the fact that b/o/x and B/O/X can be used for lowercase and uppercase output. FWIW I don't think that performances matter too much in this case, but I also dislike hex(value)[2:] and agree it should not be mentioned. ---------- nosy: +ezio.melotti _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 05:23:57 2016 From: report at bugs.python.org (STINNER Victor) Date: Mon, 21 Mar 2016 09:23:57 +0000 Subject: [issue26506] hex() documentation: mention "%x" % int In-Reply-To: <1457372823.56.0.270827849914.issue26506@psf.upfronthosting.co.za> Message-ID: <1458552237.36.0.764739770991.issue26506@psf.upfronthosting.co.za> STINNER Victor added the comment: Ezio Melotti added the comment: > I can think of 3 possible solutions: > > 1) keep the examples but condense them so that they don't take so much space: >>>> n = 255 >>>> f'{n:#x}', format(n, '#x'), '%#x' % n > ('0xff', '0xff', '0xff') >>>> f'{n:x}', format(n, 'x'), '%x' % n > ('ff', 'ff', 'ff') >>>> f'{n:X}', format(n, 'X'), '%X' % n > ('FF', 'FF', 'FF') Hum. It's not easy to read these complex formatting strings when they are written like that. > or > >>>> '%#x' % 255, '%x' % 255, '%X' % 255 > ('0xff', 'ff', 'FF') >>>> format(255, '#x'), format(255, 'x'), format(255, 'X') > ('0xff', 'ff', 'FF') >>>> f'{255:#x}', f'{255:x}', f'{255:X}' > ('0xff', 'ff', 'FF') I really prefer when the same kind of the formating strings are written on the same line. I really like this example. Short, obvious, easy to read. I have a prefererence for an example using a variable name rather than a number literal. It's more common to manipulate variables than number literals. If you use a variable, please use a variable name longer than "n" to get more readable example. Otherwise, it's not obvious what is in the variable name in "{n:x}": is "n" the variable? is "x" the variable? In short, I suggest this example: >>> value = 255 >>> '%#x' % value, '%x' % value, '%X' % value ('0xff', 'ff', 'FF') >>> format(value, '#x'), format(value, 'x'), format(value, 'X') ('0xff', 'ff', 'FF') >>> f'{value:#x}', f'{value:x}', f'{value:X}' ('0xff', 'ff', 'FF') Note: Ezio, do you prefer format(value, 'x) for '{:x}'.format(value)? > 2) add a direct link to https://docs.python.org/3/library/string.html#format-examples where there are already some examples (more can be added if needed); IMHO it's ok to add formatting examples to bin/hex/oct. Using your compact example, it's not going to make the doc too long. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 05:39:25 2016 From: report at bugs.python.org (STINNER Victor) Date: Mon, 21 Mar 2016 09:39:25 +0000 Subject: [issue26574] replace_interleave can be optimized for single character byte strings In-Reply-To: <1458170890.63.0.147886169107.issue26574@psf.upfronthosting.co.za> Message-ID: <1458553165.77.0.18897003328.issue26574@psf.upfronthosting.co.za> STINNER Victor added the comment: I wrote a microbenchmark with my benchmark.py tool. The patch always make bytes.replace(b'', char) and bytearray.replace(b'', char) faster even for strings of 10 bytes, the speedup on string of 1000 bytes or more is very interesting, even I never used this Python instruction :-) -------------+-------------+--------------- type bytes | orig | patch -------------+-------------+--------------- length=10 | 250 ns (*) | 211 ns (-15%) length=10**3 | 4.67 us (*) | 1.07 us (-77%) length=10**5 | 441 us (*) | 78.2 us (-82%) -------------+-------------+--------------- Total | 446 us (*) | 79.5 us (-82%) -------------+-------------+--------------- ---------------+-------------+--------------- type bytearray | orig | patch ---------------+-------------+--------------- length=10 | 266 ns (*) | 224 ns (-16%) length=10**3 | 4.67 us (*) | 1.08 us (-77%) length=10**5 | 441 us (*) | 78.3 us (-82%) ---------------+-------------+--------------- Total | 446 us (*) | 79.6 us (-82%) ---------------+-------------+--------------- ---------------+------------+--------------- Summary | orig | patch ---------------+------------+--------------- type bytes | 446 us (*) | 79.5 us (-82%) type bytearray | 446 us (*) | 79.6 us (-82%) ---------------+------------+--------------- Total | 892 us (*) | 159 us (-82%) ---------------+------------+--------------- ---------- Added file: http://bugs.python.org/file42229/bench.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 05:39:52 2016 From: report at bugs.python.org (Roundup Robot) Date: Mon, 21 Mar 2016 09:39:52 +0000 Subject: [issue26574] replace_interleave can be optimized for single character byte strings In-Reply-To: <1458170890.63.0.147886169107.issue26574@psf.upfronthosting.co.za> Message-ID: <20160321093949.61619.31041.DC0A5BDD@psf.io> Roundup Robot added the comment: New changeset 62e3b7af0697 by Victor Stinner in branch 'default': Optimize bytes.replace(b'', b'.') https://hg.python.org/cpython/rev/62e3b7af0697 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 05:40:19 2016 From: report at bugs.python.org (STINNER Victor) Date: Mon, 21 Mar 2016 09:40:19 +0000 Subject: [issue26574] replace_interleave can be optimized for single character byte strings In-Reply-To: <1458170890.63.0.147886169107.issue26574@psf.upfronthosting.co.za> Message-ID: <1458553219.29.0.108152135091.issue26574@psf.upfronthosting.co.za> STINNER Victor added the comment: I pushed my latest patches, thanks for your contribution Josh. ---------- resolution: -> fixed status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 06:32:03 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 21 Mar 2016 10:32:03 +0000 Subject: [issue26574] replace_interleave can be optimized for single character byte strings In-Reply-To: <1458170890.63.0.147886169107.issue26574@psf.upfronthosting.co.za> Message-ID: <1458556323.86.0.527698038508.issue26574@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Is it worth to optimize this pretty rare special case? ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 06:39:44 2016 From: report at bugs.python.org (STINNER Victor) Date: Mon, 21 Mar 2016 10:39:44 +0000 Subject: [issue26574] replace_interleave can be optimized for single character byte strings In-Reply-To: <1458170890.63.0.147886169107.issue26574@psf.upfronthosting.co.za> Message-ID: <1458556784.01.0.797520990643.issue26574@psf.upfronthosting.co.za> STINNER Victor added the comment: > Is it worth to optimize this pretty rare special case? There was a TODO in the code, so I guess that the author wanted to write specialized code for 1-char replacement. Since the patch is short (adds 8 lines of C code), I consider that it's ok to optimize it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 06:40:34 2016 From: report at bugs.python.org (Antoine Pitrou) Date: Mon, 21 Mar 2016 10:40:34 +0000 Subject: [issue26590] socket destructor: implement finalizer In-Reply-To: <1458351075.41.0.994766438444.issue26590@psf.upfronthosting.co.za> Message-ID: <1458556834.81.0.825164804587.issue26590@psf.upfronthosting.co.za> Antoine Pitrou added the comment: Now that there is a safe finalizer, I wonder if it should release the GIL, as in sock_close(). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 06:45:23 2016 From: report at bugs.python.org (SilentGhost) Date: Mon, 21 Mar 2016 10:45:23 +0000 Subject: [issue26600] MagickMock __str__ sometimes returns MagickMock instead of str In-Reply-To: <1458547986.83.0.630762686391.issue26600@psf.upfronthosting.co.za> Message-ID: <1458557123.46.0.182997111763.issue26600@psf.upfronthosting.co.za> Changes by SilentGhost : ---------- nosy: +michael.foord, pitrou versions: +Python 3.6 -Python 3.2, Python 3.3, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 06:47:07 2016 From: report at bugs.python.org (Charalampos Stratakis) Date: Mon, 21 Mar 2016 10:47:07 +0000 Subject: [issue17167] python man page contains $Date$ in page footer In-Reply-To: <1360400635.24.0.00924107320182.issue17167@psf.upfronthosting.co.za> Message-ID: <1458557227.99.0.503568826148.issue17167@psf.upfronthosting.co.za> Changes by Charalampos Stratakis : ---------- versions: +Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 06:51:54 2016 From: report at bugs.python.org (Marcos Dione) Date: Mon, 21 Mar 2016 10:51:54 +0000 Subject: [issue26601] Use new madvise()'s MADV_FREE on the private heap Message-ID: <1458557514.95.0.774301964914.issue26601@psf.upfronthosting.co.za> New submission from Marcos Dione: Linux kernel's new madvise() MADV_FREE[1] could be used in the memory allocator to signal unused parts of the private heap as such, allowing the kernel use those pages for resolving lowmem pressure situations. From a LWN article[2]: [...] Rather than reclaiming the pages immediately, this operation marks them for "lazy freeing" at some future point. Should the kernel run low on memory, these pages will be among the first reclaimed for other uses; should the application try to use such a page after it has been reclaimed, the kernel will give it a new, zero-filled page. But if memory is not tight, pages marked with MADV_FREE will remain in place; a future access to those pages will clear the "lazy free" bit and use the memory that was there before the MADV_FREE call. [...] MADV_FREE appears to be aimed at user-space memory allocator implementations. When an application frees a set of pages, the allocator will use an MADV_FREE call to tell the kernel that the contents of those pages no longer matter. Should the application quickly allocate more memory in the same address range, it will use the same pages, thus avoiding much of the overhead of freeing the old pages and allocating and zeroing the new ones. In short, MADV_FREE is meant as a way to say "I don't care about the data in this address range, but I may reuse the address range itself in the near future." Also note that this feature already exists in BSD kernels. -- [1] http://kernelnewbies.org/Linux_4.5#head-42578a3e087d5bcc2940954a38ce794fe2cd642c [2] https://lwn.net/Articles/590991/ ---------- components: Interpreter Core messages: 262117 nosy: StyXman priority: normal severity: normal status: open title: Use new madvise()'s MADV_FREE on the private heap type: enhancement versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 06:53:20 2016 From: report at bugs.python.org (STINNER Victor) Date: Mon, 21 Mar 2016 10:53:20 +0000 Subject: [issue26590] socket destructor: implement finalizer In-Reply-To: <1458351075.41.0.994766438444.issue26590@psf.upfronthosting.co.za> Message-ID: <1458557600.47.0.721121273107.issue26590@psf.upfronthosting.co.za> STINNER Victor added the comment: > Now that there is a safe finalizer, I wonder if it should release the GIL, as in sock_close(). Ah yes, good idea. I updated my patch. I also changed the change to begin by setting the sock_fd attribute to -1, before closing the socket (since the GIL is now released, the order matters). ---------- Added file: http://bugs.python.org/file42230/sock_finalize-2.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 07:07:42 2016 From: report at bugs.python.org (SilentGhost) Date: Mon, 21 Mar 2016 11:07:42 +0000 Subject: [issue26601] Use new madvise()'s MADV_FREE on the private heap In-Reply-To: <1458557514.95.0.774301964914.issue26601@psf.upfronthosting.co.za> Message-ID: <1458558462.05.0.0829987811035.issue26601@psf.upfronthosting.co.za> Changes by SilentGhost : ---------- nosy: +haypo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 07:11:35 2016 From: report at bugs.python.org (Ezio Melotti) Date: Mon, 21 Mar 2016 11:11:35 +0000 Subject: [issue26506] hex() documentation: mention "%x" % int In-Reply-To: <1457372823.56.0.270827849914.issue26506@psf.upfronthosting.co.za> Message-ID: <1458558695.04.0.919398840856.issue26506@psf.upfronthosting.co.za> Ezio Melotti added the comment: > Note: Ezio, do you prefer format(value, 'x') for '{:x}'.format(value)? While formatting a single value the former is better/shorter, but the latter is perhaps more common since you usually have something else in the string too. The latter can also be used to do something like: >>> '{num:x} {num:X} {num:#x} {num:#X}'.format(num=255) 'ff FF 0xff 0XFF' ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 07:49:36 2016 From: report at bugs.python.org (Antoine Pitrou) Date: Mon, 21 Mar 2016 11:49:36 +0000 Subject: [issue26601] Use new madvise()'s MADV_FREE on the private heap In-Reply-To: <1458557514.95.0.774301964914.issue26601@psf.upfronthosting.co.za> Message-ID: <1458560976.19.0.459154682667.issue26601@psf.upfronthosting.co.za> Changes by Antoine Pitrou : ---------- nosy: +neologix _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 08:05:15 2016 From: report at bugs.python.org (STINNER Victor) Date: Mon, 21 Mar 2016 12:05:15 +0000 Subject: [issue26601] Use new madvise()'s MADV_FREE on the private heap In-Reply-To: <1458560976.22.0.16463622607.issue26601@psf.upfronthosting.co.za> Message-ID: STINNER Victor added the comment: Are you aware of unused memory in the heap memory? The pymalloc memory allocator uses munmap() to release a wgole arena as soon as the last memory block of an arena is freed. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 08:11:34 2016 From: report at bugs.python.org (Daniel Stone) Date: Mon, 21 Mar 2016 12:11:34 +0000 Subject: [issue26602] argparse doc introduction is inappropriately targeted Message-ID: <1458562294.77.0.347454712136.issue26602@psf.upfronthosting.co.za> New submission from Daniel Stone: The argparse documentation starts off, after a couple of sentences, by spending several paragraphs (and a couple of sentences) explaining this gem: import argparse parser = argparse.ArgumentParser(description='Process some integers.') parser.add_argument('integers', metavar='N', type=int, nargs='+', help='an integer for the accumulator') parser.add_argument('--sum', dest='accumulate', action='store_const', const=sum, default=max, help='sum the integers (default: find the max)') args = parser.parse_args() print(args.accumulate(args.integers)) While it is undoubtedly impressive, that a sidebar had to be inserted suggesting people in fact refer to other documentation, suggests it may be inappropriate. As an introduction, it is not particularly approachable (especially if you don't catch the nuance of assigning functions to accumulate), and is probably not going to serve the immediate needs of a lot of the audience: the people who click on the first hit for 'python argparse'. I would suggest relegating this example elsewhere in the documentation, with a much more straightforward/realistic example to lead the documentation. ---------- assignee: docs at python components: Documentation messages: 262121 nosy: Daniel Stone, docs at python priority: normal severity: normal status: open title: argparse doc introduction is inappropriately targeted _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 08:42:53 2016 From: report at bugs.python.org (SilentGhost) Date: Mon, 21 Mar 2016 12:42:53 +0000 Subject: [issue26591] datetime datetime.time to datetime.time comparison does nothing In-Reply-To: <1458373720.99.0.780228236927.issue26591@psf.upfronthosting.co.za> Message-ID: <1458564173.47.0.281121763339.issue26591@psf.upfronthosting.co.za> SilentGhost added the comment: Jason, could you provide an actual paste of interactive interpreter session, so that any one could try to reproduce the issue. ---------- nosy: +SilentGhost stage: -> test needed type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 08:53:42 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 21 Mar 2016 12:53:42 +0000 Subject: [issue26590] socket destructor: implement finalizer In-Reply-To: <1458351075.41.0.994766438444.issue26590@psf.upfronthosting.co.za> Message-ID: <1458564822.23.0.426519110908.issue26590@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 09:01:28 2016 From: report at bugs.python.org (Charalampos Stratakis) Date: Mon, 21 Mar 2016 13:01:28 +0000 Subject: [issue17167] python man page contains $Date$ in page footer In-Reply-To: <1360400635.24.0.00924107320182.issue17167@psf.upfronthosting.co.za> Message-ID: <1458565288.07.0.740953273842.issue17167@psf.upfronthosting.co.za> Charalampos Stratakis added the comment: What do you think about just removing the keyword? ---------- keywords: +patch nosy: +cstratak Added file: http://bugs.python.org/file42231/issue17167.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 09:26:51 2016 From: report at bugs.python.org (STINNER Victor) Date: Mon, 21 Mar 2016 13:26:51 +0000 Subject: [issue26590] socket destructor: implement finalizer In-Reply-To: <1458351075.41.0.994766438444.issue26590@psf.upfronthosting.co.za> Message-ID: <1458566811.77.0.320930509727.issue26590@psf.upfronthosting.co.za> STINNER Victor added the comment: On the review, Antoine wrote: "You should put this line earlier, as outputting a warning can release the GIL..." I disagree. It's a deliberate choice to keep the socket open while logging the ResourceWarning. Example: --- import socket import warnings def show(msg): s = msg.source #s.close() if s.fileno() >= 0: print("socket open") else: print("socket closed") try: name = s.getsockname() except Exception as exc: name = str(exc) print("getsockname(): %r" % (name,)) warnings._showwarnmsg = show s = socket.socket() s = None --- Output with sock_finalize-2.patch: --- socket open getsockname(): ('0.0.0.0', 0) --- If you uncomment the s.close() (or set sock_fd to -1 in the C code): --- socket closed getsockname(): '[Errno 9] Bad file descriptor' --- IMHO it's ok to give access to socket methods in the warning logger. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 09:40:50 2016 From: report at bugs.python.org (STINNER Victor) Date: Mon, 21 Mar 2016 13:40:50 +0000 Subject: [issue26588] _tracemalloc: add support for multiple address spaces (domains) In-Reply-To: <1458337167.06.0.908004959718.issue26588@psf.upfronthosting.co.za> Message-ID: <1458567650.04.0.651196047581.issue26588@psf.upfronthosting.co.za> STINNER Victor added the comment: Crap. I pushed tracemalloc-3.patch by mistake. I just reverted my mistake. At least, it helped to find first bugs using buildbots: http://buildbot.python.org/all/builders/PPC64%20Fedora%203.x/builds/676/steps/test/logs/stdio [230/400/3] test_tracemalloc python: ./Modules/_tracemalloc.c:195: set_reentrant: Assertion `PyThread_get_key_value(tracemalloc_reentrant_key) == ((PyObject *) &_Py_TrueStruct)' failed. Fatal Python error: Aborted Current thread 0x00003fffb0a95a10 (most recent call first): File "/home/shager/cpython-buildarea/3.x.edelsohn-fedora-ppc64/build/Lib/test/test_tracemalloc.py", line 85 in setUp File "/home/shager/cpython-buildarea/3.x.edelsohn-fedora-ppc64/build/Lib/unittest/case.py", line 596 in run ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 09:41:28 2016 From: report at bugs.python.org (Antoine Pitrou) Date: Mon, 21 Mar 2016 13:41:28 +0000 Subject: [issue26590] socket destructor: implement finalizer In-Reply-To: <1458351075.41.0.994766438444.issue26590@psf.upfronthosting.co.za> Message-ID: <1458567688.33.0.649070812186.issue26590@psf.upfronthosting.co.za> Antoine Pitrou added the comment: Oh, I see. Perhaps add a comment then? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 10:01:13 2016 From: report at bugs.python.org (STINNER Victor) Date: Mon, 21 Mar 2016 14:01:13 +0000 Subject: [issue26588] _tracemalloc: add support for multiple address spaces (domains) In-Reply-To: <1458337167.06.0.908004959718.issue26588@psf.upfronthosting.co.za> Message-ID: <1458568873.84.0.462021106675.issue26588@psf.upfronthosting.co.za> STINNER Victor added the comment: Updated patch taking Antoine's comments in account. Instead of filling pointer_t padding with zeros, I changed the size of the key (key_size) in the hashtable to exclude padding. ---------- Added file: http://bugs.python.org/file42232/tracemalloc-4.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 10:05:55 2016 From: report at bugs.python.org (STINNER Victor) Date: Mon, 21 Mar 2016 14:05:55 +0000 Subject: [issue26590] socket destructor: implement finalizer In-Reply-To: <1458351075.41.0.994766438444.issue26590@psf.upfronthosting.co.za> Message-ID: <1458569155.19.0.125957025516.issue26590@psf.upfronthosting.co.za> STINNER Victor added the comment: > Oh, I see. Perhaps add a comment then? Sure, done. Does it look better now? ---------- Added file: http://bugs.python.org/file42233/sock_finalize-3.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 10:07:15 2016 From: report at bugs.python.org (Berker Peksag) Date: Mon, 21 Mar 2016 14:07:15 +0000 Subject: [issue24459] Mention PYTHONFAULTHANDLER in the man page In-Reply-To: <1434487895.85.0.561507121326.issue24459@psf.upfronthosting.co.za> Message-ID: <1458569235.41.0.122481937932.issue24459@psf.upfronthosting.co.za> Changes by Berker Peksag : ---------- keywords: +easy stage: -> needs patch type: -> enhancement versions: +Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 10:45:06 2016 From: report at bugs.python.org (Antoine Pitrou) Date: Mon, 21 Mar 2016 14:45:06 +0000 Subject: [issue26588] _tracemalloc: add support for multiple address spaces (domains) In-Reply-To: <1458337167.06.0.908004959718.issue26588@psf.upfronthosting.co.za> Message-ID: <1458571506.03.0.743880834889.issue26588@psf.upfronthosting.co.za> Antoine Pitrou added the comment: > Instead of filling pointer_t padding with zeros, I changed the size of the key (key_size) in the hashtable to exclude padding. What about alignment issues on strict platforms? (SPARC?) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 10:46:46 2016 From: report at bugs.python.org (Antoine Pitrou) Date: Mon, 21 Mar 2016 14:46:46 +0000 Subject: [issue26590] socket destructor: implement finalizer In-Reply-To: <1458351075.41.0.994766438444.issue26590@psf.upfronthosting.co.za> Message-ID: <1458571606.88.0.488245075577.issue26590@psf.upfronthosting.co.za> Antoine Pitrou added the comment: Yes, it looks good to me. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 10:54:52 2016 From: report at bugs.python.org (STINNER Victor) Date: Mon, 21 Mar 2016 14:54:52 +0000 Subject: [issue26588] _tracemalloc: add support for multiple address spaces (domains) In-Reply-To: <1458337167.06.0.908004959718.issue26588@psf.upfronthosting.co.za> Message-ID: <1458572092.88.0.248002598258.issue26588@psf.upfronthosting.co.za> STINNER Victor added the comment: > What about alignment issues on strict platforms? (SPARC?) Which kind of alignment issue do you expect? I added "__attribute__((packed))" to frame_t. I expected SIGBUS because of that (it's even documented in a comment ;-)), but I practice nobdy complained, not even our buildbots. Hum, it looks like we only have one SPARC buildbot and it's offline... _Py_hashtable_get() uses memcpy() to copy the value, so this function should not have any alignment issue. The new code uses pointer dereference, so alignment issues are more likely. How can I test it on Intel CPU? Should I also use memcpy() to retrieve the key value? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 11:09:44 2016 From: report at bugs.python.org (Antoine Pitrou) Date: Mon, 21 Mar 2016 15:09:44 +0000 Subject: [issue26588] _tracemalloc: add support for multiple address spaces (domains) In-Reply-To: <1458337167.06.0.908004959718.issue26588@psf.upfronthosting.co.za> Message-ID: <1458572984.54.0.845638939358.issue26588@psf.upfronthosting.co.za> Antoine Pitrou added the comment: What about compilers that don't support "__attribute__((packed))"? Instead you could use a compare func that compares struct fields... ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 11:38:58 2016 From: report at bugs.python.org (Roundup Robot) Date: Mon, 21 Mar 2016 15:38:58 +0000 Subject: [issue26590] socket destructor: implement finalizer In-Reply-To: <1458351075.41.0.994766438444.issue26590@psf.upfronthosting.co.za> Message-ID: <20160321153852.19475.71731.8C43838A@psf.io> Roundup Robot added the comment: New changeset 46329eec5515 by Victor Stinner in branch 'default': Add socket finalizer https://hg.python.org/cpython/rev/46329eec5515 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 11:55:07 2016 From: report at bugs.python.org (STINNER Victor) Date: Mon, 21 Mar 2016 15:55:07 +0000 Subject: [issue26588] _tracemalloc: add support for multiple address spaces (domains) In-Reply-To: <1458337167.06.0.908004959718.issue26588@psf.upfronthosting.co.za> Message-ID: <1458575707.8.0.60951980567.issue26588@psf.upfronthosting.co.za> STINNER Victor added the comment: Patch version 5: * add hashtable_compare_pointer_t() which compares pointer_t fields (ptr and domain) rather using _Py_hashtable_compare_direct() which causes issues with padding * hashtable_hash_pointer_t() now uses memcpy() to get the pointer_t value rather than a pointer dereference Antoine: > What about compilers that don't support "__attribute__((packed))"? packed is a small and *optional* optimization on the memory footprint of _tracemalloc structure (reduce tracemalloc.get_tracemalloc_memory()). Using packed can introduce memory alignment issue, but since tracemalloc uses memcpy(), it *should* be fine in practice. Again, since I don't have access to SPARC CPU, I don't know how to test. > Instead you could use a compare func that compares struct fields... Done. ---------- Added file: http://bugs.python.org/file42234/tracemalloc-5.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 12:02:31 2016 From: report at bugs.python.org (STINNER Victor) Date: Mon, 21 Mar 2016 16:02:31 +0000 Subject: [issue26590] socket destructor: implement finalizer In-Reply-To: <1458351075.41.0.994766438444.issue26590@psf.upfronthosting.co.za> Message-ID: <1458576151.15.0.835414841888.issue26590@psf.upfronthosting.co.za> STINNER Victor added the comment: Thanks for the review. I pushed my change. ---------- resolution: -> fixed status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 12:07:26 2016 From: report at bugs.python.org (STINNER Victor) Date: Mon, 21 Mar 2016 16:07:26 +0000 Subject: [issue26603] os.scandir: implement finalizer (for ResourceWarning) Message-ID: <1458576446.66.0.754431143479.issue26603@psf.upfronthosting.co.za> New submission from STINNER Victor: Attached patch implements a finalizer for os.scandir() iterator type. The patch also calls the new PyErr_ResourceWarning() function to be able to display in the warning where the iterator was created (allocated) when tracemalloc is enabled. While it makes sense to pass an "open" socket to the logger of the ResourceWarning warning for sockets (issue #26590), maybe we can close the ScandirIterator *before* calling the logger? Example: --- import os f = os.scandir('.') f = None --- Output: --- $ ./python -X tracemalloc -Wd example.py example.py:3: ResourceWarning: unclosed scandir iterator f = None Object allocated at (most recent call first): File "example.py", lineno 2 f = os.scandir('.') --- See also the issue #26590 "socket destructor: implement finalizer". ---------- messages: 262136 nosy: haypo, pitrou, serhiy.storchaka priority: normal severity: normal status: open title: os.scandir: implement finalizer (for ResourceWarning) versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 12:07:42 2016 From: report at bugs.python.org (STINNER Victor) Date: Mon, 21 Mar 2016 16:07:42 +0000 Subject: [issue26603] os.scandir: implement finalizer (for ResourceWarning) In-Reply-To: <1458576446.66.0.754431143479.issue26603@psf.upfronthosting.co.za> Message-ID: <1458576462.63.0.405280929948.issue26603@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- nosy: +benhoyt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 12:07:48 2016 From: report at bugs.python.org (STINNER Victor) Date: Mon, 21 Mar 2016 16:07:48 +0000 Subject: [issue26603] os.scandir: implement finalizer (for ResourceWarning) In-Reply-To: <1458576446.66.0.754431143479.issue26603@psf.upfronthosting.co.za> Message-ID: <1458576468.76.0.16903595849.issue26603@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- keywords: +patch Added file: http://bugs.python.org/file42235/scandir_finalizer.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 12:18:33 2016 From: report at bugs.python.org (STINNER Victor) Date: Mon, 21 Mar 2016 16:18:33 +0000 Subject: [issue26604] Add optional source parameter to warnings.warn() Message-ID: <1458577113.4.0.161652506992.issue26604@psf.upfronthosting.co.za> New submission from STINNER Victor: Follow-up of the issue #26567 which added PyErr_ResourceWarning() (C API), attached patch adds a new source parameter to the warnings.warn() function (Python API). source is the destroyed object which emits a ResourceWarning. The source is used to show the traceback where the object was created (allocated) when tracemalloc is used. The patch also changes _pyio, asyncio and asyncore modules to set the source parameter. Note: tempfile doesn't set source because it uses a class method: @classmethod def _cleanup(cls, name, warn_message): _shutil.rmtree(name) _warnings.warn(warn_message, ResourceWarning) ---------- files: warnings_warn_source.patch keywords: patch messages: 262137 nosy: haypo priority: normal severity: normal status: open title: Add optional source parameter to warnings.warn() type: enhancement versions: Python 3.6 Added file: http://bugs.python.org/file42236/warnings_warn_source.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 12:20:24 2016 From: report at bugs.python.org (STINNER Victor) Date: Mon, 21 Mar 2016 16:20:24 +0000 Subject: [issue26604] Add optional source parameter to warnings.warn() In-Reply-To: <1458577113.4.0.161652506992.issue26604@psf.upfronthosting.co.za> Message-ID: <1458577224.08.0.0453487272956.issue26604@psf.upfronthosting.co.za> STINNER Victor added the comment: For asyncio, it should help to fix the ResourceWarning warnings on AIX (which has a broken ssl module): http://buildbot.python.org/all/builders/PPC64%20AIX%203.x/builds/4700/steps/test/logs/stdio test_create_server_ssl_verify_failed (test.test_asyncio.test_events.PollEventLoopTests) ... FAIL /home/shager/cpython-buildarea/3.x.edelsohn-aix-ppc64/build/Lib/unittest/case.py:628: ResourceWarning: unclosed outcome.errors.clear() ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 12:30:25 2016 From: report at bugs.python.org (Roundup Robot) Date: Mon, 21 Mar 2016 16:30:25 +0000 Subject: [issue26590] socket destructor: implement finalizer In-Reply-To: <1458351075.41.0.994766438444.issue26590@psf.upfronthosting.co.za> Message-ID: <20160321163019.53372.4893.2AAAFCC9@psf.io> Roundup Robot added the comment: New changeset a97d317dec85 by Victor Stinner in branch 'default': Fix test_ssl.test_refcycle() https://hg.python.org/cpython/rev/a97d317dec85 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 12:51:52 2016 From: report at bugs.python.org (SilentGhost) Date: Mon, 21 Mar 2016 16:51:52 +0000 Subject: [issue26582] asyncio documentation links to wrong CancelledError In-Reply-To: <1458225953.38.0.399231880747.issue26582@psf.upfronthosting.co.za> Message-ID: <1458579112.01.0.208963224446.issue26582@psf.upfronthosting.co.za> SilentGhost added the comment: In fact most of the :exc: reference are pointing explicitly to concurrent.futures.CancelledError (and those that don't probably should). It is interesting that you weren't able to make use of that exception, because in Lib/asyncio/futures.py#L23 it's clearly defined as an alias of the concurrent.futures.CancelledError. I guess, ultimately, asyncio.CancelleError needs to be documented seeing how widely used it is. ---------- nosy: +SilentGhost _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 13:00:15 2016 From: report at bugs.python.org (nickeubank) Date: Mon, 21 Mar 2016 17:00:15 +0000 Subject: [issue26605] Feature request: string method `to_file` Message-ID: <1458579615.34.0.816469803879.issue26605@psf.upfronthosting.co.za> New submission from nickeubank: As a social scientists trying to help other social scientists move from language like R, Stata, and Matlab into Python, one of the behaviors I've found unnecessarily difficult to explain is the "file.open()/file.close()" idiom (or, alternatively, context managers). In normal operating systems, and many high level languages, saving is a one-step operation. I understand there are situations where an open file handle is useful, but it seems a simple `to_file` method on strings (essentially wrapping a context-manager) would be really nice, as it would save users from learning this idiom. Any chance it's feasible? Sadly, I have no real C skills so can't implement myself. :( ---------- components: IO messages: 262141 nosy: nickeubank priority: normal severity: normal status: open title: Feature request: string method `to_file` type: enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 13:03:20 2016 From: report at bugs.python.org (STINNER Victor) Date: Mon, 21 Mar 2016 17:03:20 +0000 Subject: [issue26605] Feature request: string method `to_file` In-Reply-To: <1458579615.34.0.816469803879.issue26605@psf.upfronthosting.co.za> Message-ID: <1458579800.63.0.0793069460399.issue26605@psf.upfronthosting.co.za> STINNER Victor added the comment: It's easy to implement such function in a module and upload such module to PyPI (ex: "to_file" module :-)). It's not easy to guess user expectations on such function: text encoding, buffering, etc. Adding a method to the builtin str type which writes into a file is a no-no. ---------- nosy: +haypo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 13:14:15 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 21 Mar 2016 17:14:15 +0000 Subject: [issue26605] Feature request: string method `to_file` In-Reply-To: <1458579615.34.0.816469803879.issue26605@psf.upfronthosting.co.za> Message-ID: <1458580455.53.0.725436143662.issue26605@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Such function already exists in the stdlib! But with different order of arguments. See pathlib.Path.write_text(). Personally I'm very skeptical about usefulness of similar functions in the stdlib. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 13:16:28 2016 From: report at bugs.python.org (STINNER Victor) Date: Mon, 21 Mar 2016 17:16:28 +0000 Subject: [issue26605] Feature request: string method `to_file` In-Reply-To: <1458579615.34.0.816469803879.issue26605@psf.upfronthosting.co.za> Message-ID: <1458580588.93.0.951113154601.issue26605@psf.upfronthosting.co.za> STINNER Victor added the comment: Oh. I wasn't aware of these pathlib methods. https://docs.python.org/dev/library/pathlib.html#pathlib.Path.write_bytes https://docs.python.org/dev/library/pathlib.html#pathlib.Path.write_text ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 14:00:29 2016 From: report at bugs.python.org (STINNER Victor) Date: Mon, 21 Mar 2016 18:00:29 +0000 Subject: [issue26588] _tracemalloc: add support for multiple address spaces (domains) In-Reply-To: <1458337167.06.0.908004959718.issue26588@psf.upfronthosting.co.za> Message-ID: <1458583229.89.0.154769360814.issue26588@psf.upfronthosting.co.za> STINNER Victor added the comment: Hum, the patch is really too hard to review. So I extract to the "key_size" part: hashtable_key_size.patch. I added new macros to get the key, wrapper to memcpy() with an assert to check the key size in debug mode. ---------- Added file: http://bugs.python.org/file42237/hashtable_key_size.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 16:24:24 2016 From: report at bugs.python.org (Michael Cuthbert) Date: Mon, 21 Mar 2016 20:24:24 +0000 Subject: [issue17446] doctest test finder doesnt find line numbers of properties In-Reply-To: <1363536507.07.0.43500928967.issue17446@psf.upfronthosting.co.za> Message-ID: <1458591864.3.0.768779554026.issue17446@psf.upfronthosting.co.za> Michael Cuthbert added the comment: Here's a rather obscure bug that I was able to catch before we put this into action: doctests inside the __doc__ for namedtuples (and perhaps all namedtuples?) are instances of property, have .fget, but do not have .fget.__code__. Thus one more check is needed: if (lineno is None and isinstance(obj, property) and obj.fget is not None and hasattr(obj.fget, '__code__')): obj = obj.fget.__code__ lineno = getattr(obj, 'co_firstlineno', None) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 16:27:16 2016 From: report at bugs.python.org (Steve Dower) Date: Mon, 21 Mar 2016 20:27:16 +0000 Subject: [issue26598] Embbedable zip does not import modules in (zip)subdirectory In-Reply-To: <1458536716.69.0.0292011453311.issue26598@psf.upfronthosting.co.za> Message-ID: <1458592036.25.0.87433759782.issue26598@psf.upfronthosting.co.za> Steve Dower added the comment: I can't reproduce this - I used almost exactly your code and it worked fine. The one change I made was to use either L"python35.zip" alone (as my exe was alongside the zip) or a full path to the zip file. Both of these worked. If the zip file is not found, you'll get an error. Is it possible that you are not actually pointing at the correct zip file? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 17:01:52 2016 From: report at bugs.python.org (Roundup Robot) Date: Mon, 21 Mar 2016 21:01:52 +0000 Subject: [issue26588] _tracemalloc: add support for multiple address spaces (domains) In-Reply-To: <1458337167.06.0.908004959718.issue26588@psf.upfronthosting.co.za> Message-ID: <20160321210149.13988.22392.33354D48@psf.io> Roundup Robot added the comment: New changeset aca4e9af1ca6 by Victor Stinner in branch 'default': hashtable.h now supports keys of any size https://hg.python.org/cpython/rev/aca4e9af1ca6 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 18:05:29 2016 From: report at bugs.python.org (Roundup Robot) Date: Mon, 21 Mar 2016 22:05:29 +0000 Subject: [issue26588] _tracemalloc: add support for multiple address spaces (domains) In-Reply-To: <1458337167.06.0.908004959718.issue26588@psf.upfronthosting.co.za> Message-ID: <20160321220520.98675.37301.0A636F0A@psf.io> Roundup Robot added the comment: New changeset 98a1c8cb882f by Victor Stinner in branch 'default': Issue #26588: Fix compilation warning on Windows https://hg.python.org/cpython/rev/98a1c8cb882f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 18:17:06 2016 From: report at bugs.python.org (=?utf-8?b?SsSBbmlzIMWgbGFwacWGxaE=?=) Date: Mon, 21 Mar 2016 22:17:06 +0000 Subject: [issue26606] logging.baseConfig is missing the encoding parameter Message-ID: <1458598626.88.0.490041392552.issue26606@psf.upfronthosting.co.za> New submission from J?nis ?lapi??: Hi! Log files are only saved using the system default encoding. On Windows, this means that the current ANSI code page is used. This may lead to a disaster (exceptions may be thrown due to unmappable characters) if you want to log particular text strings in a foreign language, e.g. those read from a source file in the UTF-8 or UTF-16 encoding, and such strings contain characters not available in your ANSI code page. I guess this issue does not affect Linux or Mac OSX as they already use the UTF-8 encoding for their system locales. Actually, the logging module already has the built-in functionality for setting a particular encoding for output files. However, it was not added as a parameter of the baseConfig function (in __init__.py). I added a patch file with suggested amendments. I already tested writing logs with those changes applied and files are now saved in the specified encoding which differs from the Windows current ANSI page. For example: logging.basicConfig(filename=log_path, filemode='w', encoding='utf-8', format='%(message)s', level=logging.INFO) ---------- components: Library (Lib) files: __init__.py.patch keywords: patch messages: 262150 nosy: janis.slapins priority: normal severity: normal status: open title: logging.baseConfig is missing the encoding parameter type: enhancement versions: Python 3.5 Added file: http://bugs.python.org/file42238/__init__.py.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 18:21:43 2016 From: report at bugs.python.org (STINNER Victor) Date: Mon, 21 Mar 2016 22:21:43 +0000 Subject: [issue26588] _tracemalloc: add support for multiple address spaces (domains) In-Reply-To: <1458337167.06.0.908004959718.issue26588@psf.upfronthosting.co.za> Message-ID: <1458598903.47.0.369252255732.issue26588@psf.upfronthosting.co.za> STINNER Victor added the comment: Hum, an assertion fails in set_reentrant(), helper function to set a TLS (Thread Local Storage), but I'm unable to reproduce the bug on my Fedora 23 (AMD64). http://buildbot.python.org/all/builders/AMD64%20Debian%20root%203.x/builds/3316/steps/test/logs/stdio [187/400] test_tracemalloc python: ./Modules/_tracemalloc.c:174: set_reentrant: Assertion `PyThread_get_key_value(tracemalloc_reentrant_key) == ((PyObject *) &_Py_TrueStruct)' failed. Fatal Python error: Aborted Current thread 0x00007fecefd68700 (most recent call first): File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/test/test_tracemalloc.py", line 85 in setUp File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/unittest/case.py", line 596 in run File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/unittest/case.py", line 648 in __call__ File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/unittest/suite.py", line 122 in run File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/unittest/suite.py", line 84 in __call__ File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/unittest/suite.py", line 122 in run File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/unittest/suite.py", line 84 in __call__ File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/unittest/runner.py", line 176 in run File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/test/support/__init__.py", line 1802 in _run_suite File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/test/support/__init__.py", line 1836 in run_unittest File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/test/test_tracemalloc.py", line 824 in test_main File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/test/libregrtest/runtest.py", line 162 in runtest_inner File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/test/libregrtest/runtest.py", line 115 in runtest File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/test/libregrtest/main.py", line 295 in run_tests_sequential File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/test/libregrtest/main.py", line 356 in run_tests File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/test/libregrtest/main.py", line 392 in main File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/test/libregrtest/main.py", line 433 in main File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/test/libregrtest/main.py", line 455 in main_in_temp_cwd File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/test/__main__.py", line 3 in File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/runpy.py", line 85 in _run_code File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/runpy.py", line 184 in _run_module_as_main Makefile:1026: recipe for target 'buildbottest' failed make: *** [buildbottest] Aborted ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 18:37:18 2016 From: report at bugs.python.org (Robert Siemer) Date: Mon, 21 Mar 2016 22:37:18 +0000 Subject: [issue23749] asyncio missing wrap_socket (starttls) In-Reply-To: <1427119199.61.0.485462184824.issue23749@psf.upfronthosting.co.za> Message-ID: <1458599838.69.0.879086148354.issue23749@psf.upfronthosting.co.za> Changes by Robert Siemer : ---------- nosy: +siemer _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 18:45:06 2016 From: report at bugs.python.org (STINNER Victor) Date: Mon, 21 Mar 2016 22:45:06 +0000 Subject: [issue26588] _tracemalloc: add support for multiple address spaces (domains) In-Reply-To: <1458337167.06.0.908004959718.issue26588@psf.upfronthosting.co.za> Message-ID: <1458600306.42.0.940364619023.issue26588@psf.upfronthosting.co.za> STINNER Victor added the comment: About memory alignment, _Py_HASHTABLE_ENTRY_DATA_AS_VOID_P() macro uses pointer dereference. It may be replaced with _Py_HASHTABLE_ENTRY_READ_DATA() to use memcpy() and avoid memory alignment issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 19:01:18 2016 From: report at bugs.python.org (Alexander Belopolsky) Date: Mon, 21 Mar 2016 23:01:18 +0000 Subject: [issue24773] Implement PEP 495 (Local Time Disambiguation) In-Reply-To: <1438456647.64.0.191464539374.issue24773@psf.upfronthosting.co.za> Message-ID: <1458601278.04.0.260327061427.issue24773@psf.upfronthosting.co.za> Changes by Alexander Belopolsky : ---------- hgrepos: +335 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 19:44:02 2016 From: report at bugs.python.org (Jonathan Hanba) Date: Mon, 21 Mar 2016 23:44:02 +0000 Subject: [issue25251] Unknown MS Compiler version 1900 In-Reply-To: <1443392264.43.0.443478210283.issue25251@psf.upfronthosting.co.za> Message-ID: <1458603842.21.0.886093082439.issue25251@psf.upfronthosting.co.za> Jonathan Hanba added the comment: I just ran across this bug in Python 3.5.1 while trying to build pycrypto using MinGW. I patched the cygwincompiler.py with the attached patch.diff file, and that got me part of the way there. With the additions made by patch.diff, the MinGW linker then looked for vcruntime140.dll but it could not find it. With the Python 3.5.1 installation, vcruntime140.dll is located in ./Python35-32 directory, but it is not included in the library directories being passed into MinGW. To fix this, I had to edit ./Lib/distutils/command/build_ext.py and add to line 141: self.library_dirs.append(os.path.join(sys.exec_prefix)) This adds the root of the Python35-32 directory to the library paths used by MinGW. ---------- nosy: +hanbaj _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 20:16:38 2016 From: report at bugs.python.org (Nathaniel Smith) Date: Tue, 22 Mar 2016 00:16:38 +0000 Subject: [issue26588] _tracemalloc: add support for multiple address spaces (domains) In-Reply-To: <1458337167.06.0.908004959718.issue26588@psf.upfronthosting.co.za> Message-ID: <1458605798.38.0.490231703163.issue26588@psf.upfronthosting.co.za> Nathaniel Smith added the comment: High-level questions: - How do you anticipate the integers naming domains will be allocated? Is it like port numbers, and you'll maintain a registry somewhere ("domains 0-100 are reserved for the interpreter, pycuda has reserved 100-110, ...")? - You have it configurable at run-time whether the domain gets included in the trace key, and if this is set to false (the default) then all the different domains just get collapsed together. How is some downstream user like pycuda expected to get sensible behavior out of this? Is the idea that pycuda should be guarding all trace/untrace calls with if (use_domain) { ... }, or...? (I guess it could be sensible to support disabling domain stuff -- though if I were writing it I probably wouldn't bother just because it increases the number of configurations that need to be tested etc. -- but if you're doing this then IMO it should discard all trace/untrace calls that refer to non-default domains, i.e. domain=False shouldn't mean "discard domain information", it should mean "trace only the heap domain".) - Is all this messing about with possibly-unaligned pointers etc. really easier than having one-hashtable-per-domain? You could easily get away with a linearly scanned array, even... ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 20:18:53 2016 From: report at bugs.python.org (nickeubank) Date: Tue, 22 Mar 2016 00:18:53 +0000 Subject: [issue26605] Feature request: string method `to_file` In-Reply-To: <1458579615.34.0.816469803879.issue26605@psf.upfronthosting.co.za> Message-ID: <1458605933.44.0.0721155103262.issue26605@psf.upfronthosting.co.za> nickeubank added the comment: Seems like existence of a method in the stdlib (or at least in the pathlib part of the stdlib) suggests issues with text encoding can be overcome. IMHO I would suggest most people have no idea about that method (I've been doing python for years and this has always been a personal frustration, and I've asked several others for better options and no one had one to offer), and it seems like it would make much more sense as a string method. If someone has a string they want to save to disk, I can't imagine anyone looking in the Path library. I respect the desire to avoid bloat -- the context manager or open/close idiom has just felt unnecessarily complicated (dare I say unpythonic?) for a common task. Also, I think it's one that data scientists use a lot when they generate outputs to pull into LaTeX documents. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 20:57:28 2016 From: report at bugs.python.org (Mansour Moufid) Date: Tue, 22 Mar 2016 00:57:28 +0000 Subject: [issue26607] Rename a parameter in the function PyFile_FromFile Message-ID: <1458608248.15.0.411185943215.issue26607@psf.upfronthosting.co.za> New submission from Mansour Moufid: Hi, The last parameter of the function PyFile_FromFile is named 'close', but is a pointer to a function with the prototype of the 'fclose' function in libc. The mismatch causes confusion for some static analysis tools. This patch renames the parameter to 'fclose'. Note that everywhere else PyFile_FromFile is called, that argument is always named fclose or pclose (or NULL), this was the one exception. Thanks for your time. ---------- files: 0001-PyFile_FromFile-Rename-close-parameter-to-fclose.patch keywords: patch messages: 262156 nosy: Mansour Moufid priority: normal severity: normal status: open title: Rename a parameter in the function PyFile_FromFile type: enhancement versions: Python 2.7 Added file: http://bugs.python.org/file42239/0001-PyFile_FromFile-Rename-close-parameter-to-fclose.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 22:30:37 2016 From: report at bugs.python.org (Roundup Robot) Date: Tue, 22 Mar 2016 02:30:37 +0000 Subject: [issue15699] PEP 3121, 384 Refactoring applied to readline module In-Reply-To: <1345147381.91.0.560597639191.issue15699@psf.upfronthosting.co.za> Message-ID: <20160322023034.974.54757.C2A290C2@psf.io> Roundup Robot added the comment: New changeset b5279feb22f1 by Martin Panter in branch '3.5': Issue #15699: Reunite comment with variable https://hg.python.org/cpython/rev/b5279feb22f1 New changeset 5c6a5b3bb6eb by Martin Panter in branch 'default': Issue #15699: Merge readline fixup from 3.5 https://hg.python.org/cpython/rev/5c6a5b3bb6eb ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 23:50:40 2016 From: report at bugs.python.org (Simon) Date: Tue, 22 Mar 2016 03:50:40 +0000 Subject: [issue26598] Embbedable zip does not import modules in (zip)subdirectory In-Reply-To: <1458536716.69.0.0292011453311.issue26598@psf.upfronthosting.co.za> Message-ID: <1458618640.95.0.5831968829.issue26598@psf.upfronthosting.co.za> Simon added the comment: I have tried with the zip file in both the exe alongside the zip and not alongside it, (mine was not). And I get the same error in both cases. I am using Windows 10, VS2015. I compile the Python35.dll directly and my config is default, I don't change anything really. Do you build the Python35.dll or where do you get it from? Do you add something to your config? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 00:35:02 2016 From: report at bugs.python.org (Zachary Ware) Date: Tue, 22 Mar 2016 04:35:02 +0000 Subject: [issue26598] Embbedable zip does not import modules in (zip)subdirectory In-Reply-To: <1458536716.69.0.0292011453311.issue26598@psf.upfronthosting.co.za> Message-ID: <1458621302.2.0.272532036768.issue26598@psf.upfronthosting.co.za> Zachary Ware added the comment: I am also unable to reproduce. I've attached the exact code I used, and built it with: cl /I "C:\Program Files\Python35\include" embtest.c /link /libpath:"C:\Program Files\Python35\libs" Output is the expected result of 'import ctypes;print(dir(ctypes))'. Simon: If you run this code (including PyErr_Print();), what output do you get? Are you sure that _ctypes.pyd is also available? What happens if you import unittest instead of ctypes? Or winsound? Steve: I notice that the embeddable zip does not include 'include' or 'libs' dirs, was this deliberate? I just noticed because it caused me to jump through an extra hoop to test this after I mistakenly downloaded the 32-bit embeddable zip on the first try, then had to go back for the 64-bit (or a 32-bit installer). If it's deliberate (and preferably documented somewhere that I didn't check for), that's fine; I'm just curious. ---------- Added file: http://bugs.python.org/file42240/embtest.c _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 00:39:13 2016 From: report at bugs.python.org (Steve Dower) Date: Tue, 22 Mar 2016 04:39:13 +0000 Subject: [issue26598] Embbedable zip does not import modules in (zip)subdirectory In-Reply-To: <1458536716.69.0.0292011453311.issue26598@psf.upfronthosting.co.za> Message-ID: <1458621553.54.0.787100348364.issue26598@psf.upfronthosting.co.za> Steve Dower added the comment: I used the python35.dll in the embeddable install, along with the python35.zip included in there. I linked against python.h and python35.lib from a full install, but put the resulting exe in the directory with the embeddable install so it uses that instead of the main one. Probably I ought to write up a more detailed walkthrough on how to customise the embeddable install, but your feedback here is very valuable. Did you do things differently from what I put above? You're certainly not the only one to do whatever you did. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 01:31:42 2016 From: report at bugs.python.org (Roundup Robot) Date: Tue, 22 Mar 2016 05:31:42 +0000 Subject: [issue17167] python man page contains $Date$ in page footer In-Reply-To: <1360400635.24.0.00924107320182.issue17167@psf.upfronthosting.co.za> Message-ID: <20160322053139.84286.86079.ACD150E5@psf.io> Roundup Robot added the comment: New changeset ed85850499bd by Benjamin Peterson in branch '3.4': remove useless $ keyword (closes #17167) https://hg.python.org/cpython/rev/ed85850499bd New changeset 86355b610d7c by Benjamin Peterson in branch '2.7': remove useless $ keyword (closes #17167) https://hg.python.org/cpython/rev/86355b610d7c New changeset 4784717cb254 by Benjamin Peterson in branch '3.5': merge 3.4 (#17167) https://hg.python.org/cpython/rev/4784717cb254 New changeset c1edc2abbf97 by Benjamin Peterson in branch 'default': merge 3.5 (#17167) https://hg.python.org/cpython/rev/c1edc2abbf97 ---------- nosy: +python-dev resolution: -> fixed stage: needs patch -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 01:57:57 2016 From: report at bugs.python.org (Martin Panter) Date: Tue, 22 Mar 2016 05:57:57 +0000 Subject: [issue13501] Make libedit support more generic; port readline / libedit to FreeBSD In-Reply-To: <1322579942.3.0.601983912656.issue13501@psf.upfronthosting.co.za> Message-ID: <1458626277.1.0.293335303454.issue13501@psf.upfronthosting.co.za> Martin Panter added the comment: Patch v3 is an update taking into account Ned?s comments, and my own now deeper understanding: * Reworked the --with-readline handling. Suggested options are --with-readline=editline, and --without-readline. The current behaviour (use -lreadline if possible) should still work by default. * Adjust the style of the configure.ac syntax to match surrounding code. * Restore rl_completion_suppress_append check, independent of rl_completion_append_character. * Remove completion_matches() #ifdef madness, originally spawned by Issue 1703270, which makes no sense to me. * Restored the runtime Editline checks protected by __APPLE__, but if WITH_EDITLINE is specified (e.g. on other platforms) the Editline support is always enabled and there are no runtime checks. ---------- Added file: http://bugs.python.org/file42241/editline.v3.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 02:07:32 2016 From: report at bugs.python.org (Simon) Date: Tue, 22 Mar 2016 06:07:32 +0000 Subject: [issue26598] Embbedable zip does not import modules in (zip)subdirectory In-Reply-To: <1458536716.69.0.0292011453311.issue26598@psf.upfronthosting.co.za> Message-ID: <1458626852.35.0.540179737629.issue26598@psf.upfronthosting.co.za> Simon added the comment: 1- New solution Win32 "console application", (left all default settings). 2- downloaded "Gzipped source tarball" from https://www.python.org/downloads/release/python-351/ 3- Extracted everything, (didn't change anything). 4- Added "pythoncore.vcxproj" in "Python-3.5.1\PCbuild" to the solution above. 5- Compiled to make sure... "python35_d.dll" and "python35_d.lib" created in "Python-3.5.1\PCbuild\win32" 6- Added the "Python-3.5.1\PCbuild\win32" to my library include folder 7- Added "Python-3.5.1\Include" to my additional include folder. (for Python.h) 7- Added "Python-3.5.1\PC" to my additional include folder. (for Pyconfig.h) 8- Added "#include "Python.h"" to my ConsoleApplicaiton.cpp 9- Compile, all good. 10- downloaded "Windows x86-64 embeddable zip file" from link above. 11- Copied the created "python35_d.dll" to my debug folder. 12- Replaced "path\\to\\python35.zip" with the full path of the embeddable zip file. And I get the same issue. PyErr_Print(); output. Trackback (most recent call last): File "", line 1, in File "ctypes\__init__.py, line 8, in ImportError: No module named '_ctypes' "import unittest" - works "import winsound" - does not work, same error as above. Please let me know if I should do anything else. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 02:15:01 2016 From: report at bugs.python.org (Simon) Date: Tue, 22 Mar 2016 06:15:01 +0000 Subject: [issue26598] Embbedable zip does not import modules in (zip)subdirectory In-Reply-To: <1458536716.69.0.0292011453311.issue26598@psf.upfronthosting.co.za> Message-ID: <1458627301.4.0.74715514902.issue26598@psf.upfronthosting.co.za> Simon added the comment: Sorry I should add that 1- I do *not* have python installed on my dev machine. 2- VS2015 Enterprise. 3- Windows 10 - x64 4- *Not* running as admin Everything else is fairly standard. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 02:56:38 2016 From: report at bugs.python.org (Mateusz) Date: Tue, 22 Mar 2016 06:56:38 +0000 Subject: [issue26608] RLock undocumented behavior in case of multiple acquire Message-ID: <1458629798.26.0.210968234517.issue26608@psf.upfronthosting.co.za> New submission from Mateusz: The number of acquisitions must be the same as the number of releases or else lock will not be released for other threads leading to deadlock. This is not mentioned in documentation. First acquisition returns boolean and further acquisitions return 1. This is also not mentioned in documentation. ---------- assignee: docs at python components: Documentation, Library (Lib) messages: 262165 nosy: docs at python, smbrd priority: normal severity: normal status: open title: RLock undocumented behavior in case of multiple acquire versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 03:25:12 2016 From: report at bugs.python.org (Martin Panter) Date: Tue, 22 Mar 2016 07:25:12 +0000 Subject: [issue23735] Readline not adjusting width after resize with 6.3 In-Reply-To: <1426984974.32.0.405944458303.issue23735@psf.upfronthosting.co.za> Message-ID: <1458631512.91.0.212725665607.issue23735@psf.upfronthosting.co.za> Martin Panter added the comment: I think it is conceivable that people could use Readline _and_ do their own stuff with the terminal. Consider someone playing with terminal stuff in the interactive interpreter (which happens to use Readline). I understand Readline returns the terminal to a sensible state after it returns you a line. Another concern with the patch is that signal.getsignal(SIGWINCH) returns SIG_DFL, although according to the documentation it should probably return None (meaning a signal handler was not installed by Python). Not sure if that is a bug with the patch or with the signal module though :) Also it looks like this patch will fail with Editline (Gnu Readline substitute used on OS X), and therefore probably also older versions of Gnu Readline. With my patch from Issue 13501 to enable Editline on Linux, I get these errors: /media/disk/home/proj/python/cpython/Modules/readline.c: In function ?readline_until_enter_or_signal?: /media/disk/home/proj/python/cpython/Modules/readline.c:1116:17: warning: implicit declaration of function ?rl_resize_terminal? [-Wimplicit-function-declaration] rl_resize_terminal(); ^ *** WARNING: renaming "readline" since importing it failed: build/lib.linux-x86_64-3.6-pydebug/readline.cpython-36dm-x86_64-linux-gnu.so: undefined symbol: rl_resize_terminal Following modules built successfully but were removed because they could not be imported: readline ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 03:31:55 2016 From: report at bugs.python.org (Martin Panter) Date: Tue, 22 Mar 2016 07:31:55 +0000 Subject: [issue24266] raw_input + readline: Ctrl+C during search breaks readline In-Reply-To: <1432306683.9.0.470835567306.issue24266@psf.upfronthosting.co.za> Message-ID: <1458631915.09.0.654444846617.issue24266@psf.upfronthosting.co.za> Martin Panter added the comment: I?m getting ready to commit my patch to support the new Readline 7 function. Is there anything else to be done? The other options don?t sound worth it to me (e.g. incomplete, depending on internal details, etc). ---------- stage: patch review -> commit review versions: -Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 03:46:42 2016 From: report at bugs.python.org (Manvi B) Date: Tue, 22 Mar 2016 07:46:42 +0000 Subject: [issue26506] hex() documentation: mention "%x" % int In-Reply-To: <1457372823.56.0.270827849914.issue26506@psf.upfronthosting.co.za> Message-ID: <1458632802.79.0.158488006589.issue26506@psf.upfronthosting.co.za> Manvi B added the comment: Considered the reviews from STINNER Victor (haypo) and comments, the patch is modified. ---------- Added file: http://bugs.python.org/file42242/issue26506.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 03:58:11 2016 From: report at bugs.python.org (SilentGhost) Date: Tue, 22 Mar 2016 07:58:11 +0000 Subject: [issue26605] Feature request: string method `to_file` In-Reply-To: <1458579615.34.0.816469803879.issue26605@psf.upfronthosting.co.za> Message-ID: <1458633491.76.0.559680033481.issue26605@psf.upfronthosting.co.za> SilentGhost added the comment: Those methods were added in 3.5, so no wonder many people would be unaware of them. I would suggest first taking such a proposal to python-ideas, since bug tracker is not a venue for proposing/advocating such sweeping changes to the language. ---------- nosy: +SilentGhost resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 04:20:43 2016 From: report at bugs.python.org (Eric Price) Date: Tue, 22 Mar 2016 08:20:43 +0000 Subject: [issue23735] Readline not adjusting width after resize with 6.3 In-Reply-To: <1426984974.32.0.405944458303.issue23735@psf.upfronthosting.co.za> Message-ID: <1458634843.57.0.0755271243881.issue23735@psf.upfronthosting.co.za> Eric Price added the comment: rl_resize_terminal was added in readline 4.0, released in 1999. I think we can rely on it. =) I don't know editline, but it probably doesn't include the readline 6.3 change that makes this necessary, so your patch for it could just IFDEF out that line. I think SIG_DFL is a pretty reasonable return value, actually. It's clearly not SIG_IGN or a python handle, it's not really "unknown", and it can be described as default behavior: it is the default way readline is supposed to work. Finally, while I agree that it is conceivable that one could try to use readline + other terminal mucking with SIGWINCH, (a) this didn't work before the 6.3 change, (b) it doesn't work now, (c) it's far less common than the standard case of using readline normally, and (d) supporting such usage would be complicated and require a readline module API change. Let's start by supporting normal usage. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 04:56:20 2016 From: report at bugs.python.org (Xiang Zhang) Date: Tue, 22 Mar 2016 08:56:20 +0000 Subject: [issue26609] Wrong request target in test_httpservers.py Message-ID: <1458636980.12.0.779581831419.issue26609@psf.upfronthosting.co.za> New submission from Xiang Zhang: When requesting a resource from an origin server, the request-target in request line should always starts with a back slash. But in SimpleHTTPServerTestCase in test_httpservers.py, almost all the requests are sent without the back slash though the handler handles it well. The request lines are like 'GET tmpXXXXX HTTP/1.1'. I add the back slashes. Maybe in SimpleHTTPRequestHandler, we should reject such invalid request-targets and then return BAD_REQUEST. And then issue2254 won't happen. ---------- components: Library (Lib) files: request_target_in_test_httpservers.patch keywords: patch messages: 262171 nosy: martin.panter, xiang.zhang priority: normal severity: normal status: open title: Wrong request target in test_httpservers.py versions: Python 3.6 Added file: http://bugs.python.org/file42243/request_target_in_test_httpservers.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 05:42:33 2016 From: report at bugs.python.org (SilentGhost) Date: Tue, 22 Mar 2016 09:42:33 +0000 Subject: [issue26606] logging.baseConfig is missing the encoding parameter In-Reply-To: <1458598626.88.0.490041392552.issue26606@psf.upfronthosting.co.za> Message-ID: <1458639753.97.0.196800867606.issue26606@psf.upfronthosting.co.za> Changes by SilentGhost : ---------- nosy: +vinay.sajip stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 06:18:30 2016 From: report at bugs.python.org (STINNER Victor) Date: Tue, 22 Mar 2016 10:18:30 +0000 Subject: [issue26588] _tracemalloc: add support for multiple address spaces (domains) In-Reply-To: <1458605798.38.0.490231703163.issue26588@psf.upfronthosting.co.za> Message-ID: STINNER Victor added the comment: Hi, > - How do you anticipate the integers naming domains will be allocated? Is it like port numbers, and you'll maintain a registry somewhere ("domains 0-100 are reserved for the interpreter, pycuda has reserved 100-110, ...")? I simply have no idea at all :-) I guess that the best is to collaborate. It's not like we plan to have 1000 different users of the API. Today, I only know two users: you and Antoine :-D unsigned int is large: at least 32 bits. I understood that we will only need something like 10 or maybe 20 domains. > - You have it configurable at run-time whether the domain gets included in the trace key, and if this is set to false (the default) then all the different domains just get collapsed together. How is some downstream user like pycuda expected to get sensible behavior out of this? Is the idea that pycuda should be guarding all trace/untrace calls with if (use_domain) { ... }, or...? In my first implementation, support for domains was always enabled. But I don't like that since it increases the memory footprint even if you don't use domains, which is the case for *all* users today. I added a flag, but I'm not happy with the API. For example, it's not possible to set the flag using PYTHONTRACEMALLOC=nframe env var nor -X tracemalloc[=nframe] command line option, whereas I'm a big fan of -X tracemalloc=5 command line option. Instead of having to enable the flag early and don't allow to change the flag later, I should try to implement a dynamic flag: start without domain, and convert the whole table to support domain as soon as you start to trace at least one trace with domain != 0. I pushed the first part of my patch (support key bigger than sizeof(void*)) to be able to focus on the second part. If fact, converting a table is no more complex than the regular "rehash" operation when the table becomes too big. This operation is part of the hashtable design. > (I guess it could be sensible to support disabling domain stuff -- though if I were writing it I probably wouldn't bother just because it increases the number of configurations that need to be tested etc. -- but if you're doing this then IMO it should discard all trace/untrace calls that refer to non-default domains, i.e. domain=False shouldn't mean "discard domain information", it should mean "trace only the heap domain".) The design of tracemalloc is more to collect everything, but filter later. That's why I added an optional domain parameter to tracemalloc.Filter an a new tracemalloc.DomainFilter filter. > - Is all this messing about with possibly-unaligned pointers etc. really easier than having one-hashtable-per-domain? You could easily get away with a linearly scanned array, even... Having one hash table per domain requires to allocate a new hashtable when we start to use a domain, then decide when it's time to release it. We also need a "registry" for all trace hashtables: a simple short array, or maybe even another hashtable? But I think that we disagree on how traces will used. It looks like you only care of statistics *per domain*. IMHO it's worth to get the *total* memory (ex: CPU+GPU memory) per filename or per line number. But also give the ability to filter domains. For example, exclude CPU to get statistics of all GPU domains, or get CPU+shmem statistics. I know that technically, the storage doesn't matter much: we can still get traces of all domains at once. I like the idea of having all traces in the same structure, even I have to agree that the new C macros to get a key are more ugly than the previous simple direct "void* key" pointer. Domains are quite strange. They are part of the key in the hashtable, but _tracemalloc._get_traces() now returns them as part of the "value" (with my patch) :-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 06:52:26 2016 From: report at bugs.python.org (STINNER Victor) Date: Tue, 22 Mar 2016 10:52:26 +0000 Subject: [issue26610] test_venv.test_with_pip() fails when ctypes is missing Message-ID: <1458643946.17.0.878468383793.issue26610@psf.upfronthosting.co.za> New submission from STINNER Victor: pip/pep425tags.py requires ctypes, but it's not available on the OpenIndiana buildbot. I suggest to skip the test if ctypes is missing. I don't know if it's possible to modify pip to make ctypes optional again. http://buildbot.python.org/all/builders/AMD64%20OpenIndiana%203.x/builds/10407/steps/test/logs/stdio ====================================================================== FAIL: test_with_pip (test.test_venv.EnsurePipTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/export/home/buildbot/64bits/3.x.cea-indiana-amd64/build/Lib/test/test_venv.py", line 364, in test_with_pip with_pip=True) subprocess.CalledProcessError: Command '['/tmp/tmpl3s6nv31/bin/python', '-Im', 'ensurepip', '--upgrade', '--default-pip']' returned non-zero exit status 1 During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/export/home/buildbot/64bits/3.x.cea-indiana-amd64/build/Lib/test/test_venv.py", line 370, in test_with_pip self.fail(msg.format(exc, details)) AssertionError: Command '['/tmp/tmpl3s6nv31/bin/python', '-Im', 'ensurepip', '--upgrade', '--default-pip']' returned non-zero exit status 1 **Subprocess Output** Traceback (most recent call last): File "/export/home/buildbot/64bits/3.x.cea-indiana-amd64/build/Lib/runpy.py", line 184, in _run_module_as_main "__main__", mod_spec) File "/export/home/buildbot/64bits/3.x.cea-indiana-amd64/build/Lib/runpy.py", line 85, in _run_code exec(code, run_globals) File "/export/home/buildbot/64bits/3.x.cea-indiana-amd64/build/Lib/ensurepip/__main__.py", line 4, in ensurepip._main() File "/export/home/buildbot/64bits/3.x.cea-indiana-amd64/build/Lib/ensurepip/__init__.py", line 209, in _main default_pip=args.default_pip, File "/export/home/buildbot/64bits/3.x.cea-indiana-amd64/build/Lib/ensurepip/__init__.py", line 116, in bootstrap _run_pip(args + [p[0] for p in _PROJECTS], additional_paths) File "/export/home/buildbot/64bits/3.x.cea-indiana-amd64/build/Lib/ensurepip/__init__.py", line 40, in _run_pip import pip File "/tmp/tmpbfnwxnn2/pip-8.1.1-py2.py3-none-any.whl/pip/__init__.py", line 16, in File "/tmp/tmpbfnwxnn2/pip-8.1.1-py2.py3-none-any.whl/pip/vcs/subversion.py", line 9, in File "/tmp/tmpbfnwxnn2/pip-8.1.1-py2.py3-none-any.whl/pip/index.py", line 30, in File "/tmp/tmpbfnwxnn2/pip-8.1.1-py2.py3-none-any.whl/pip/wheel.py", line 32, in File "/tmp/tmpbfnwxnn2/pip-8.1.1-py2.py3-none-any.whl/pip/pep425tags.py", line 9, in File "/export/home/buildbot/64bits/3.x.cea-indiana-amd64/build/Lib/ctypes/__init__.py", line 7, in from _ctypes import Union, Structure, Array ImportError: No module named '_ctypes' ---------- messages: 262173 nosy: dstufft, haypo priority: normal severity: normal status: open title: test_venv.test_with_pip() fails when ctypes is missing versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 06:56:00 2016 From: report at bugs.python.org (STINNER Victor) Date: Tue, 22 Mar 2016 10:56:00 +0000 Subject: [issue25911] Regression: os.walk now using os.scandir() breaks bytes filenames on windows In-Reply-To: <1450539578.39.0.976654454489.issue25911@psf.upfronthosting.co.za> Message-ID: <1458644160.69.0.991489634972.issue25911@psf.upfronthosting.co.za> STINNER Victor added the comment: Windows buildbots still fail (sometimes?) because of this issue :-/ http://buildbot.python.org/all/builders/AMD64%20Windows8%203.x/builds/1874/steps/test/logs/stdio ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 07:02:22 2016 From: report at bugs.python.org (Donald Stufft) Date: Tue, 22 Mar 2016 11:02:22 +0000 Subject: [issue26610] test_venv.test_with_pip() fails when ctypes is missing In-Reply-To: <1458643946.17.0.878468383793.issue26610@psf.upfronthosting.co.za> Message-ID: <1458644542.05.0.824912627612.issue26610@psf.upfronthosting.co.za> Donald Stufft added the comment: It shouldn't be hard to make ctypes optional in pip, it's only used to check if the OS we're running on is "manylinux" compatible, roughly checking the glibc version number. Worst case we can just conditon that check on ctypes existing. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 07:18:02 2016 From: report at bugs.python.org (Roundup Robot) Date: Tue, 22 Mar 2016 11:18:02 +0000 Subject: [issue24266] raw_input + readline: Ctrl+C during search breaks readline In-Reply-To: <1432306683.9.0.470835567306.issue24266@psf.upfronthosting.co.za> Message-ID: <20160322111759.8609.46322.94669068@psf.io> Roundup Robot added the comment: New changeset af6e8e1d15fa by Martin Panter in branch '3.5': Issue #24266: Cancel history search mode with Ctrl+C in Readline 7 https://hg.python.org/cpython/rev/af6e8e1d15fa New changeset 322d30816d36 by Martin Panter in branch 'default': Issue #24266: Merge readline Ctrl+C handling from 3.5 https://hg.python.org/cpython/rev/322d30816d36 New changeset 1c0b29441116 by Martin Panter in branch '2.7': Issue #24266: Cancel history search mode with Ctrl+C in Readline 7 https://hg.python.org/cpython/rev/1c0b29441116 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 07:25:16 2016 From: report at bugs.python.org (Roundup Robot) Date: Tue, 22 Mar 2016 11:25:16 +0000 Subject: [issue26588] _tracemalloc: add support for multiple address spaces (domains) In-Reply-To: <1458337167.06.0.908004959718.issue26588@psf.upfronthosting.co.za> Message-ID: <20160322112512.61611.64774.94627D29@psf.io> Roundup Robot added the comment: New changeset 7c894911eb59 by Victor Stinner in branch 'default': Simplify implementation of hashtable.c https://hg.python.org/cpython/rev/7c894911eb59 New changeset cd9a40a5ea90 by Victor Stinner in branch 'default': Remove _Py_hashtable_delete() https://hg.python.org/cpython/rev/cd9a40a5ea90 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 07:59:10 2016 From: report at bugs.python.org (Roundup Robot) Date: Tue, 22 Mar 2016 11:59:10 +0000 Subject: [issue26588] _tracemalloc: add support for multiple address spaces (domains) In-Reply-To: <1458337167.06.0.908004959718.issue26588@psf.upfronthosting.co.za> Message-ID: <20160322115907.48758.33641.37BA0B1A@psf.io> Roundup Robot added the comment: New changeset b86cdebe0e97 by Victor Stinner in branch 'default': tracemalloc now supports domains https://hg.python.org/cpython/rev/b86cdebe0e97 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 08:42:19 2016 From: report at bugs.python.org (Roundup Robot) Date: Tue, 22 Mar 2016 12:42:19 +0000 Subject: [issue26530] tracemalloc: add C API to manually track/untrack memory allocations In-Reply-To: <1457619430.68.0.0968942184372.issue26530@psf.upfronthosting.co.za> Message-ID: <20160322124216.19481.4699.3F3BBEC0@psf.io> Roundup Robot added the comment: New changeset 60655e543d8a by Victor Stinner in branch 'default': Add C functions _PyTraceMalloc_Track() https://hg.python.org/cpython/rev/60655e543d8a ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 08:54:14 2016 From: report at bugs.python.org (STINNER Victor) Date: Tue, 22 Mar 2016 12:54:14 +0000 Subject: [issue26530] tracemalloc: add C API to manually track/untrack memory allocations In-Reply-To: <1457619430.68.0.0968942184372.issue26530@psf.upfronthosting.co.za> Message-ID: <1458651254.45.0.191701463255.issue26530@psf.upfronthosting.co.za> STINNER Victor added the comment: Ok, I added the following C functions: int _PyTraceMalloc_Track(_PyTraceMalloc_domain_t domain, Py_uintptr_t ptr, size_t size); int _PyTraceMalloc_Untrack(_PyTraceMalloc_domain_t domain, Py_uintptr_t ptr); Antoine, Nathaniel: Please play with it, I'm waiting for your feedback on the API. _PyTraceMalloc_Track() acquires the GIL for you if it was released. I suggest to not call it from a C thread. If you want to use it from a C thread, it's better to initialize manually the Python thread state on this thread (see issue #20891) before using _PyTraceMalloc_Track(). -- _PyTraceMalloc_domain_t is an unsigned int. The type name is annoying (too long). Maybe "unsigned int" would be more readable :-) What do you think? Maybe an unsigned short is enough? _tracemalloc.c tries to use a packed structure to limit the memory footprint. -- I chose to use the Py_uintptr_t type for the pointer instead of void*, but there is a problem with that. It gives a false hint on the expected type. In fact, the hashtable is really optimized for pointers, the hash function uses _Py_HashPointer(): /* bottom 3 or 4 bits are likely to be 0; rotate y by 4 to avoid excessive hash collisions for dicts and sets */ It means that tracking file descriptor (int fd) may create a lot of a hash collisions. Well, if you handle a few file descriptors (less than 100?), it's maybe ok. If you handle tons of file descriptors, we should maybe make the hash function more configurable. Maybe even per domain? Do you think that void* would be less a lie? :-) What do you prefer? -- I also added a function to get the traceback where a memory block was allocated: PyObject* _PyTraceMalloc_GetTraceback(_PyTraceMalloc_domain_t domain, Py_uintptr_t ptr); But you should not use it, it's written for unit tests. You have to wrap the result into a tracemalloc.Traceback object: def get_traceback(self): frames = _testcapi.tracemalloc_get_traceback(self.domain, self.ptr) if frames is not None: return tracemalloc.Traceback(frames) else: return None If this feature is useful, it should be added to the official Python API, the tracemalloc.py module. Currently, there is a tracemalloc.get_object_traceback(obj) function which is restricted to the domain 0 and expects a Python object, not a raw pointer. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 08:56:49 2016 From: report at bugs.python.org (STINNER Victor) Date: Tue, 22 Mar 2016 12:56:49 +0000 Subject: [issue26588] _tracemalloc: add support for multiple address spaces (domains) In-Reply-To: <1458337167.06.0.908004959718.issue26588@psf.upfronthosting.co.za> Message-ID: <1458651409.59.0.902288331678.issue26588@psf.upfronthosting.co.za> STINNER Victor added the comment: > New changeset b86cdebe0e97 by Victor Stinner in branch 'default': > tracemalloc now supports domains > https://hg.python.org/cpython/rev/b86cdebe0e97 I hate working on huge patches, it's a pain to rebase them. I chose to push a first implementation to unblock the issue #26530 "tracemalloc: add C API to manually track/untrack memory allocations". I'm interested by your feedback on the C API. The C implementation can still be changed later. For example, I chose to push a first implementation which *always* store domain_t in traces keys. Later, I will write a patch to switch from the compact key (Py_uintptr_t) to key using domain (pointer_t) dynamically. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 09:18:54 2016 From: report at bugs.python.org (Steve Dower) Date: Tue, 22 Mar 2016 13:18:54 +0000 Subject: [issue26598] Embbedable zip does not import modules in (zip)subdirectory In-Reply-To: <1458536716.69.0.0292011453311.issue26598@psf.upfronthosting.co.za> Message-ID: <1458652734.87.0.121703104299.issue26598@psf.upfronthosting.co.za> Steve Dower added the comment: Are you making a debug build? It might be looking for _ctypes_d.pyd in that case. You'll need a release build for the embeddable distro, as well as including the pyds from the zip in sys.path - they need to be standalone files. The embeddable release is meant only for redistribution, so you should build and test against a full install (including debug binaries if you want) and do integration testing with the embeddable package and a release build. (So Zach, yes, it's deliberate.) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 09:38:21 2016 From: report at bugs.python.org (Chris Mitchell) Date: Tue, 22 Mar 2016 13:38:21 +0000 Subject: [issue26611] assertRaises callableObj cannot be used as a keyword with args Message-ID: <1458653901.28.0.305409918599.issue26611@psf.upfronthosting.co.za> New submission from Chris Mitchell: assertRaises has callableObj listed as a keyword, though it is not possible to use it as a keyword when the callableObj takes arguments. The function definition is: def assertRaises(self, excClass, callableObj=None, *args, **kwargs): Therefore, using it with a keyword such as: self.assertRaises(Exception, callableObj=my_function, args_to_function) will fail due to passing arguments after a keyword. ---------- components: Tests messages: 262183 nosy: Chris Mitchell priority: normal severity: normal status: open title: assertRaises callableObj cannot be used as a keyword with args type: crash versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 09:51:27 2016 From: report at bugs.python.org (SilentGhost) Date: Tue, 22 Mar 2016 13:51:27 +0000 Subject: [issue26611] assertRaises callableObj cannot be used as a keyword with args In-Reply-To: <1458653901.28.0.305409918599.issue26611@psf.upfronthosting.co.za> Message-ID: <1458654687.31.0.651936159745.issue26611@psf.upfronthosting.co.za> SilentGhost added the comment: Documentation [0] has callable listed as a positional argument, and this is how it should be used. [0] https://docs.python.org/2.7/library/unittest.html#unittest.TestCase.assertRaises ---------- nosy: +SilentGhost resolution: -> not a bug stage: -> resolved status: open -> closed type: crash -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 10:37:16 2016 From: report at bugs.python.org (STINNER Victor) Date: Tue, 22 Mar 2016 14:37:16 +0000 Subject: [issue26588] _tracemalloc: add support for multiple address spaces (domains) In-Reply-To: <1458337167.06.0.908004959718.issue26588@psf.upfronthosting.co.za> Message-ID: <1458657436.54.0.863420349872.issue26588@psf.upfronthosting.co.za> STINNER Victor added the comment: Crap. I expected the set_reentrant() bug to be fixed, but I saw it one more time on the latest build (revision 0da4532a893389bd1ee1ddfe8227750d968023ba): http://buildbot.python.org/all/builders/s390x%20RHEL%203.x/builds/817/steps/test/logs/stdio 0:02:54 [103/400] test_tracemalloc python: ./Modules/_tracemalloc.c:194: set_reentrant: Assertion `PyThread_get_key_value(tracemalloc_reentrant_key) == ((PyObject *) &_Py_TrueStruct)' failed. Fatal Python error: Aborted Current thread 0x000003fffcd7b6f0 (most recent call first): File "/home/dje/cpython-buildarea/3.x.edelsohn-rhel-z/build/Lib/test/test_tracemalloc.py", line 94 in setUp File "/home/dje/cpython-buildarea/3.x.edelsohn-rhel-z/build/Lib/unittest/case.py", line 596 in run File "/home/dje/cpython-buildarea/3.x.edelsohn-rhel-z/build/Lib/unittest/case.py", line 648 in __call__ File "/home/dje/cpython-buildarea/3.x.edelsohn-rhel-z/build/Lib/unittest/suite.py", line 122 in run File "/home/dje/cpython-buildarea/3.x.edelsohn-rhel-z/build/Lib/unittest/suite.py", line 84 in __call__ File "/home/dje/cpython-buildarea/3.x.edelsohn-rhel-z/build/Lib/unittest/suite.py", line 122 in run File "/home/dje/cpython-buildarea/3.x.edelsohn-rhel-z/build/Lib/unittest/suite.py", line 84 in __call__ File "/home/dje/cpython-buildarea/3.x.edelsohn-rhel-z/build/Lib/unittest/runner.py", line 176 in run File "/home/dje/cpython-buildarea/3.x.edelsohn-rhel-z/build/Lib/test/support/__init__.py", line 1802 in _run_suite File "/home/dje/cpython-buildarea/3.x.edelsohn-rhel-z/build/Lib/test/support/__init__.py", line 1836 in run_unittest File "/home/dje/cpython-buildarea/3.x.edelsohn-rhel-z/build/Lib/test/test_tracemalloc.py", line 989 in test_main File "/home/dje/cpython-buildarea/3.x.edelsohn-rhel-z/build/Lib/test/libregrtest/runtest.py", line 162 in runtest_inner File "/home/dje/cpython-buildarea/3.x.edelsohn-rhel-z/build/Lib/test/libregrtest/runtest.py", line 115 in runtest File "/home/dje/cpython-buildarea/3.x.edelsohn-rhel-z/build/Lib/test/libregrtest/main.py", line 306 in run_tests_sequential File "/home/dje/cpython-buildarea/3.x.edelsohn-rhel-z/build/Lib/test/libregrtest/main.py", line 367 in run_tests File "/home/dje/cpython-buildarea/3.x.edelsohn-rhel-z/build/Lib/test/libregrtest/main.py", line 405 in main File "/home/dje/cpython-buildarea/3.x.edelsohn-rhel-z/build/Lib/test/libregrtest/main.py", line 446 in main File "/home/dje/cpython-buildarea/3.x.edelsohn-rhel-z/build/Lib/test/libregrtest/main.py", line 468 in main_in_temp_cwd File "/home/dje/cpython-buildarea/3.x.edelsohn-rhel-z/build/Lib/test/__main__.py", line 3 in File "/home/dje/cpython-buildarea/3.x.edelsohn-rhel-z/build/Lib/runpy.py", line 85 in _run_code File "/home/dje/cpython-buildarea/3.x.edelsohn-rhel-z/build/Lib/runpy.py", line 184 in _run_module_as_main make: *** [buildbottest] Aborted ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 10:47:20 2016 From: report at bugs.python.org (Simon) Date: Tue, 22 Mar 2016 14:47:20 +0000 Subject: [issue26598] Embbedable zip does not import modules in (zip)subdirectory In-Reply-To: <1458536716.69.0.0292011453311.issue26598@psf.upfronthosting.co.za> Message-ID: <1458658040.9.0.858422168922.issue26598@psf.upfronthosting.co.za> Simon added the comment: Yes, it was a debug build, I didn't know it only works in release, that's the part I was clearly missing. It would be great if we could have a debug embeddable zip file, but I understand that it might be asking for a bit much. Is the project that builds all the pyds available? Maybe I could create my own embeddable debug zip. Thanks ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 10:50:16 2016 From: report at bugs.python.org (py.user) Date: Tue, 22 Mar 2016 14:50:16 +0000 Subject: [issue15660] Clarify 0 prefix for width specifier in str.format doc, In-Reply-To: <1345004440.11.0.680139192916.issue15660@psf.upfronthosting.co.za> Message-ID: <1458658216.46.0.659727296093.issue15660@psf.upfronthosting.co.za> py.user added the comment: Terry J. Reedy (terry.reedy) wrote: > You example says to left justify '1' Nope. The fill character goes before alignment in the specification (grammatics). >>> format(1, '0<2') '10' >>> This is right. But 02 - is zero padding of a number which can be done only from the left side. '<02' means "justify to the left zero padded number" ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 11:08:10 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 22 Mar 2016 15:08:10 +0000 Subject: [issue16151] Deferred KeyboardInterrupt in interactive mode In-Reply-To: <1349551962.43.0.949416732292.issue16151@psf.upfronthosting.co.za> Message-ID: <1458659290.9.0.288266976331.issue16151@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- resolution: -> out of date stage: test needed -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 11:14:07 2016 From: report at bugs.python.org (Roundup Robot) Date: Tue, 22 Mar 2016 15:14:07 +0000 Subject: [issue26588] _tracemalloc: add support for multiple address spaces (domains) In-Reply-To: <1458337167.06.0.908004959718.issue26588@psf.upfronthosting.co.za> Message-ID: <20160322151357.48776.14142.7394830C@psf.io> Roundup Robot added the comment: New changeset 4ec81b497a84 by Victor Stinner in branch 'default': Issue #26588: add debug traces https://hg.python.org/cpython/rev/4ec81b497a84 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 11:21:11 2016 From: report at bugs.python.org (Simon) Date: Tue, 22 Mar 2016 15:21:11 +0000 Subject: [issue26598] Embbedable zip does not import modules in (zip)subdirectory In-Reply-To: <1458536716.69.0.0292011453311.issue26598@psf.upfronthosting.co.za> Message-ID: <1458660071.34.0.947918512334.issue26598@psf.upfronthosting.co.za> Simon added the comment: Not sure if I should be closing the issue or if you should. I think it is not an issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 11:29:26 2016 From: report at bugs.python.org (Roundup Robot) Date: Tue, 22 Mar 2016 15:29:26 +0000 Subject: [issue26588] _tracemalloc: add support for multiple address spaces (domains) In-Reply-To: <1458337167.06.0.908004959718.issue26588@psf.upfronthosting.co.za> Message-ID: <20160322152908.53380.92695.E66C2C52@psf.io> Roundup Robot added the comment: New changeset 340ed3ff2656 by Victor Stinner in branch 'default': Issue #26588: fix compilation on Windows https://hg.python.org/cpython/rev/340ed3ff2656 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 11:44:00 2016 From: report at bugs.python.org (Guido van Rossum) Date: Tue, 22 Mar 2016 15:44:00 +0000 Subject: [issue26396] Create json.JSONType In-Reply-To: <1456015468.57.0.0882861590724.issue26396@psf.upfronthosting.co.za> Message-ID: <1458661440.68.0.638379285172.issue26396@psf.upfronthosting.co.za> Guido van Rossum added the comment: I'm fine with the patch here. Go for it! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 11:51:48 2016 From: report at bugs.python.org (Brett Cannon) Date: Tue, 22 Mar 2016 15:51:48 +0000 Subject: [issue26396] Create json.JSONType In-Reply-To: <1456015468.57.0.0882861590724.issue26396@psf.upfronthosting.co.za> Message-ID: <1458661908.56.0.749010922288.issue26396@psf.upfronthosting.co.za> Brett Cannon added the comment: I'll add some tests and a note that this was added in Python 3.6 and is provisional along with the typing module. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 12:01:53 2016 From: report at bugs.python.org (Wolfgang Langner) Date: Tue, 22 Mar 2016 16:01:53 +0000 Subject: [issue26587] Possible duplicate entries in sys.path if .pth files are used with zip's In-Reply-To: <1458296580.88.0.236395091392.issue26587@psf.upfronthosting.co.za> Message-ID: <1458662513.24.0.960386972012.issue26587@psf.upfronthosting.co.za> Wolfgang Langner added the comment: I think a fix for 3.6 only is ok, because it changes behaviour. But this is only an internal function with a "_". Should I add a test with a temporary created pth file? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 12:14:53 2016 From: report at bugs.python.org (Zachary Ware) Date: Tue, 22 Mar 2016 16:14:53 +0000 Subject: [issue26598] Embbedable zip does not import modules in (zip)subdirectory In-Reply-To: <1458536716.69.0.0292011453311.issue26598@psf.upfronthosting.co.za> Message-ID: <1458663293.73.0.163128770998.issue26598@psf.upfronthosting.co.za> Zachary Ware added the comment: Each of the .pyd files has its own .vcxproj in PCbuild. You might be able to make use of pcbuild.sln or pcbuild.proj, each of which include all of the various project files. ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 12:23:34 2016 From: report at bugs.python.org (Brett Cannon) Date: Tue, 22 Mar 2016 16:23:34 +0000 Subject: [issue26587] Possible duplicate entries in sys.path if .pth files are used with zip's In-Reply-To: <1458296580.88.0.236395091392.issue26587@psf.upfronthosting.co.za> Message-ID: <1458663814.38.0.716877243868.issue26587@psf.upfronthosting.co.za> Brett Cannon added the comment: Unfortunately you can't simply remove that directory check because you don't want to blindly normalize case. If someone put some token value on sys.path for their use that was case-sensitive even on a case-insensitive OS then the proposed change would break those semantics (e.g. if someone put a URL in sys.path for a REST-based importer). The possibilities I see are: 1. Don't change anything; duplicate entries don't really hurt anything 2. Remove duplicate entries, but only normalize case for directories 3. Remove duplicate entries, but normalize case for anything that points to something on the filesystem (i.e. both directories and files) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 12:23:59 2016 From: report at bugs.python.org (Brett Cannon) Date: Tue, 22 Mar 2016 16:23:59 +0000 Subject: [issue26587] Possible duplicate entries in sys.path if .pth files are used with zip's In-Reply-To: <1458296580.88.0.236395091392.issue26587@psf.upfronthosting.co.za> Message-ID: <1458663839.89.0.32395903532.issue26587@psf.upfronthosting.co.za> Brett Cannon added the comment: And the code under discussion can be found at https://hg.python.org/cpython/file/default/Lib/site.py#l133 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 12:35:20 2016 From: report at bugs.python.org (Steve Dower) Date: Tue, 22 Mar 2016 16:35:20 +0000 Subject: [issue26598] Embbedable zip does not import modules in (zip)subdirectory In-Reply-To: <1458536716.69.0.0292011453311.issue26598@psf.upfronthosting.co.za> Message-ID: <1458664520.09.0.834115097773.issue26598@psf.upfronthosting.co.za> Steve Dower added the comment: Unless you're working on CPython itself, I'd suggest just installing the debug binaries through the installer. I've made a note to write a blog post on how to use the embeddable distro, so when that comes out (in a few weeks, probably) hopefully it will help answer these questions. Then I'll look at merging the parts of that which would be good documentation into the Doc/using/windows.rst page. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 12:41:46 2016 From: report at bugs.python.org (Roundup Robot) Date: Tue, 22 Mar 2016 16:41:46 +0000 Subject: [issue26588] _tracemalloc: add support for multiple address spaces (domains) In-Reply-To: <1458337167.06.0.908004959718.issue26588@psf.upfronthosting.co.za> Message-ID: <20160322164142.8593.73946.8C6BE7AC@psf.io> Roundup Robot added the comment: New changeset bbdb24611294 by Victor Stinner in branch 'default': Issue #26588: more assertions https://hg.python.org/cpython/rev/bbdb24611294 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 12:44:18 2016 From: report at bugs.python.org (Steve Dower) Date: Tue, 22 Mar 2016 16:44:18 +0000 Subject: [issue25251] Unknown MS Compiler version 1900 In-Reply-To: <1443392264.43.0.443478210283.issue25251@psf.upfronthosting.co.za> Message-ID: <1458665058.4.0.709712401945.issue25251@psf.upfronthosting.co.za> Steve Dower added the comment: Please test your extensions thoroughly when building with MinGW, especially if you're planning on distributing wheels on PyPI. CPython assumes an ABI compatible with what MSVC would have built, and mixing ABIs will lead to crashes or data corruption. (I'm not just trying to be scary here, this is basically guaranteed to occur when you mix C Runtime libraries.) Currently the only fully compatible MinGW I'm aware of (mingwpy - https://bitbucket.org/carlkl/mingw-w64-for-python) is still in development, though it appears to be ready for numpy and scipy, which is awesome. But just because "compiler=mingw32" appears to work, it doesn't make it inherently a good idea. (As an aside, you can get the right version of MSVC for Python 3.5 and later from https://www.microsoft.com/en-us/download/details.aspx?id=49983 - you'll need to build inside the SDK's command line and set DISTUTILS_USE_SDK=1, but otherwise it is the right tools. We've already suggested that they should install in a way that setuptools can automatically detect and use them.) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 12:45:37 2016 From: report at bugs.python.org (SilentGhost) Date: Tue, 22 Mar 2016 16:45:37 +0000 Subject: [issue26587] Possible duplicate entries in sys.path if .pth files are used with zip's In-Reply-To: <1458296580.88.0.236395091392.issue26587@psf.upfronthosting.co.za> Message-ID: <1458665137.54.0.410453523317.issue26587@psf.upfronthosting.co.za> SilentGhost added the comment: I still think my fix is more appropriate as it ensures that known_paths and sys.path stay connected somehow. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 12:47:59 2016 From: report at bugs.python.org (Roundup Robot) Date: Tue, 22 Mar 2016 16:47:59 +0000 Subject: [issue26588] _tracemalloc: add support for multiple address spaces (domains) In-Reply-To: <1458337167.06.0.908004959718.issue26588@psf.upfronthosting.co.za> Message-ID: <20160322164756.962.68502.9AFA47A3@psf.io> Roundup Robot added the comment: New changeset 636fa01842f5 by Victor Stinner in branch 'default': Add assertions on tracemalloc_reentrant_key https://hg.python.org/cpython/rev/636fa01842f5 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 12:54:32 2016 From: report at bugs.python.org (STINNER Victor) Date: Tue, 22 Mar 2016 16:54:32 +0000 Subject: [issue26588] _tracemalloc: add support for multiple address spaces (domains) In-Reply-To: <1458337167.06.0.908004959718.issue26588@psf.upfronthosting.co.za> Message-ID: <1458665672.39.0.791764914731.issue26588@psf.upfronthosting.co.za> STINNER Victor added the comment: Oh, "s390x RHEL 3.x" and "AMD64 Debian root 3.x" buildbots use "-j 1" command line option. In practice, tests are not run in subprocesses, -j1 option is ignored (issue #25285). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 13:15:10 2016 From: report at bugs.python.org (Alexander Belopolsky) Date: Tue, 22 Mar 2016 17:15:10 +0000 Subject: [issue26200] SETREF adds unnecessary work in some cases In-Reply-To: <1453745024.51.0.674954872761.issue26200@psf.upfronthosting.co.za> Message-ID: <1458666910.88.0.804374763357.issue26200@psf.upfronthosting.co.za> Changes by Alexander Belopolsky : ---------- nosy: +belopolsky _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 13:17:36 2016 From: report at bugs.python.org (SilentGhost) Date: Tue, 22 Mar 2016 17:17:36 +0000 Subject: [issue10894] Making stdlib APIs private In-Reply-To: <1294838236.87.0.84648349826.issue10894@psf.upfronthosting.co.za> Message-ID: <1458667056.82.0.563599750334.issue10894@psf.upfronthosting.co.za> SilentGhost added the comment: I wonder if the devguide would be a more suitable place for these guidelines. Here is the patch that adds them to stdblibchanges.rst ---------- keywords: +patch stage: needs patch -> patch review versions: +Python 3.5, Python 3.6 -Python 3.4 Added file: http://bugs.python.org/file42244/issue10894.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 13:29:31 2016 From: report at bugs.python.org (Alexander Belopolsky) Date: Tue, 22 Mar 2016 17:29:31 +0000 Subject: [issue26200] SETREF adds unnecessary work in some cases In-Reply-To: <1453745024.51.0.674954872761.issue26200@psf.upfronthosting.co.za> Message-ID: <1458667771.99.0.569855291991.issue26200@psf.upfronthosting.co.za> Alexander Belopolsky added the comment: I am late to this discussion, but FWIW, I would like to back Raymond up. For me, Py_XDECREF is usually a sign of lazy programming and an optimization opportunity. In many cases I've seen, Py_XDECREF is used under a "done:" label and can be optimized by strategically placing Py_DECREFs before (error) returns while keeping track of what is and what is not initialized. In addition to an extra null check, Py_XDECREF typically requires a NULL initialization which can be avoided with a more thoughtful code structure. All in all, Py_XDECREF rightfully stands out with an "X" spelling. I don't want to see it hidden behind an innocent-looking convenience macro. I am ?0 on the XSETREF variant, but I think SETREF should use DECREF. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 13:47:51 2016 From: report at bugs.python.org (STINNER Victor) Date: Tue, 22 Mar 2016 17:47:51 +0000 Subject: [issue26588] _tracemalloc: add support for multiple address spaces (domains) In-Reply-To: <1458337167.06.0.908004959718.issue26588@psf.upfronthosting.co.za> Message-ID: <1458668871.42.0.551837336443.issue26588@psf.upfronthosting.co.za> STINNER Victor added the comment: Failure at revision 636fa01842f597bedff7054616c65a4784c92b4a on AMD64 Windows10 3.x (regrtest runs without the -j option, so all tests are run in the same thread). http://buildbot.python.org/all/builders/AMD64%20Windows10%203.x/builds/763/steps/test/logs/stdio --------- 0:12:37 [ 87/400/1] test_tracemalloc [pid 2864, tid 2624] tracemalloc_start() [pid 2864, tid 2624] tracemalloc_init() [pid 2864, tid 2624] tracemalloc_init(): exit (already initialized) Assertion failed: get_reentrant(), file ..\Modules\_tracemalloc.c, line 1057 Fatal Python error: Aborted Current thread 0x00000a40 (most recent call first): File "D:\buildarea\3.x.bolen-windows10\build\lib\test\test_tracemalloc.py", line 97 in setUp File "D:\buildarea\3.x.bolen-windows10\build\lib\unittest\case.py", line 596 in run File "D:\buildarea\3.x.bolen-windows10\build\lib\unittest\case.py", line 648 in __call__ File "D:\buildarea\3.x.bolen-windows10\build\lib\unittest\suite.py", line 122 in run File "D:\buildarea\3.x.bolen-windows10\build\lib\unittest\suite.py", line 84 in __call__ File "D:\buildarea\3.x.bolen-windows10\build\lib\unittest\suite.py", line 122 in run File "D:\buildarea\3.x.bolen-windows10\build\lib\unittest\suite.py", line 84 in __call__ File "D:\buildarea\3.x.bolen-windows10\build\lib\unittest\runner.py", line 176 in run File "D:\buildarea\3.x.bolen-windows10\build\lib\test\support\__init__.py", line 1802 in _run_suite File "D:\buildarea\3.x.bolen-windows10\build\lib\test\support\__init__.py", line 1836 in run_unittest File "D:\buildarea\3.x.bolen-windows10\build\lib\test\test_tracemalloc.py", line 999 in test_main File "D:\buildarea\3.x.bolen-windows10\build\lib\test\libregrtest\runtest.py", line 162 in runtest_inner File "D:\buildarea\3.x.bolen-windows10\build\lib\test\libregrtest\runtest.py", line 115 in runtest File "D:\buildarea\3.x.bolen-windows10\build\lib\test\libregrtest\main.py", line 306 in run_tests_sequential File "D:\buildarea\3.x.bolen-windows10\build\lib\test\libregrtest\main.py", line 367 in run_tests File "D:\buildarea\3.x.bolen-windows10\build\lib\test\libregrtest\main.py", line 405 in main File "D:\buildarea\3.x.bolen-windows10\build\lib\test\libregrtest\main.py", line 446 in main File "D:\buildarea\3.x.bolen-windows10\build\lib\test\libregrtest\main.py", line 468 in main_in_temp_cwd File "D:\buildarea\3.x.bolen-windows10\build\PCbuild\..\lib\test\regrtest.py", line 39 in --------- I understand that tracemalloc_start() was called with the first time and that get_reentrant() returns 0 at tracemalloc_start() entry, whereas tracemalloc_init() is supposed to set the reentrant flag to 1. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 13:52:17 2016 From: report at bugs.python.org (Roundup Robot) Date: Tue, 22 Mar 2016 17:52:17 +0000 Subject: [issue26588] _tracemalloc: add support for multiple address spaces (domains) In-Reply-To: <1458337167.06.0.908004959718.issue26588@psf.upfronthosting.co.za> Message-ID: <20160322175214.19467.49523.DF8D1AF9@psf.io> Roundup Robot added the comment: New changeset af388201c997 by Victor Stinner in branch 'default': Issue #26588: one more assertion https://hg.python.org/cpython/rev/af388201c997 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 14:16:24 2016 From: report at bugs.python.org (STINNER Victor) Date: Tue, 22 Mar 2016 18:16:24 +0000 Subject: [issue26588] _tracemalloc: add support for multiple address spaces (domains) In-Reply-To: <1458337167.06.0.908004959718.issue26588@psf.upfronthosting.co.za> Message-ID: <1458670584.05.0.843824058892.issue26588@psf.upfronthosting.co.za> STINNER Victor added the comment: Failure on "x86 Ubuntu Shared 3.x" at revision af388201c9976aebc4a8a433c95bfc4a1abe014b. I added an assertion in tracemalloc_init() to ensure that the reeentrant flag is set at the end of the function. The reentrant flag was no more set at tracemalloc_start() entry for an unknown reason. http://buildbot.python.org/all/builders/x86%20Ubuntu%20Shared%203.x/builds/12905/steps/test/logs/stdio --- 0:08:50 [183/400] test_tracemalloc [pid 14926, tid 1437466048] tracemalloc_start() [pid 14926, tid 1437466048] tracemalloc_init() [pid 14926, tid 1437466048] tracemalloc_init(): exit (already initialized) python: ./Modules/_tracemalloc.c:1058: tracemalloc_start: Assertion `get_reentrant()' failed. Fatal Python error: Aborted Current thread 0x55adfdc0 (most recent call first): File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/test/test_tracemalloc.py", line 97 in setUp File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/unittest/case.py", line 596 in run File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/unittest/case.py", line 648 in __call__ File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/unittest/suite.py", line 122 in run File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/unittest/suite.py", line 84 in __call__ File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/unittest/suite.py", line 122 in run File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/unittest/suite.py", line 84 in __call__ File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/unittest/runner.py", line 176 in run File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/test/support/__init__.py", line 1802 in _run_suite File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/test/support/__init__.py", line 1836 in run_unittest File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/test/test_tracemalloc.py", line 999 in test_main File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/test/libregrtest/runtest.py", line 162 in runtest_inner File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/test/libregrtest/runtest.py", line 115 in runtest File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/test/libregrtest/main.py", line 306 in run_tests_sequential File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/test/libregrtest/main.py", line 367 in run_tests File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/test/libregrtest/main.py", line 405 in main File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/test/libregrtest/main.py", line 446 in main File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/test/libregrtest/main.py", line 468 in main_in_temp_cwd File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/test/__main__.py", line 3 in File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/runpy.py", line 85 in _run_code File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/runpy.py", line 184 in _run_module_as_main --- ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 15:32:34 2016 From: report at bugs.python.org (Brett Cannon) Date: Tue, 22 Mar 2016 19:32:34 +0000 Subject: [issue26396] Create json.JSONType In-Reply-To: <1456015468.57.0.0882861590724.issue26396@psf.upfronthosting.co.za> Message-ID: <1458675154.37.0.73339029606.issue26396@psf.upfronthosting.co.za> Brett Cannon added the comment: Based on conversations in https://github.com/python/typing/issues/182 I'm closing this as rejected. ---------- resolution: -> rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 15:32:41 2016 From: report at bugs.python.org (SilentGhost) Date: Tue, 22 Mar 2016 19:32:41 +0000 Subject: [issue26607] Rename a parameter in the function PyFile_FromFile In-Reply-To: <1458608248.15.0.411185943215.issue26607@psf.upfronthosting.co.za> Message-ID: <1458675161.45.0.632297431789.issue26607@psf.upfronthosting.co.za> Changes by SilentGhost : ---------- components: +Interpreter Core nosy: +benjamin.peterson, serhiy.storchaka stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 15:46:36 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 22 Mar 2016 19:46:36 +0000 Subject: [issue26607] Rename a parameter in the function PyFile_FromFile In-Reply-To: <1458608248.15.0.411185943215.issue26607@psf.upfronthosting.co.za> Message-ID: <1458675996.28.0.781811698244.issue26607@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: I would say this is an issue of a static analysis tool, not Python sources. ---------- resolution: -> not a bug _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 15:54:01 2016 From: report at bugs.python.org (SilentGhost) Date: Tue, 22 Mar 2016 19:54:01 +0000 Subject: [issue26607] Rename a parameter in the function PyFile_FromFile In-Reply-To: <1458608248.15.0.411185943215.issue26607@psf.upfronthosting.co.za> Message-ID: <1458676441.55.0.580203006279.issue26607@psf.upfronthosting.co.za> Changes by SilentGhost : ---------- stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 16:06:15 2016 From: report at bugs.python.org (Roundup Robot) Date: Tue, 22 Mar 2016 20:06:15 +0000 Subject: [issue26588] _tracemalloc: add support for multiple address spaces (domains) In-Reply-To: <1458337167.06.0.908004959718.issue26588@psf.upfronthosting.co.za> Message-ID: <20160322200612.30593.18626.5014CE5A@psf.io> Roundup Robot added the comment: New changeset f2d64f91d992 by Victor Stinner in branch 'default': Issue #26588: Don't call tracemalloc_init() at module initilization https://hg.python.org/cpython/rev/f2d64f91d992 New changeset d0b2f70731fb by Victor Stinner in branch 'default': Issue #26588: more debug traces https://hg.python.org/cpython/rev/d0b2f70731fb ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 16:26:38 2016 From: report at bugs.python.org (Roundup Robot) Date: Tue, 22 Mar 2016 20:26:38 +0000 Subject: [issue26588] _tracemalloc: add support for multiple address spaces (domains) In-Reply-To: <1458337167.06.0.908004959718.issue26588@psf.upfronthosting.co.za> Message-ID: <20160322202635.30609.56268.BD98D35B@psf.io> Roundup Robot added the comment: New changeset 708beeb65026 by Victor Stinner in branch 'default': Issue #26588: skip test_warnings.test_tracemalloc() https://hg.python.org/cpython/rev/708beeb65026 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 17:32:48 2016 From: report at bugs.python.org (STINNER Victor) Date: Tue, 22 Mar 2016 21:32:48 +0000 Subject: [issue26588] _tracemalloc: add support for multiple address spaces (domains) In-Reply-To: <1458337167.06.0.908004959718.issue26588@psf.upfronthosting.co.za> Message-ID: <1458682368.31.0.112052640425.issue26588@psf.upfronthosting.co.za> STINNER Victor added the comment: The bug was seen on 5 buildbots yet: * http://buildbot.python.org/all/builders/PPC64%20Fedora%203.x/ * http://buildbot.python.org/all/builders/AMD64%20Debian%20root%203.x/ * http://buildbot.python.org/all/builders/s390x%20RHEL%203.x/ * http://buildbot.python.org/all/builders/AMD64%20Windows10%203.x/ * http://buildbot.python.org/all/builders/x86%20Ubuntu%20Shared%203.x/ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 17:47:14 2016 From: report at bugs.python.org (Martin Panter) Date: Tue, 22 Mar 2016 21:47:14 +0000 Subject: [issue24266] raw_input + readline: Ctrl+C during search breaks readline In-Reply-To: <1432306683.9.0.470835567306.issue24266@psf.upfronthosting.co.za> Message-ID: <1458683234.55.0.256330803831.issue24266@psf.upfronthosting.co.za> Changes by Martin Panter : ---------- resolution: -> fixed stage: commit review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 17:49:27 2016 From: report at bugs.python.org (Antoine Pitrou) Date: Tue, 22 Mar 2016 21:49:27 +0000 Subject: [issue24266] raw_input + readline: Ctrl+C during search breaks readline In-Reply-To: <1432306683.9.0.470835567306.issue24266@psf.upfronthosting.co.za> Message-ID: <1458683367.47.0.701425897224.issue24266@psf.upfronthosting.co.za> Antoine Pitrou added the comment: Thanks for fixing this! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 17:59:00 2016 From: report at bugs.python.org (John O'Connor) Date: Tue, 22 Mar 2016 21:59:00 +0000 Subject: [issue21423] concurrent.futures.ThreadPoolExecutor/ProcessPoolExecutor should accept an initializer argument In-Reply-To: <1399160288.58.0.274862722075.issue21423@psf.upfronthosting.co.za> Message-ID: <1458683940.92.0.511825035648.issue21423@psf.upfronthosting.co.za> Changes by John O'Connor : ---------- nosy: +jcon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 19:20:15 2016 From: report at bugs.python.org (Roundup Robot) Date: Tue, 22 Mar 2016 23:20:15 +0000 Subject: [issue26588] _tracemalloc: add support for multiple address spaces (domains) In-Reply-To: <1458337167.06.0.908004959718.issue26588@psf.upfronthosting.co.za> Message-ID: <20160322232011.30593.72213.9CC9BAC6@psf.io> Roundup Robot added the comment: New changeset c6f30e2731af by Victor Stinner in branch 'default': Issue #26588: remove debug traces from _tracemalloc. https://hg.python.org/cpython/rev/c6f30e2731af New changeset af1c1149784a by Victor Stinner in branch '3.5': Fix _tracemalloc start/stop https://hg.python.org/cpython/rev/af1c1149784a New changeset 2b4731e22df8 by Victor Stinner in branch '3.5': Enhance _tracemalloc debug mode https://hg.python.org/cpython/rev/2b4731e22df8 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 19:21:03 2016 From: report at bugs.python.org (STINNER Victor) Date: Tue, 22 Mar 2016 23:21:03 +0000 Subject: [issue26588] _tracemalloc: add support for multiple address spaces (domains) In-Reply-To: <1458337167.06.0.908004959718.issue26588@psf.upfronthosting.co.za> Message-ID: <1458688863.96.0.655678017496.issue26588@psf.upfronthosting.co.za> STINNER Victor added the comment: Ooook, I think that I found and fixed the random failures in the change af1c1149784a. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 19:23:37 2016 From: report at bugs.python.org (STINNER Victor) Date: Tue, 22 Mar 2016 23:23:37 +0000 Subject: [issue26610] test_venv.test_with_pip() fails when ctypes is missing In-Reply-To: <1458643946.17.0.878468383793.issue26610@psf.upfronthosting.co.za> Message-ID: <1458689017.73.0.819234474569.issue26610@psf.upfronthosting.co.za> STINNER Victor added the comment: > It shouldn't be hard to make ctypes optional in pip, it's only used to check if the OS we're running on is "manylinux" compatible, roughly checking the glibc version number. These checks look low level, so it makes sense to use ctypes for that. > Worst case we can just conditon that check on ctypes existing. Do you mean skipping the new "manylinux" thing if ctypes is missing? If yes, I agree with this option. In practice, types is only missing in very rare cases. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 19:38:35 2016 From: report at bugs.python.org (Roundup Robot) Date: Tue, 22 Mar 2016 23:38:35 +0000 Subject: [issue26604] Add optional source parameter to warnings.warn() In-Reply-To: <1458577113.4.0.161652506992.issue26604@psf.upfronthosting.co.za> Message-ID: <20160322233833.13984.13366.81FF7D42@psf.io> Roundup Robot added the comment: New changeset 3a57ced47459 by Victor Stinner in branch 'default': Add a source parameter to warnings.warn() https://hg.python.org/cpython/rev/3a57ced47459 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 19:44:18 2016 From: report at bugs.python.org (Roundup Robot) Date: Tue, 22 Mar 2016 23:44:18 +0000 Subject: [issue26603] os.scandir: implement finalizer (for ResourceWarning) In-Reply-To: <1458576446.66.0.754431143479.issue26603@psf.upfronthosting.co.za> Message-ID: <20160322234414.61617.94583.95B7C30B@psf.io> Roundup Robot added the comment: New changeset b65d783cfe3b by Victor Stinner in branch 'default': Implement finalizer for os.scandir() iterator https://hg.python.org/cpython/rev/b65d783cfe3b ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 19:56:04 2016 From: report at bugs.python.org (Roundup Robot) Date: Tue, 22 Mar 2016 23:56:04 +0000 Subject: [issue26592] _warnings.warn_explicit() should try to import the warnings module In-Reply-To: <1458394454.81.0.10940568277.issue26592@psf.upfronthosting.co.za> Message-ID: <20160322235600.98655.74349.EA5AD3C1@psf.io> Roundup Robot added the comment: New changeset 53343d095f78 by Victor Stinner in branch 'default': _warnings.warn_explicit(): try to import warnings https://hg.python.org/cpython/rev/53343d095f78 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 19:56:19 2016 From: report at bugs.python.org (STINNER Victor) Date: Tue, 22 Mar 2016 23:56:19 +0000 Subject: [issue26592] _warnings.warn_explicit() should try to import the warnings module In-Reply-To: <1458394454.81.0.10940568277.issue26592@psf.upfronthosting.co.za> Message-ID: <1458690979.44.0.891546646425.issue26592@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- resolution: -> fixed status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 19:56:32 2016 From: report at bugs.python.org (STINNER Victor) Date: Tue, 22 Mar 2016 23:56:32 +0000 Subject: [issue26603] os.scandir: implement finalizer (for ResourceWarning) In-Reply-To: <1458576446.66.0.754431143479.issue26603@psf.upfronthosting.co.za> Message-ID: <1458690992.31.0.390932202377.issue26603@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- resolution: -> fixed status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 19:56:48 2016 From: report at bugs.python.org (STINNER Victor) Date: Tue, 22 Mar 2016 23:56:48 +0000 Subject: [issue26604] Add optional source parameter to warnings.warn() In-Reply-To: <1458577113.4.0.161652506992.issue26604@psf.upfronthosting.co.za> Message-ID: <1458691008.38.0.109366393862.issue26604@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- resolution: -> fixed status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 19:59:10 2016 From: report at bugs.python.org (STINNER Victor) Date: Tue, 22 Mar 2016 23:59:10 +0000 Subject: [issue26588] _tracemalloc: add support for multiple address spaces (domains) In-Reply-To: <1458337167.06.0.908004959718.issue26588@psf.upfronthosting.co.za> Message-ID: <1458691150.38.0.500344392314.issue26588@psf.upfronthosting.co.za> STINNER Victor added the comment: TODO for this issue: smart storage in _tracemalloc for trace keys. Use compact void* key until the first domain != 0 is used. ---------- resolution: -> fixed status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 20:00:33 2016 From: report at bugs.python.org (STINNER Victor) Date: Wed, 23 Mar 2016 00:00:33 +0000 Subject: [issue26588] _tracemalloc: add support for multiple address spaces (domains) In-Reply-To: <1458337167.06.0.908004959718.issue26588@psf.upfronthosting.co.za> Message-ID: <1458691233.94.0.313412338378.issue26588@psf.upfronthosting.co.za> STINNER Victor added the comment: (Ooops, I closed the bug by mistake.) ---------- resolution: fixed -> status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 20:47:46 2016 From: report at bugs.python.org (STINNER Victor) Date: Wed, 23 Mar 2016 00:47:46 +0000 Subject: [issue26612] test_ssl: use context manager (with) to fix ResourceWarning Message-ID: <1458694066.07.0.537208093993.issue26612@psf.upfronthosting.co.za> New submission from STINNER Victor: Attached patch modifies Lib/test/test_ssl.py to use "with socket:" instead of "try: ... finally: socket.close()" or similar patterns. Our PPC64 AIX 3.x buildbot has a broken ssl module. A lot of tests logs ResourceWarning on unclosed sockets, because errors occur before the test closes a socket. http://buildbot.python.org/all/builders/PPC64%20AIX%203.x/builds/4714/steps/test/logs/stdio test_connect_ex_error (test.test_ssl.NetworkedTests) ... ok test_connect_with_context (test.test_ssl.NetworkedTests) ... FAIL /home/shager/cpython-buildarea/3.x.edelsohn-aix-ppc64/build/Lib/unittest/case.py:628: ResourceWarning: unclosed outcome.errors.clear() ---------- files: test_ssl_with.patch keywords: patch messages: 262222 nosy: haypo priority: normal severity: normal status: open title: test_ssl: use context manager (with) to fix ResourceWarning versions: Python 3.6 Added file: http://bugs.python.org/file42245/test_ssl_with.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 20:56:24 2016 From: report at bugs.python.org (Stubz) Date: Wed, 23 Mar 2016 00:56:24 +0000 Subject: [issue26613] Descriptor HowTo Guide - Typo Message-ID: <1458694584.31.0.177347934352.issue26613@psf.upfronthosting.co.za> New submission from Stubz: The last line has a typo ... Dict.fromkeys -> dict.fromkeys I am a newbie, but that was just a pain in the ass ... Worked my way thru this How to and spent an hour+ trying to sort a circular argument error... Was this intentional ? In as much as it was a pain in the ass, I think I got the concept sorted ... https://docs.python.org/3.5/howto/descriptor.html Static Methods and Class Methods This behavior is useful whenever the function only needs to have a class reference and does not care about any underlying data. One use for classmethods is to create alternate class constructors. In Python 2.3, the classmethod dict.fromkeys() creates a new dictionary from a list of keys. The pure Python equivalent is: class Dict(object): . . . def fromkeys(klass, iterable, value=None): "Emulate dict_fromkeys() in Objects/dictobject.c" d = klass() for key in iterable: d[key] = value return d fromkeys = classmethod(fromkeys) Now a new dictionary of unique keys can be constructed like this: >>> Dict.fromkeys('abracadabra') ---------- assignee: docs at python components: Documentation messages: 262223 nosy: docs at python, stubzpub priority: normal severity: normal status: open title: Descriptor HowTo Guide - Typo type: behavior versions: Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 21:06:05 2016 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 23 Mar 2016 01:06:05 +0000 Subject: [issue10894] Making stdlib APIs private In-Reply-To: <1294838236.87.0.84648349826.issue10894@psf.upfronthosting.co.za> Message-ID: <1458695165.2.0.906665095317.issue10894@psf.upfronthosting.co.za> Raymond Hettinger added the comment: Much of this is already in PEP 8 and doesn't need repeating. Also, the tone is somewhat judgmental, heavy handed, restrictive, and over-broad for my tastes. The last part seems to imply that we're going to change existing code in a way that may break user code. Our whole goal is to make migrating to Python 3 easier. The next to last part may create a pressure to document and promise some things that may be implementation specific details. I think we should let PEP 8 serve as the primary guideline. For new code, try to be as clear as possible on public versus private. For existing code, any changes should be considered on a case by case basis to strike the best balance between useful documentation versus over-specification versus breaking existing code by privatizing that which was unintentionally made public. Also, when it comes to documentation, there are many things which are public (such as pickling support, every magic method available, etc) which aren't discussed for every single class. The reason for this is that it tends to fill the documentation with clutter, making it hard for the more useful information to stand out. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 21:20:25 2016 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 23 Mar 2016 01:20:25 +0000 Subject: [issue26613] Descriptor HowTo Guide - Typo In-Reply-To: <1458694584.31.0.177347934352.issue26613@psf.upfronthosting.co.za> Message-ID: <1458696025.07.0.952034522661.issue26613@psf.upfronthosting.co.za> Raymond Hettinger added the comment: The last line is not a typo, it shows how to call the pure python version of the classmethod described above it. FWIW, I'm working a revision to this how-to guide that it easier to read. At the time it was written, it was the *only* documentation for the descriptors in that language and much of it was a direct translation from the underlying C code as an authoritative reference to that code. It was not really a newbie document (descriptors aren't a newbie topic) and was moved to the how-to guides because it was so popular. Since you're already "sorted", I'll close this tracker item. ---------- assignee: docs at python -> rhettinger nosy: +rhettinger resolution: -> not a bug status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 21:43:56 2016 From: report at bugs.python.org (Martin Panter) Date: Wed, 23 Mar 2016 01:43:56 +0000 Subject: [issue23735] Readline not adjusting width after resize with 6.3 In-Reply-To: <1426984974.32.0.405944458303.issue23735@psf.upfronthosting.co.za> Message-ID: <1458697436.72.0.789787751525.issue23735@psf.upfronthosting.co.za> Martin Panter added the comment: In configure.ac there are explicit checks for pre-2.1 Readline versions (and later versions). Maybe it is reasonable to require 4.0 these days. But I think this should only be done in the next Python version (3.6+). To support Editline (and pre-4.0 Readline versions), I agree some conditional #ifdef thing would probably be best. My version of Editline claims to support 4.2, but doesn?t have rl_resize_terminal(). I played with Readline 6.2 where this resize bug is not present. Getsignal() also returns SIG_DFL there, so I won?t worry too much about that :) But it seems everything else worked fairly smoothly with 6.2. If you register your own SIGWINCH handler, it seems to be chain called by Readline. However with the current patch there are three differences that I can see to the 6.2 behaviour: * it overrides the SIGWINCH handler at import * it does not chain to the old SIGWINCH handler * the handler in ?readline? is lost if another handler is set after import You say it didn?t work before 6.3; what did you try? Also, I think a custom SIGWINCH handler does currently work with 6.3, and the patch would break that. How do you mean that doesn?t work now? So I am still a bit concerned that in some circumstances the current patch could break working programs. Maybe there is a solution that doesn?t need an API change: Only register SIGWINCH in readline_until_enter_or_signal(), and chain call to the original handler as well. FWIW I am not a fan of signals, because they are hard to handle robustly. But in this case I don?t know of a good alternative. Perhaps we could call pselect() instead of select(), and mask SIGWINCH, but I doubt it is worth the effort (portablility problems?). Or maybe something similar to signal.set_wakeup_fd() would be better. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 21:52:26 2016 From: report at bugs.python.org (Martin Panter) Date: Wed, 23 Mar 2016 01:52:26 +0000 Subject: [issue26612] test_ssl: use context manager (with) to fix ResourceWarning In-Reply-To: <1458694066.07.0.537208093993.issue26612@psf.upfronthosting.co.za> Message-ID: <1458697946.92.0.922624292811.issue26612@psf.upfronthosting.co.za> Martin Panter added the comment: Wouldn?t it be better to fix the underlying problem with the test cases? As I understand it, that would also avoid the warnings :) Also, you can often use self.addCleanup(s.close), which saves a level of indentation (and associated noise in the annotate history). I used this technique in my remaining patch for Issue 25940. ---------- nosy: +martin.panter _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 21:53:55 2016 From: report at bugs.python.org (Martin Panter) Date: Wed, 23 Mar 2016 01:53:55 +0000 Subject: [issue26612] test_ssl: use context manager (with) to fix ResourceWarning In-Reply-To: <1458694066.07.0.537208093993.issue26612@psf.upfronthosting.co.za> Message-ID: <1458698035.2.0.186929091839.issue26612@psf.upfronthosting.co.za> Martin Panter added the comment: Also remember that sockets don?t do context management in Python 2, so this would bring more incompatibilies when merging tests between the two branches. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 22:26:31 2016 From: report at bugs.python.org (Martin Panter) Date: Wed, 23 Mar 2016 02:26:31 +0000 Subject: [issue13285] signal module ignores external signal changes In-Reply-To: <1319801278.56.0.946220269602.issue13285@psf.upfronthosting.co.za> Message-ID: <1458699991.22.0.522453128191.issue13285@psf.upfronthosting.co.za> Martin Panter added the comment: Also, the documentation currently suggests it returns None in these cases, but it actually returns SIG_DFL in at least one case (noticed in Issue 23735). FWIW Vilya?s opaque object sounds fairly sensible to me. Yes, it is ugly, but one does not look at Unix signals expecting to find beauty :) ---------- nosy: +martin.panter _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 22:31:10 2016 From: report at bugs.python.org (Martin Panter) Date: Wed, 23 Mar 2016 02:31:10 +0000 Subject: [issue23735] Readline not adjusting width after resize with 6.3 In-Reply-To: <1426984974.32.0.405944458303.issue23735@psf.upfronthosting.co.za> Message-ID: <1458700270.82.0.911424551722.issue23735@psf.upfronthosting.co.za> Martin Panter added the comment: Issue 13285 is open about tracking non-Python signal handlers. I also found Issue 2675 about curses SIGWINCH handling in the interactive interpreter or when the readline module is imported, and Issue 3948 about someone trying to use both readline and SIGWINCH. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 22:49:36 2016 From: report at bugs.python.org (Josh Rosenberg) Date: Wed, 23 Mar 2016 02:49:36 +0000 Subject: [issue26608] RLock undocumented behavior in case of multiple acquire In-Reply-To: <1458629798.26.0.210968234517.issue26608@psf.upfronthosting.co.za> Message-ID: <1458701376.11.0.696104187632.issue26608@psf.upfronthosting.co.za> Josh Rosenberg added the comment: Per the docs ( https://docs.python.org/3/library/threading.html#rlock-objects ): "To unlock the lock, a thread calls its release() method. acquire()/release() call pairs may be nested; only the final release() (the release() of the outermost pair) resets the lock to unlocked and allows another thread blocked in acquire() to proceed." The docs aren't super clear on the return type, but they aren't so overly specified as to make returning either True or 1 incorrect; they use lowercase "true" to describe the return value, which doesn't *have* to mean True, just something that evaluates as truthy. In 3.5 at least, it looks like both initial and subsequent acquires are all returning True, even when called without passing an argument; this actually violates the docs, which claim that not passing an argument means "There is no return value" (possibly only when there is contended acquisition, the wording is odd), when in fact a no-argument call returns True just like explicitly passing blocking as True. ---------- nosy: +josh.r _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 23:04:00 2016 From: report at bugs.python.org (nickeubank) Date: Wed, 23 Mar 2016 03:04:00 +0000 Subject: [issue26614] False/0 and True/1 collision when used as dict keys? Message-ID: <1458702240.3.0.550475924064.issue26614@psf.upfronthosting.co.za> New submission from nickeubank: Found an odd behavior I'd never known about today, not sure if it's a bug or known. Python 3.4.4 (anaconda) True, False, 0, 1 can all be used as dictionary keys. But Apparently True and 1 hash to the same item and False and 0 hash to the same item, so they can easily overwrite (which I spent a while banging my head over today). In other words: In[1]: d = {True: 'a', False: 'b'} d[0] = 'z' d[False] Out[1]: 'z' ---------- messages: 262232 nosy: nickeubank priority: normal severity: normal status: open title: False/0 and True/1 collision when used as dict keys? versions: Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 23:04:45 2016 From: report at bugs.python.org (Eric Price) Date: Wed, 23 Mar 2016 03:04:45 +0000 Subject: [issue23735] Readline not adjusting width after resize with 6.3 In-Reply-To: <1426984974.32.0.405944458303.issue23735@psf.upfronthosting.co.za> Message-ID: <1458702285.81.0.598573972209.issue23735@psf.upfronthosting.co.za> Eric Price added the comment: Hmm, OK. I've made a new version of the patch that chains signal handlers. I think that should make it match previous functionality, and work with basic combined usage or python signal handlers. It probably still won't work if you, say, want to start and then stop a signal handler installed in C, but that's basically Issue 13285. ---------- Added file: http://bugs.python.org/file42246/rl_sigwinch_calling_old_handler.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 23:11:09 2016 From: report at bugs.python.org (Ethan Furman) Date: Wed, 23 Mar 2016 03:11:09 +0000 Subject: [issue26614] False/0 and True/1 collision when used as dict keys? In-Reply-To: <1458702240.3.0.550475924064.issue26614@psf.upfronthosting.co.za> Message-ID: <1458702669.5.0.765723001633.issue26614@psf.upfronthosting.co.za> Ethan Furman added the comment: False and True are subtypes of int, so the behaviour you are seeing is known and expected. https://docs.python.org/2/reference/datamodel.html?highlight=bool In the future feel free to ask on Python-List about behaviour -- you'll be sure to get a plethora of answers. ---------- nosy: +ethan.furman resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 23:14:46 2016 From: report at bugs.python.org (Eric Price) Date: Wed, 23 Mar 2016 03:14:46 +0000 Subject: [issue23735] Readline not adjusting width after resize with 6.3 In-Reply-To: <1426984974.32.0.405944458303.issue23735@psf.upfronthosting.co.za> Message-ID: <1458702886.18.0.648055710023.issue23735@psf.upfronthosting.co.za> Eric Price added the comment: (To be clear, it now works in general for Python signal handlers, and when C handlers are inserted but not deleted.) For a conditional ifdef, does that mean I should add another test/variable in configure.ac? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 23:24:29 2016 From: report at bugs.python.org (Patrick J McNerthney) Date: Wed, 23 Mar 2016 03:24:29 +0000 Subject: [issue1346874] httplib simply ignores CONTINUE Message-ID: <1458703469.03.0.0333670011482.issue1346874@psf.upfronthosting.co.za> Patrick J McNerthney added the comment: I believe this is actually a bug, because it causes the posting of messages whose length is greater then the Apache HTTPD SSLRenegBufferSize setting to fail, whereas other http clients that first wait to receive the 100 response before sending the body do work. The situation I am encountering is an Apache server that uses client certificates to authorize calls to it's rest apis, whereas the rest of the same site do not require it. See the documentation about the SSLRegenBufferSize here: https://httpd.apache.org/docs/trunk/mod/mod_ssl.html#sslrenegbuffersize By sending just the headers first with the "Expect: 100-continue" header and then waiting for the "100" response, Apache only has to buffer the headers. But the way HTTPConnection currently works, the headers and the body will be sent immediately, causing the SSLRenegBuffer to be exceed, causing the request to fail. Also, I do not think the submitted patch is the best fix for this. The HTTPConnection.putheader method should be the place that checks to see if there is an Expect header sent. ---------- nosy: +IcicleSpider _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 23:35:41 2016 From: report at bugs.python.org (Xiang Zhang) Date: Wed, 23 Mar 2016 03:35:41 +0000 Subject: [issue26615] Missing entry in WRAPPER_ASSIGNMENTS in update_wrapper's doc Message-ID: <1458704141.94.0.68234227835.issue26615@psf.upfronthosting.co.za> New submission from Xiang Zhang: WRAPPER_ASSIGNMENTS now contains __qualname__ but the documentation doesn't mention it. ---------- assignee: docs at python components: Documentation files: functools_doc.patch keywords: patch messages: 262237 nosy: docs at python, xiang.zhang priority: normal severity: normal status: open title: Missing entry in WRAPPER_ASSIGNMENTS in update_wrapper's doc versions: Python 3.6 Added file: http://bugs.python.org/file42247/functools_doc.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 00:03:54 2016 From: report at bugs.python.org (Robert Siemer) Date: Wed, 23 Mar 2016 04:03:54 +0000 Subject: [issue13797] Allow objects implemented in pure Python to export PEP 3118 buffers In-Reply-To: <1326709751.32.0.965094376059.issue13797@psf.upfronthosting.co.za> Message-ID: <1458705834.82.0.274066862434.issue13797@psf.upfronthosting.co.za> Changes by Robert Siemer : ---------- nosy: +siemer _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 00:18:27 2016 From: report at bugs.python.org (Brian Guo) Date: Wed, 23 Mar 2016 04:18:27 +0000 Subject: [issue26602] argparse doc introduction is inappropriately targeted In-Reply-To: <1458562294.77.0.347454712136.issue26602@psf.upfronthosting.co.za> Message-ID: <1458706707.6.0.30281257858.issue26602@psf.upfronthosting.co.za> Brian Guo added the comment: Hi, I agree with your observation about the unnecessarily complicated documentation. I feel that there is not a real necessity to include an example that uses (metavar='N', nargs='+') or even (const='sum', default='max') inside the parameters of the add_argument method, as they are not explained in the beginning section and simply appear to contribute clutter. For this reason, I have written an easier document to understand (still keeping the sidebar tutorial, because it is a helpful reference). I use instead a method that accepts a string and returns the first letter. I hope this will add to the clarity of the document. ---------- keywords: +patch nosy: +BGuo1 Added file: http://bugs.python.org/file42248/bguo.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 01:25:06 2016 From: report at bugs.python.org (Alexander Belopolsky) Date: Wed, 23 Mar 2016 05:25:06 +0000 Subject: [issue26616] A bug in datetime.astimezone() method Message-ID: <1458710706.19.0.994284495334.issue26616@psf.upfronthosting.co.za> New submission from Alexander Belopolsky: With TZ=America/New_York, >>> from datetime import * >>> u = datetime(2015, 11, 1, 5, tzinfo=timezone.utc) >>> t = u.astimezone() >>> print(t) 2015-11-01 01:00:00-04:00 >>> print(t.astimezone()) 2015-11-01 00:00:00-05:00 which is wrong - the second call to astimezone() should not change the timezone. Note that pure python code does not have this bug. (Try setiing sys.module['_datetime'] = None before running the code above.) ---------- components: Extension Modules messages: 262239 nosy: belopolsky priority: normal severity: normal stage: needs patch status: open title: A bug in datetime.astimezone() method type: behavior versions: Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 01:27:16 2016 From: report at bugs.python.org (Alexander Belopolsky) Date: Wed, 23 Mar 2016 05:27:16 +0000 Subject: [issue26616] A bug in datetime.astimezone() method In-Reply-To: <1458710706.19.0.994284495334.issue26616@psf.upfronthosting.co.za> Message-ID: <1458710836.1.0.820671018985.issue26616@psf.upfronthosting.co.za> Alexander Belopolsky added the comment: See also #9527. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 01:54:59 2016 From: report at bugs.python.org (Rian Hunter) Date: Wed, 23 Mar 2016 05:54:59 +0000 Subject: [issue10740] sqlite3 module breaks transactions and potentially corrupts data In-Reply-To: <1292868135.81.0.257293444934.issue10740@psf.upfronthosting.co.za> Message-ID: <1458712499.46.0.684703667655.issue10740@psf.upfronthosting.co.za> Rian Hunter added the comment: Implicit transactions can also cause mysterious "database is locked" bugs, even when a large timeout is set on the connection. Many, many people are affected by this bug (search the web for "python sqlite database is locked"). The attached code demonstrates this bug and possible (unintuitive) fixes. If there won't be a fix soon, then at least the documentation should note this quirky behavior. ---------- nosy: +rhunter Added file: http://bugs.python.org/file42249/test_sqlite.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 02:08:59 2016 From: report at bugs.python.org (Guo, Jiahua) Date: Wed, 23 Mar 2016 06:08:59 +0000 Subject: [issue26617] Assertion failed in gc with __del__ and weakref Message-ID: <1458713339.87.0.171873505456.issue26617@psf.upfronthosting.co.za> New submission from Guo, Jiahua: $ python3.5-dbg crash.py python3.5-dbg: ../Modules/gcmodule.c:364: update_refs: Assertion `((gc)->gc.gc_refs >> (1)) != 0' failed. $ python3.5-dbg crash-multithread.py python3.5-dbg: ../Modules/gcmodule.c:364: update_refs: Assertion `((gc)->gc.gc_refs >> (1)) != 0' failed. ============ crash.py ========== import weakref import gc def callback(o): gc.collect() class C: def __del__(self): pass def main(): c = C() cref = weakref.ref(c, callback) del c main() ============ crash-multithread.py ========== import threading import weakref import gc ei = threading.Event() eo = threading.Event() def gc_worker(): ei.wait() gc.collect() eo.set() def callback(o): ei.set() eo.wait() class C: def __del__(self): pass def main(): t = threading.Thread(target=gc_worker) t.start() c = C() cref = weakref.ref(c, callback) del c t.join() main() ---------- components: Interpreter Core messages: 262242 nosy: Guo, Jiahua priority: normal severity: normal status: open title: Assertion failed in gc with __del__ and weakref type: crash versions: Python 3.4, Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 02:14:37 2016 From: report at bugs.python.org (Rian Hunter) Date: Wed, 23 Mar 2016 06:14:37 +0000 Subject: [issue10740] sqlite3 module breaks transactions and potentially corrupts data In-Reply-To: <1292868135.81.0.257293444934.issue10740@psf.upfronthosting.co.za> Message-ID: <1458713677.59.0.197554039604.issue10740@psf.upfronthosting.co.za> Changes by Rian Hunter : Removed file: http://bugs.python.org/file42249/test_sqlite.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 02:14:50 2016 From: report at bugs.python.org (Rian Hunter) Date: Wed, 23 Mar 2016 06:14:50 +0000 Subject: [issue10740] sqlite3 module breaks transactions and potentially corrupts data In-Reply-To: <1292868135.81.0.257293444934.issue10740@psf.upfronthosting.co.za> Message-ID: <1458713690.43.0.660264355455.issue10740@psf.upfronthosting.co.za> Changes by Rian Hunter : Added file: http://bugs.python.org/file42250/test_sqlite.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 02:15:33 2016 From: report at bugs.python.org (Rian Hunter) Date: Wed, 23 Mar 2016 06:15:33 +0000 Subject: [issue10740] sqlite3 module breaks transactions and potentially corrupts data In-Reply-To: <1292868135.81.0.257293444934.issue10740@psf.upfronthosting.co.za> Message-ID: <1458713733.61.0.507201965778.issue10740@psf.upfronthosting.co.za> Changes by Rian Hunter : Removed file: http://bugs.python.org/file42250/test_sqlite.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 02:15:42 2016 From: report at bugs.python.org (Rian Hunter) Date: Wed, 23 Mar 2016 06:15:42 +0000 Subject: [issue10740] sqlite3 module breaks transactions and potentially corrupts data In-Reply-To: <1292868135.81.0.257293444934.issue10740@psf.upfronthosting.co.za> Message-ID: <1458713742.44.0.577647475926.issue10740@psf.upfronthosting.co.za> Changes by Rian Hunter : Added file: http://bugs.python.org/file42251/test_sqlite.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 02:49:42 2016 From: report at bugs.python.org (Yang Ke) Date: Wed, 23 Mar 2016 06:49:42 +0000 Subject: [issue26617] Assertion failed in gc with __del__ and weakref In-Reply-To: <1458713339.87.0.171873505456.issue26617@psf.upfronthosting.co.za> Message-ID: <1458715782.36.0.22091386428.issue26617@psf.upfronthosting.co.za> Yang Ke added the comment: The crash may be raised on both Windows OS and Linux. We got crashed under Ubuntu 14.04, while a similar issue was found https://bugs.python.org/issue23187#msg238139 last year under Windows OS. We actually raise such bug working on a program with asyncio and multithread(use asyncio.BaseEventLoop.run_in_executor with its default threadpool). The asyncio.Task class creates a weakref.WeakSet(https://hg.python.org/cpython/file/3.5/Lib/asyncio/tasks.py#l38) containing alive tasks. WeakSet is implemented as a list containing weakref.ref with CALLBACK function(https://hg.python.org/cpython/file/3.5/Lib/_weakrefset.py#l84). And that may lead to the situation described in sample crash code: Once a asyncio.Task.__del__ function is called, and callback of the weakref is called, then the interpreter switches to other thread, which may trigger gc.collect(the thread allocate a huge number of objects, for example), and leaves the task object in gc_list with refcount==0. ---------- nosy: +Yang Ke -Guo. Jiahua _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 02:54:34 2016 From: report at bugs.python.org (Guo Jiahua) Date: Wed, 23 Mar 2016 06:54:34 +0000 Subject: [issue26617] Assertion failed in gc with __del__ and weakref In-Reply-To: <1458713339.87.0.171873505456.issue26617@psf.upfronthosting.co.za> Message-ID: <1458716074.97.0.0508944607794.issue26617@psf.upfronthosting.co.za> Changes by Guo Jiahua : ---------- nosy: +Guo Jiahua _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 02:59:39 2016 From: report at bugs.python.org (Xiang Zhang) Date: Wed, 23 Mar 2016 06:59:39 +0000 Subject: [issue26617] Assertion failed in gc with __del__ and weakref In-Reply-To: <1458713339.87.0.171873505456.issue26617@psf.upfronthosting.co.za> Message-ID: <1458716379.15.0.014339957597.issue26617@psf.upfronthosting.co.za> Changes by Xiang Zhang : ---------- nosy: +xiang.zhang _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 03:12:07 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 23 Mar 2016 07:12:07 +0000 Subject: [issue26617] Assertion failed in gc with __del__ and weakref In-Reply-To: <1458713339.87.0.171873505456.issue26617@psf.upfronthosting.co.za> Message-ID: <1458717127.98.0.449848073317.issue26617@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- nosy: +fdrake, haypo, pitrou _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 03:28:39 2016 From: report at bugs.python.org (Eric Khoo Jiun Hooi) Date: Wed, 23 Mar 2016 07:28:39 +0000 Subject: [issue23551] IDLE to provide menu link to PIP gui. In-Reply-To: <1425155752.55.0.0736033483828.issue23551@psf.upfronthosting.co.za> Message-ID: <1458718119.32.0.552757768052.issue23551@psf.upfronthosting.co.za> Eric Khoo Jiun Hooi added the comment: @Terry, I am also a GSOC 2016 participant. I would also like to work on this project. I had spent a few days to learn the tkinter library and finally finish some code for this project. Hope you can help to review it and giving some feedback. As for the virtualenv that you mention, how about I just let the user decide the path of the pip that they want to use by making a setting for path in menubar? I also design the prototype of the PIP gui. Please give me some review about those design. If you have any idea to improve it, feel free to comment! ---------- nosy: +erickhoo Added file: http://bugs.python.org/file42252/pip_gui.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 03:32:56 2016 From: report at bugs.python.org (Eric Khoo Jiun Hooi) Date: Wed, 23 Mar 2016 07:32:56 +0000 Subject: [issue23551] IDLE to provide menu link to PIP gui. In-Reply-To: <1425155752.55.0.0736033483828.issue23551@psf.upfronthosting.co.za> Message-ID: <1458718376.33.0.522758610312.issue23551@psf.upfronthosting.co.za> Changes by Eric Khoo Jiun Hooi : Added file: http://bugs.python.org/file42253/prototype_design.png _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 03:48:54 2016 From: report at bugs.python.org (SilentGhost) Date: Wed, 23 Mar 2016 07:48:54 +0000 Subject: [issue10894] Making stdlib APIs private In-Reply-To: <1294838236.87.0.84648349826.issue10894@psf.upfronthosting.co.za> Message-ID: <1458719334.95.0.0663518596687.issue10894@psf.upfronthosting.co.za> Changes by SilentGhost : ---------- resolution: -> rejected stage: patch review -> resolved status: open -> closed type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 03:58:12 2016 From: report at bugs.python.org (STINNER Victor) Date: Wed, 23 Mar 2016 07:58:12 +0000 Subject: [issue26617] Assertion failed in gc with __del__ and weakref In-Reply-To: <1458713339.87.0.171873505456.issue26617@psf.upfronthosting.co.za> Message-ID: <1458719892.4.0.382834033921.issue26617@psf.upfronthosting.co.za> STINNER Victor added the comment: Oh, I confirm that the bug occurs on Python 3.5.1+ (3.5 branch) and Python 3.6 (default branch). Call stack: _Py_Dealloc() => subtype_dealloc() => PyObject_ClearWeakRefs() => handle_callback() of weakref => ... => gc_collect => ... => assertion error Full gdb tracebacks: python: Modules/gcmodule.c:364: update_refs: Assertion `((gc)->gc.gc_refs >> (1)) != 0' failed. Program received signal SIGABRT, Aborted. 0x00007ffff7129a98 in raise () from /lib64/libc.so.6 (gdb) where #0 0x00007ffff7129a98 in raise () from /lib64/libc.so.6 #1 0x00007ffff712b69a in abort () from /lib64/libc.so.6 #2 0x00007ffff7122227 in __assert_fail_base () from /lib64/libc.so.6 #3 0x00007ffff71222d2 in __assert_fail () from /lib64/libc.so.6 #4 0x0000000000441b74 in update_refs (containers=0x939c60 ) at Modules/gcmodule.c:364 #5 0x0000000000442cb1 in collect (generation=2, n_collected=0x7fffffff87f0, n_uncollectable=0x7fffffff87e8, nofail=0) at Modules/gcmodule.c:950 #6 0x00000000004432dd in collect_with_callback (generation=2) at Modules/gcmodule.c:1119 #7 0x00000000004434cb in gc_collect (self=, args=(), kws=0x0) at Modules/gcmodule.c:1213 #8 0x00000000004d5731 in PyCFunction_Call (func=, args=(), kwds=0x0) at Objects/methodobject.c:98 #9 0x00000000005d0fd3 in call_function (pp_stack=0x7fffffff8a18, oparg=0) at Python/ceval.c:4732 #10 0x00000000005c8cc0 in PyEval_EvalFrameEx (f=Frame 0x7ffff7eaa858, for file crash.py, line 7, in callback (o=), throwflag=0) at Python/ceval.c:3207 #11 0x00000000005ce4ec in _PyEval_EvalCodeWithName (_co=, globals={'__package__': None, '__name__': '__main__', 'gc': , 'weakref': , '__builtins__': , 'C': , '__doc__': None, '__spec__': None, 'main': , 'callback': , '__loader__': , '__file__': 'crash.py', '__cached__': None}, locals=0x0, args=0x7ffff05d5b78, argcount=1, kws=0x0, kwcount=0, defs=0x0, defcount=0, kwdefs=0x0, closure=0x0, name=0x0, qualname=0x0) at Python/ceval.c:4045 #12 0x00000000005ce61e in PyEval_EvalCodeEx (_co=, globals={'__package__': None, '__name__': '__main__', 'gc': , 'weakref': , '__builtins__': , 'C': , '__doc__': None, '__spec__': None, 'main': , 'callback': , '__loader__': , '__file__': 'crash.py', '__cached__': None}, locals=0x0, args=0x7ffff05d5b78, argcount=1, kws=0x0, kwcount=0, defs=0x0, defcount=0, kwdefs=0x0, closure=0x0) at Python/ceval.c:4066 #13 0x0000000000688276 in function_call (func=, arg=(,), kw=0x0) at Objects/funcobject.c:604 #14 0x000000000046c4f3 in PyObject_Call (func=, arg=(,), kw=0x0) at Objects/abstract.c:2170 #15 0x000000000046d61d in PyObject_CallFunctionObjArgs (callable=) at Objects/abstract.c:2450 #16 0x0000000000576063 in handle_callback (ref=0x7ffff05eb658, callback=) at Objects/weakrefobject.c:868 #17 0x0000000000576257 in PyObject_ClearWeakRefs (object=) at Objects/weakrefobject.c:913 #18 0x00000000004f3bee in subtype_dealloc (self=) at Objects/typeobject.c:1162 #19 0x00000000004dd7d6 in _Py_Dealloc (op=) at Objects/object.c:1783 (...) (gdb) py-bt Traceback (most recent call first): Garbage-collecting File "crash.py", line 7, in callback gc.collect() File "crash.py", line 17, in main del c File "crash.py", line 20, in main() ---------- Added file: http://bugs.python.org/file42254/crash.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 03:58:19 2016 From: report at bugs.python.org (STINNER Victor) Date: Wed, 23 Mar 2016 07:58:19 +0000 Subject: [issue26617] Assertion failed in gc with __del__ and weakref In-Reply-To: <1458713339.87.0.171873505456.issue26617@psf.upfronthosting.co.za> Message-ID: <1458719899.93.0.210047375388.issue26617@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- nosy: +tim.peters _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 04:02:05 2016 From: report at bugs.python.org (STINNER Victor) Date: Wed, 23 Mar 2016 08:02:05 +0000 Subject: [issue26612] test_ssl: use context manager (with) to fix ResourceWarning In-Reply-To: <1458697946.92.0.922624292811.issue26612@psf.upfronthosting.co.za> Message-ID: STINNER Victor added the comment: Martin Panter added the comment: > Wouldn?t it be better to fix the underlying problem with the test cases? I don't feel able to fix AIX issues, and I don't think that we can fix all issues. You still get ResourceWarning if you interrupt the test with CTRL+c which is not a bug. > Also, you can often use self.addCleanup(s.close), which saves a level of indentation (and associated noise in the annotate history). It may work on some cases, but not all of them. And I like controlling when a socket is closed: I prefer to close it inside the test, and not sometime later with unittest magic features. > Also remember that sockets don?t do context management in Python 2, so this would bring more incompatibilies when merging tests between the two branches. Since this issue is not really a blocker bug, I suggest to only modify Python 3.6. It's a follow-up of all work on ResourceWarning (on Python 3.6) last days: https://docs.python.org/dev/whatsnew/3.6.html#warnings ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 04:05:21 2016 From: report at bugs.python.org (STINNER Victor) Date: Wed, 23 Mar 2016 08:05:21 +0000 Subject: [issue13285] signal module ignores external signal changes In-Reply-To: <1319801278.56.0.946220269602.issue13285@psf.upfronthosting.co.za> Message-ID: <1458720321.38.0.183378764038.issue13285@psf.upfronthosting.co.za> STINNER Victor added the comment: If anyone wants to work on this issue, I suggest to requalify it as a documentation issue. Just explain the behaviour and don't try to implement complex workaround. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 04:08:38 2016 From: report at bugs.python.org (Roundup Robot) Date: Wed, 23 Mar 2016 08:08:38 +0000 Subject: [issue26588] _tracemalloc: add support for multiple address spaces (domains) In-Reply-To: <1458337167.06.0.908004959718.issue26588@psf.upfronthosting.co.za> Message-ID: <20160323080831.72423.27903.FE73B2B0@psf.io> Roundup Robot added the comment: New changeset dd887518b569 by Victor Stinner in branch 'default': Issue #26588: Optimize tracemalloc_realloc() https://hg.python.org/cpython/rev/dd887518b569 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 04:44:14 2016 From: report at bugs.python.org (Roundup Robot) Date: Wed, 23 Mar 2016 08:44:14 +0000 Subject: [issue26588] _tracemalloc: add support for multiple address spaces (domains) In-Reply-To: <1458337167.06.0.908004959718.issue26588@psf.upfronthosting.co.za> Message-ID: <20160323084411.8154.587.0F23B217@psf.io> Roundup Robot added the comment: New changeset 0e0a464faffb by Victor Stinner in branch 'default': Issue #26588: https://hg.python.org/cpython/rev/0e0a464faffb New changeset 14a552645c30 by Victor Stinner in branch 'default': Issue #26588: https://hg.python.org/cpython/rev/14a552645c30 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 04:53:22 2016 From: report at bugs.python.org (SilentGhost) Date: Wed, 23 Mar 2016 08:53:22 +0000 Subject: [issue10908] Improvements to trace._Ignore In-Reply-To: <1295020376.03.0.967767300509.issue10908@psf.upfronthosting.co.za> Message-ID: <1458723202.59.0.638550898388.issue10908@psf.upfronthosting.co.za> Changes by SilentGhost : ---------- dependencies: -trace module compares directories as strings (--ignore-dir) resolution: -> rejected stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 05:09:49 2016 From: report at bugs.python.org (Roundup Robot) Date: Wed, 23 Mar 2016 09:09:49 +0000 Subject: [issue26588] _tracemalloc: add support for multiple address spaces (domains) In-Reply-To: <1458337167.06.0.908004959718.issue26588@psf.upfronthosting.co.za> Message-ID: <20160323090945.14711.24198.6D225428@psf.io> Roundup Robot added the comment: New changeset 922b632808ac by Victor Stinner in branch 'default': Cleanup hashtable.h https://hg.python.org/cpython/rev/922b632808ac ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 05:18:51 2016 From: report at bugs.python.org (SilentGhost) Date: Wed, 23 Mar 2016 09:18:51 +0000 Subject: [issue25805] Failure in test_pkgutil run from command-line In-Reply-To: <1449306484.59.0.680027150317.issue25805@psf.upfronthosting.co.za> Message-ID: <1458724731.8.0.751901764283.issue25805@psf.upfronthosting.co.za> SilentGhost added the comment: Upon further investigation it seems this particular test needs to be just skipped when running as __main__. ---------- keywords: +patch stage: -> patch review Added file: http://bugs.python.org/file42255/issue25805.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 05:23:14 2016 From: report at bugs.python.org (STINNER Victor) Date: Wed, 23 Mar 2016 09:23:14 +0000 Subject: [issue23886] faulthandler_user should use _PyThreadState_Current In-Reply-To: <1428480184.73.0.0889790949933.issue23886@psf.upfronthosting.co.za> Message-ID: <1458724994.98.0.573250172974.issue23886@psf.upfronthosting.co.za> STINNER Victor added the comment: faulthandler was enhanced in Python 3.6: * Issue #26563: faulthandler now works in non-Python threads. * Issue #26154: Issue #26154: Add a new private _PyThreadState_UncheckedGet() function which gets the current thread state, but don't call Py_FatalError() if it is NULL. Can you please try Python 3.6 (default branch of Mercurial) with your use case to check if the issue is solved? And also Python 3.5 (3.5 branch of Mercurial)? I can try to backport some enhancements from Python 3.6 to Python 3.5 if needed. If it's ok for you, I will then port changes to the GitHub project. Note: I also add new unit tests. > SIGUSR1/2 will get delivered to any running thread. The current thread of the signal doesn't give any useful information. Try to get the current Python thread which holds the GIL instead, or use NULL. I don't understand your usecase, since faulthandler displays *all* Python threads by default. all_threads=True in faulthandler.register(signum, file=sys.stderr, all_threads=True, chain=False): https://docs.python.org/dev/library/faulthandler.html#faulthandler.register ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 05:34:41 2016 From: report at bugs.python.org (Albert Zeyer) Date: Wed, 23 Mar 2016 09:34:41 +0000 Subject: [issue23886] faulthandler_user should use _PyThreadState_Current In-Reply-To: <1428480184.73.0.0889790949933.issue23886@psf.upfronthosting.co.za> Message-ID: <1458725681.33.0.177017864943.issue23886@psf.upfronthosting.co.za> Albert Zeyer added the comment: PyGILState_GetThisThreadState might not be the same Python thread as _PyThreadState_Current, even in the case that both are not NULL. That is because SIGUSR1/2 will get delivered to any running thread. In the output by faulthandler, I want that it marks the current Python thread correctly, and not the current sighandler thread. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 05:47:43 2016 From: report at bugs.python.org (=?utf-8?q?Gerhard_H=C3=A4ring?=) Date: Wed, 23 Mar 2016 09:47:43 +0000 Subject: [issue10740] sqlite3 module breaks transactions and potentially corrupts data In-Reply-To: <1292868135.81.0.257293444934.issue10740@psf.upfronthosting.co.za> Message-ID: <1458726463.59.0.991982341467.issue10740@psf.upfronthosting.co.za> Gerhard H?ring added the comment: Isn't this issue at least partly about the statement parsing code in the sqlite module? I've fixed this upstream a while ago in https://github.com/ghaering/pysqlite/commit/94eae5002967a51782f36ce9b7b81bba5b4379db Could somebody perhaps bring this to the Python repository. Here's a documentation update that's also required then: https://github.com/ghaering/pysqlite/commit/cae87ee68613697a5f4947b4a0941f59a28da1b6 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 06:23:59 2016 From: report at bugs.python.org (Roundup Robot) Date: Wed, 23 Mar 2016 10:23:59 +0000 Subject: [issue23848] faulthandler: setup an exception handler on Windows In-Reply-To: <1427962559.63.0.750474204561.issue23848@psf.upfronthosting.co.za> Message-ID: <20160323102354.94841.69666.7C3C61E0@psf.io> Roundup Robot added the comment: New changeset b2f7bb63377b by Victor Stinner in branch 'default': Issue #23848: Expose _Py_DumpHexadecimal() https://hg.python.org/cpython/rev/b2f7bb63377b New changeset b114dbbe2d31 by Victor Stinner in branch 'default': faulthandler: add Windows exception handler https://hg.python.org/cpython/rev/b114dbbe2d31 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 06:28:16 2016 From: report at bugs.python.org (Berker Peksag) Date: Wed, 23 Mar 2016 10:28:16 +0000 Subject: [issue24887] Sqlite3 has no option to provide open flags In-Reply-To: <1439898126.92.0.460778309784.issue24887@psf.upfronthosting.co.za> Message-ID: <1458728896.95.0.138450470442.issue24887@psf.upfronthosting.co.za> Changes by Berker Peksag : ---------- dependencies: +Migrate sqlite3 module to _v2 API to enhance performance stage: -> needs patch type: -> enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 06:43:52 2016 From: report at bugs.python.org (STINNER Victor) Date: Wed, 23 Mar 2016 10:43:52 +0000 Subject: [issue26618] _overlapped extension module of asyncio uses deprecated WSAStringToAddressA() function Message-ID: <1458729832.02.0.462446337559.issue26618@psf.upfronthosting.co.za> New submission from STINNER Victor: The code should be updated to use WSAStringToAddressW(). https://msdn.microsoft.com/en-us/library/windows/desktop/ms742214%28v=vs.85%29.aspx Compilation warnings: 20>..\Modules\overlapped.c(980): warning C4996: 'WSAStringToAddressA': Use WSAStringToAddressW() instead or define _WINSOCK_DEPRECATED_NO_WARNINGS to disable deprecated API warnings [D:\buildarea\3.x.bolen-windows8\build\PCbuild\_overlapped.vcxproj] 20>..\Modules\overlapped.c(991): warning C4996: 'WSAStringToAddressA': Use WSAStringToAddressW() instead or define _WINSOCK_DEPRECATED_NO_WARNINGS to disable deprecated API warnings [D:\buildarea\3.x.bolen-windows8\build\PCbuild\_overlapped.vcxproj] ---------- components: Windows, asyncio messages: 262256 nosy: gvanrossum, haypo, paul.moore, steve.dower, tim.golden, yselivanov, zach.ware priority: normal severity: normal status: open title: _overlapped extension module of asyncio uses deprecated WSAStringToAddressA() function versions: Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 06:47:42 2016 From: report at bugs.python.org (Steve Morris) Date: Wed, 23 Mar 2016 10:47:42 +0000 Subject: [issue26619] 3.5.1 install fails on Windows Server 2008 R2 64-bit Message-ID: <1458730062.68.0.427600390263.issue26619@psf.upfronthosting.co.za> New submission from Steve Morris: Setup fails with "Windows 7 Service Pack 1 required" ---------- components: Installation files: Python 3.5.1 (64-bit)_20160323125008.log messages: 262257 nosy: sdmorris priority: normal severity: normal status: open title: 3.5.1 install fails on Windows Server 2008 R2 64-bit type: behavior versions: Python 3.5 Added file: http://bugs.python.org/file42256/Python 3.5.1 (64-bit)_20160323125008.log _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 06:59:05 2016 From: report at bugs.python.org (STINNER Victor) Date: Wed, 23 Mar 2016 10:59:05 +0000 Subject: [issue26620] Fix ResourceWarning warnings in test_urllib2_localnet Message-ID: <1458730745.01.0.796601838932.issue26620@psf.upfronthosting.co.za> New submission from STINNER Victor: Attached patch fixes 3 ResourceWarning warnings in Lib/test/test_urllib2_localnet.py. See also issue #26612 (test_ssl). Example of warning logged by "./python -X tracemalloc=25 -m test -v test_urllib2_localnet ": --- /home/haypo/prog/python/default/Lib/test/support/__init__.py:1444: ResourceWarning: unclosed gc.collect() Object allocated at (most recent call first): File "/home/haypo/prog/python/default/Lib/socket.py", lineno 697 sock = socket(af, socktype, proto) File "/home/haypo/prog/python/default/Lib/http/client.py", lineno 898 (self.host,self.port), self.timeout, self.source_address) File "/home/haypo/prog/python/default/Lib/http/client.py", lineno 926 self.connect() File "/home/haypo/prog/python/default/Lib/http/client.py", lineno 983 self.send(msg) File "/home/haypo/prog/python/default/Lib/http/client.py", lineno 1151 self._send_output(message_body) File "/home/haypo/prog/python/default/Lib/http/client.py", lineno 1200 self.endheaders(body) File "/home/haypo/prog/python/default/Lib/http/client.py", lineno 1155 self._send_request(method, url, body, headers) File "/home/haypo/prog/python/default/Lib/urllib/request.py", lineno 1303 h.request(req.get_method(), req.selector, req.data, headers) File "/home/haypo/prog/python/default/Lib/urllib/request.py", lineno 1331 return self.do_open(http.client.HTTPConnection, req) File "/home/haypo/prog/python/default/Lib/urllib/request.py", lineno 503 result = func(*args) File "/home/haypo/prog/python/default/Lib/urllib/request.py", lineno 543 '_open', req) File "/home/haypo/prog/python/default/Lib/urllib/request.py", lineno 525 response = self._open(req, data) File "/home/haypo/prog/python/default/Lib/urllib/request.py", lineno 222 return opener.open(url, data, timeout) File "/home/haypo/prog/python/default/Lib/test/test_urllib2_localnet.py", lineno 595 urllib.request.urlopen(req) (...) --- ---------- components: Tests messages: 262258 nosy: haypo, martin.panter priority: normal severity: normal status: open title: Fix ResourceWarning warnings in test_urllib2_localnet type: resource usage versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 06:59:11 2016 From: report at bugs.python.org (STINNER Victor) Date: Wed, 23 Mar 2016 10:59:11 +0000 Subject: [issue26620] Fix ResourceWarning warnings in test_urllib2_localnet In-Reply-To: <1458730745.01.0.796601838932.issue26620@psf.upfronthosting.co.za> Message-ID: <1458730751.79.0.65132425027.issue26620@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- keywords: +patch Added file: http://bugs.python.org/file42257/test_urllib2_localnet.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 07:00:20 2016 From: report at bugs.python.org (SilentGhost) Date: Wed, 23 Mar 2016 11:00:20 +0000 Subject: [issue26619] 3.5.1 install fails on Windows Server 2008 R2 64-bit In-Reply-To: <1458730062.68.0.427600390263.issue26619@psf.upfronthosting.co.za> Message-ID: <1458730820.83.0.183975571935.issue26619@psf.upfronthosting.co.za> Changes by SilentGhost : ---------- components: +Windows nosy: +paul.moore, steve.dower, tim.golden, zach.ware _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 07:23:07 2016 From: report at bugs.python.org (SilentGhost) Date: Wed, 23 Mar 2016 11:23:07 +0000 Subject: [issue26391] Specialized sub-classes of Generic never call __init__ In-Reply-To: <1455882742.53.0.118642694532.issue26391@psf.upfronthosting.co.za> Message-ID: <1458732187.4.0.995291904567.issue26391@psf.upfronthosting.co.za> Changes by SilentGhost : ---------- nosy: +gvanrossum _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 07:47:58 2016 From: report at bugs.python.org (Steve Morris) Date: Wed, 23 Mar 2016 11:47:58 +0000 Subject: [issue26619] 3.5.1 install fails on Windows Server 2008 R2 64-bit In-Reply-To: <1458730062.68.0.427600390263.issue26619@psf.upfronthosting.co.za> Message-ID: <1458733678.72.0.0633357306092.issue26619@psf.upfronthosting.co.za> Steve Morris added the comment: I just tried the 3.4.4 installer (Windows x86-64 MSI) and it works correctly ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 08:42:43 2016 From: report at bugs.python.org (Matthias Klose) Date: Wed, 23 Mar 2016 12:42:43 +0000 Subject: [issue26621] test_decimal fails with libmpdecimal 2.4.2 Message-ID: <1458736963.71.0.573230549815.issue26621@psf.upfronthosting.co.za> New submission from Matthias Klose: test_decimal fails with libmpdecimal 2.4.2 that's because Lib/_pydecimal.py hardcodes __libmpdec_version__ = "2.4.1" # compatible libmpdec version ---------- components: Extension Modules messages: 262260 nosy: doko, skrah priority: normal severity: normal status: open title: test_decimal fails with libmpdecimal 2.4.2 versions: Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 09:16:13 2016 From: report at bugs.python.org (Steve Dower) Date: Wed, 23 Mar 2016 13:16:13 +0000 Subject: [issue26619] 3.5.1 install fails on Windows Server 2008 R2 64-bit In-Reply-To: <1458730062.68.0.427600390263.issue26619@psf.upfronthosting.co.za> Message-ID: <1458738973.92.0.940589817693.issue26619@psf.upfronthosting.co.za> Steve Dower added the comment: Apparently the version detection needs to be changed, and I'll need to figure out what the WS prerequisites are for installing the UCRT update. It's entirely possible that there's an update you genuinely need to install 3.5, as there would be on a Windows client machine with that version, but I don't know what it is for Windows Server. ---------- assignee: -> steve.dower versions: +Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 09:17:19 2016 From: report at bugs.python.org (Stubz) Date: Wed, 23 Mar 2016 13:17:19 +0000 Subject: [issue26613] Descriptor HowTo Guide - Typo In-Reply-To: <1458694584.31.0.177347934352.issue26613@psf.upfronthosting.co.za> Message-ID: <1458739039.06.0.145546723679.issue26613@psf.upfronthosting.co.za> Stubz added the comment: Thanx mate, I am sorted ... Q tho ... It turns out my issue was with the class Dict and what I called a typo in the call to dict.fromkeys ... In order to make it 'go', I had to use the lower case letter, how is that not a typo ? The part that hung me up was the naming of class Dict and the call to dict.fromkeys, with no variable assigned to it ... It makes better sense now, but ... a class Dict used as a example of dictobject, to demonstrate the descriptors use of the dictobject methods, from a call to Dictobject, that returns error object not iterable ... I don't care what Lvl you are, that's just confusing ... ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 09:24:47 2016 From: report at bugs.python.org (STINNER Victor) Date: Wed, 23 Mar 2016 13:24:47 +0000 Subject: [issue26622] test_winreg now logs "Windows exception: code 0x06ba" on Python 3.6 Message-ID: <1458739487.96.0.253649845996.issue26622@psf.upfronthosting.co.za> New submission from STINNER Victor: The issue #23848 (change b114dbbe2d31) enhanced the faulthandler module to log Windows exceptions with the Python traceback. It uses AddVectoredExceptionHandler(1, callback) to register the callback. Problem: test_winreg now logs a lot of "Windows exception: code 0x06ba" messages followed by traceback. It's error RPC_S_SERVER_UNAVAILABLE (1722): "The RPC server is unavailable". It doesn't seem like a fatal error, so I'm not sure that it's worth to log it. Is it possible to check if an exception is a fatal error or not? Or should we explicitly ignore *this* specific error? Note: faulthandler must be enabled manually. Example of trace: http://buildbot.python.org/all/builders/AMD64%20Windows8%203.x/builds/1885/steps/test/logs/stdio ---- Windows exception: code 0x06ba Current thread 0x00000500 (most recent call first): File "D:\buildarea\3.x.bolen-windows8\build\lib\test\test_winreg.py", line 305 in test_dynamic_key File "D:\buildarea\3.x.bolen-windows8\build\lib\unittest\case.py", line 600 in run File "D:\buildarea\3.x.bolen-windows8\build\lib\unittest\case.py", line 648 in __call__ File "D:\buildarea\3.x.bolen-windows8\build\lib\unittest\suite.py", line 122 in run File "D:\buildarea\3.x.bolen-windows8\build\lib\unittest\suite.py", line 84 in __call__ File "D:\buildarea\3.x.bolen-windows8\build\lib\unittest\suite.py", line 122 in run File "D:\buildarea\3.x.bolen-windows8\build\lib\unittest\suite.py", line 84 in __call__ File "D:\buildarea\3.x.bolen-windows8\build\lib\unittest\runner.py", line 176 in run File "D:\buildarea\3.x.bolen-windows8\build\lib\test\support\__init__.py", line 1802 in _run_suite File "D:\buildarea\3.x.bolen-windows8\build\lib\test\support\__init__.py", line 1836 in run_unittest File "D:\buildarea\3.x.bolen-windows8\build\lib\test\test_winreg.py", line 479 in test_main File "D:\buildarea\3.x.bolen-windows8\build\lib\test\libregrtest\runtest.py", line 162 in runtest_inner File "D:\buildarea\3.x.bolen-windows8\build\lib\test\libregrtest\runtest.py", line 115 in runtest File "D:\buildarea\3.x.bolen-windows8\build\lib\test\libregrtest\main.py", line 306 in run_tests_sequential File "D:\buildarea\3.x.bolen-windows8\build\lib\test\libregrtest\main.py", line 367 in run_tests File "D:\buildarea\3.x.bolen-windows8\build\lib\test\libregrtest\main.py", line 405 in main File "D:\buildarea\3.x.bolen-windows8\build\lib\test\libregrtest\main.py", line 446 in main File "D:\buildarea\3.x.bolen-windows8\build\lib\test\libregrtest\main.py", line 468 in main_in_temp_cwd File "D:\buildarea\3.x.bolen-windows8\build\PCbuild\..\lib\test\regrtest.py", line 39 in ---- ---------- components: Tests, Windows messages: 262263 nosy: haypo, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: test_winreg now logs "Windows exception: code 0x06ba" on Python 3.6 versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 09:27:58 2016 From: report at bugs.python.org (STINNER Victor) Date: Wed, 23 Mar 2016 13:27:58 +0000 Subject: [issue26622] test_winreg now logs "Windows exception: code 0x06ba" on Python 3.6 In-Reply-To: <1458739487.96.0.253649845996.issue26622@psf.upfronthosting.co.za> Message-ID: <1458739678.01.0.56846923759.issue26622@psf.upfronthosting.co.za> STINNER Victor added the comment: Ah, it looks like an exception contains flag, especially the EXCEPTION_NONCONTINUABLE flag. Maybe we can use this one to decide if we must log or not the exception? By the way, is it better to log the exception code as hexadecimal (0x06ba) or decimal (1722)? Windows doc looks to prefer decimal. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 09:46:59 2016 From: report at bugs.python.org (Roundup Robot) Date: Wed, 23 Mar 2016 13:46:59 +0000 Subject: [issue26622] test_winreg now logs "Windows exception: code 0x06ba" on Python 3.6 In-Reply-To: <1458739487.96.0.253649845996.issue26622@psf.upfronthosting.co.za> Message-ID: <20160323134655.94837.57165.FBB613C3@psf.io> Roundup Robot added the comment: New changeset efcc48cd5bfb by Victor Stinner in branch 'default': faulthandler: only log fatal exceptions https://hg.python.org/cpython/rev/efcc48cd5bfb ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 09:46:59 2016 From: report at bugs.python.org (Roundup Robot) Date: Wed, 23 Mar 2016 13:46:59 +0000 Subject: [issue23848] faulthandler: setup an exception handler on Windows In-Reply-To: <1427962559.63.0.750474204561.issue23848@psf.upfronthosting.co.za> Message-ID: <20160323134655.94837.70268.4AB52ED6@psf.io> Roundup Robot added the comment: New changeset efcc48cd5bfb by Victor Stinner in branch 'default': faulthandler: only log fatal exceptions https://hg.python.org/cpython/rev/efcc48cd5bfb ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 09:47:39 2016 From: report at bugs.python.org (STINNER Victor) Date: Wed, 23 Mar 2016 13:47:39 +0000 Subject: [issue26622] test_winreg now logs "Windows exception: code 0x06ba" on Python 3.6 In-Reply-To: <1458739487.96.0.253649845996.issue26622@psf.upfronthosting.co.za> Message-ID: <1458740859.4.0.35499079948.issue26622@psf.upfronthosting.co.za> STINNER Victor added the comment: Ok, I added a check on the EXCEPTION_NONCONTINUABLE flag. test_winreg doesn't log exceptions anymore, but test_faulthandler still pass. ---------- resolution: -> fixed status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 09:47:51 2016 From: report at bugs.python.org (STINNER Victor) Date: Wed, 23 Mar 2016 13:47:51 +0000 Subject: [issue23848] faulthandler: setup an exception handler on Windows In-Reply-To: <1427962559.63.0.750474204561.issue23848@psf.upfronthosting.co.za> Message-ID: <1458740871.39.0.942489891819.issue23848@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- resolution: -> fixed status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 09:48:57 2016 From: report at bugs.python.org (mike bayer) Date: Wed, 23 Mar 2016 13:48:57 +0000 Subject: [issue10740] sqlite3 module breaks transactions and potentially corrupts data In-Reply-To: <1292868135.81.0.257293444934.issue10740@psf.upfronthosting.co.za> Message-ID: <1458740937.27.0.54808978671.issue10740@psf.upfronthosting.co.za> mike bayer added the comment: @Rian - implicit transactions are part of the DBAPI spec. Looking at the original description, the purpose of this bug is to not *end* the transaction when DDL is received. So there's no solution for "database is locked" here, other than pysqlite's usual behavior of not emitting BEGIN until DML is encountered (which works well). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 10:20:51 2016 From: report at bugs.python.org (Roundup Robot) Date: Wed, 23 Mar 2016 14:20:51 +0000 Subject: [issue23848] faulthandler: setup an exception handler on Windows In-Reply-To: <1427962559.63.0.750474204561.issue23848@psf.upfronthosting.co.za> Message-ID: <20160323142045.93560.29417.CFAB6233@psf.io> Roundup Robot added the comment: New changeset e6f00778d61f by Victor Stinner in branch 'default': Issue #23848: Try to fix test_faulthandler on ARM https://hg.python.org/cpython/rev/e6f00778d61f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 10:22:21 2016 From: report at bugs.python.org (STINNER Victor) Date: Wed, 23 Mar 2016 14:22:21 +0000 Subject: [issue23848] faulthandler: setup an exception handler on Windows In-Reply-To: <1427962559.63.0.750474204561.issue23848@psf.upfronthosting.co.za> Message-ID: <1458742941.68.0.854815384271.issue23848@psf.upfronthosting.co.za> STINNER Victor added the comment: The change b114dbbe2d31 introduced a regression on the ARM buildbot. I hope that it's fixed by the change e6f00778d61f. http://buildbot.python.org/all/builders/ARMv7%20Ubuntu%203.x/builds/3800/steps/test/logs/stdio 1:06:35 [400/400/1] test_faulthandler Timeout (1:00:00)! Thread 0x40102110 (most recent call first): File "/ssd/buildbot/buildarea/3.x.gps-ubuntu-exynos5-armv7l/build/Lib/subprocess.py", line 1608 in _try_wait File "/ssd/buildbot/buildarea/3.x.gps-ubuntu-exynos5-armv7l/build/Lib/subprocess.py", line 1658 in wait File "/ssd/buildbot/buildarea/3.x.gps-ubuntu-exynos5-armv7l/build/Lib/subprocess.py", line 1002 in __exit__ File "/ssd/buildbot/buildarea/3.x.gps-ubuntu-exynos5-armv7l/build/Lib/test/test_faulthandler.py", line 64 in get_output File "/ssd/buildbot/buildarea/3.x.gps-ubuntu-exynos5-armv7l/build/Lib/test/test_faulthandler.py", line 108 in check_error File "/ssd/buildbot/buildarea/3.x.gps-ubuntu-exynos5-armv7l/build/Lib/test/test_faulthandler.py", line 115 in check_fatal_error File "/ssd/buildbot/buildarea/3.x.gps-ubuntu-exynos5-armv7l/build/Lib/test/test_faulthandler.py", line 241 in test_stack_overflow ... ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 10:22:27 2016 From: report at bugs.python.org (STINNER Victor) Date: Wed, 23 Mar 2016 14:22:27 +0000 Subject: [issue23848] faulthandler: setup an exception handler on Windows In-Reply-To: <1427962559.63.0.750474204561.issue23848@psf.upfronthosting.co.za> Message-ID: <1458742947.88.0.419360778382.issue23848@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- resolution: fixed -> status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 10:37:17 2016 From: report at bugs.python.org (STINNER Victor) Date: Wed, 23 Mar 2016 14:37:17 +0000 Subject: [issue23848] faulthandler: setup an exception handler on Windows In-Reply-To: <1427962559.63.0.750474204561.issue23848@psf.upfronthosting.co.za> Message-ID: <1458743837.6.0.876029521824.issue23848@psf.upfronthosting.co.za> STINNER Victor added the comment: Pass succeeded again on ARM, I close the issue. ---------- resolution: -> fixed status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 10:48:20 2016 From: report at bugs.python.org (Mahmoud Lababidi) Date: Wed, 23 Mar 2016 14:48:20 +0000 Subject: [issue26623] JSON encode: more informative error Message-ID: <1458744500.18.0.912653699585.issue26623@psf.upfronthosting.co.za> New submission from Mahmoud Lababidi: The json.dumps()/encode functionality will raise an Error when an object that cannot be json-encoded is encountered. The current Error message only shows the Object itself. I would like to enhance the error message by also providing the Type. This is useful when numpy.int objects are passed in, but not clear that they are numpy objects. ---------- components: Library (Lib) messages: 262272 nosy: Mahmoud Lababidi priority: normal severity: normal status: open title: JSON encode: more informative error type: enhancement versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 10:51:22 2016 From: report at bugs.python.org (Mahmoud Lababidi) Date: Wed, 23 Mar 2016 14:51:22 +0000 Subject: [issue26623] JSON encode: more informative error In-Reply-To: <1458744500.18.0.912653699585.issue26623@psf.upfronthosting.co.za> Message-ID: <1458744682.5.0.168254849293.issue26623@psf.upfronthosting.co.za> Changes by Mahmoud Lababidi : ---------- keywords: +patch Added file: http://bugs.python.org/file42258/json_encode.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 10:51:39 2016 From: report at bugs.python.org (Shahar Golan) Date: Wed, 23 Mar 2016 14:51:39 +0000 Subject: [issue9694] argparse required arguments displayed under "optional arguments" In-Reply-To: <1282846759.11.0.900867962743.issue9694@psf.upfronthosting.co.za> Message-ID: <1458744699.71.0.734446963758.issue9694@psf.upfronthosting.co.za> Shahar Golan added the comment: This is not just a section issue. Please note that using the ArgumentDefaultHelpFormatter: argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultHelpFormatter) The help will also show (default=None) for these required arguments. ---------- components: -Documentation nosy: +shaharg versions: -Python 3.3, Python 3.4, Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 10:54:05 2016 From: report at bugs.python.org (SilentGhost) Date: Wed, 23 Mar 2016 14:54:05 +0000 Subject: [issue26623] JSON encode: more informative error In-Reply-To: <1458744500.18.0.912653699585.issue26623@psf.upfronthosting.co.za> Message-ID: <1458744845.25.0.438931040608.issue26623@psf.upfronthosting.co.za> Changes by SilentGhost : ---------- nosy: +ezio.melotti, pitrou, rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 10:57:47 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 23 Mar 2016 14:57:47 +0000 Subject: [issue26525] Documentation of ord(c) easy to misread In-Reply-To: <1457599892.41.0.987128084347.issue26525@psf.upfronthosting.co.za> Message-ID: <1458745067.0.0.0236938082111.issue26525@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Reversed to ord() function chr() still uses '?' as an example. I think both functions should use the same example. ---------- status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 11:01:05 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 23 Mar 2016 15:01:05 +0000 Subject: [issue26623] JSON encode: more informative error In-Reply-To: <1458744500.18.0.912653699585.issue26623@psf.upfronthosting.co.za> Message-ID: <1458745265.58.0.675472406237.issue26623@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: I think it is better to remove the representation of the object at all. It can be too long and less informative that the type of the object. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 11:44:31 2016 From: report at bugs.python.org (Jeremy Kloth) Date: Wed, 23 Mar 2016 15:44:31 +0000 Subject: [issue26624] Windows hangs in call to CRT setlocale() Message-ID: <1458747871.12.0.710719467032.issue26624@psf.upfronthosting.co.za> New submission from Jeremy Kloth: My Windows BuildBot (http://buildbot.python.org/all/buildslaves/kloth-win64) is hanging in calls to the CRT function setlocale() as determined by attaching to the hung test process in Visual Studio. This has been happening occasionally (every tenth+ build) for quite some time, but not to the frequency as of late (every fourth build or so). I would debug further, however my Visual Studio debugging-fu is not up to this challenge it seems. Pertinent details of the buildbot: - Windows 7 SP1 64-bit on a quad-core processor - Running buildbot as a service - Tests run using '-j4' - SSD used for storage Order of the tests do not seem to matter as re-running the test suite using the random seed that hung will pass when run from a console on the buildbot. Locale-using functions in the CRT have internally locking which is what I believe is the cause of the deadlock, but cannot determine exactly as this is where my debugging knowledge runs out. Help to diagnose further is greatly appreciated! ---------- components: Interpreter Core, Windows messages: 262276 nosy: eryksun, jkloth, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: Windows hangs in call to CRT setlocale() versions: Python 3.3, Python 3.4, Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 11:51:16 2016 From: report at bugs.python.org (Steve Dower) Date: Wed, 23 Mar 2016 15:51:16 +0000 Subject: [issue26624] Windows hangs in call to CRT setlocale() In-Reply-To: <1458747871.12.0.710719467032.issue26624@psf.upfronthosting.co.za> Message-ID: <1458748276.61.0.0834690869303.issue26624@psf.upfronthosting.co.za> Steve Dower added the comment: Have you actually seen this occurring back to 3.3? I'd expect something like this to either be pre-3.5 or post-3.5, but not both. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 12:00:57 2016 From: report at bugs.python.org (Jeremy Kloth) Date: Wed, 23 Mar 2016 16:00:57 +0000 Subject: [issue26624] Windows hangs in call to CRT setlocale() In-Reply-To: <1458747871.12.0.710719467032.issue26624@psf.upfronthosting.co.za> Message-ID: <1458748857.93.0.791865013423.issue26624@psf.upfronthosting.co.za> Jeremy Kloth added the comment: Oh, yes. It even occasionally happens on 2.7. The oldest occurrence I can dig up is May/June of 2013 (for 2.7). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 12:02:01 2016 From: report at bugs.python.org (STINNER Victor) Date: Wed, 23 Mar 2016 16:02:01 +0000 Subject: [issue26624] Windows hangs in call to CRT setlocale() In-Reply-To: <1458747871.12.0.710719467032.issue26624@psf.upfronthosting.co.za> Message-ID: <1458748921.68.0.688461469266.issue26624@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- nosy: +haypo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 12:13:39 2016 From: report at bugs.python.org (STINNER Victor) Date: Wed, 23 Mar 2016 16:13:39 +0000 Subject: [issue26624] Windows hangs in call to CRT setlocale() In-Reply-To: <1458747871.12.0.710719467032.issue26624@psf.upfronthosting.co.za> Message-ID: <1458749619.13.0.22025428776.issue26624@psf.upfronthosting.co.za> STINNER Victor added the comment: The bug occurs in test_strptime and test__locale according to Jeremy. > - Tests run using '-j4' With this option, each test file is run in a new fresh process, so it's more likely a race condition which depends on the system load (on exact timing) than the interaction with other tests running in parallel. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 12:19:46 2016 From: report at bugs.python.org (Rian Hunter) Date: Wed, 23 Mar 2016 16:19:46 +0000 Subject: [issue10740] sqlite3 module breaks transactions and potentially corrupts data In-Reply-To: <1292868135.81.0.257293444934.issue10740@psf.upfronthosting.co.za> Message-ID: <1458749986.08.0.214085516233.issue10740@psf.upfronthosting.co.za> Rian Hunter added the comment: @mike Yes you're right, This bug report is different, my mistake. DB-API may require implicit transactions but pysqlite should open a transaction before *any* non-DDL statement, including "SELECT", not just DML statements. Currently one must issue a dummy DML statement just to open a transaction that otherwise would start with a SELECT statement. I see nothing in DB-API (https://www.python.org/dev/peps/pep-0249/) that says transactions should implicitly open before DML statements and not SELECT statements. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 12:28:10 2016 From: report at bugs.python.org (mike bayer) Date: Wed, 23 Mar 2016 16:28:10 +0000 Subject: [issue10740] sqlite3 module breaks transactions and potentially corrupts data In-Reply-To: <1292868135.81.0.257293444934.issue10740@psf.upfronthosting.co.za> Message-ID: <1458750490.13.0.150667497816.issue10740@psf.upfronthosting.co.za> mike bayer added the comment: @rian - your issue for this is http://bugs.python.org/issue9924. The implicit BEGIN in all cases will probably never be the default but we do need an option for this to be the case, in order to support SERIALIZABLE isolation. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 12:28:34 2016 From: report at bugs.python.org (Rian Hunter) Date: Wed, 23 Mar 2016 16:28:34 +0000 Subject: [issue26625] SELECT-initiated transactions can cause "database is locked" in sqlite Message-ID: <1458750514.03.0.475841204409.issue26625@psf.upfronthosting.co.za> New submission from Rian Hunter: When a transaction starts with a SELECT statement this can invoke a "database is locked" error if the SELECT statement is not exhausted or explicitly closed. This can lead to subtle "database is locked" bugs, even when a large timeout is set on the connection. Many, many people are affected by this bug (search the web for "python sqlite database is locked"). The attached code demonstrates this bug and possible (unintuitive) fixes. The best workaround is to "explicitly" start a transaction in these cases by issuing a dummy DML statement. This seems very clumsy. My proposed fix is to implicitly open a transaction before all non-DDL statements (including SELECT statements), not just DML statements. If there won't be a fix soon, then at least the documentation should note this quirky behavior. ---------- components: Library (Lib) files: unintuitive_sqlite_behavior.py messages: 262282 nosy: rhunter priority: normal severity: normal status: open title: SELECT-initiated transactions can cause "database is locked" in sqlite 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/file42259/unintuitive_sqlite_behavior.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 12:31:37 2016 From: report at bugs.python.org (Rian Hunter) Date: Wed, 23 Mar 2016 16:31:37 +0000 Subject: [issue26625] SELECT-initiated transactions can cause "database is locked" in sqlite In-Reply-To: <1458750514.03.0.475841204409.issue26625@psf.upfronthosting.co.za> Message-ID: <1458750697.22.0.397623049089.issue26625@psf.upfronthosting.co.za> Rian Hunter added the comment: duplicate of #9924 ---------- resolution: -> duplicate status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 12:38:51 2016 From: report at bugs.python.org (Rian Hunter) Date: Wed, 23 Mar 2016 16:38:51 +0000 Subject: [issue9924] sqlite3 SELECT does not BEGIN a transaction, but should according to spec In-Reply-To: <1285214166.49.0.269440190097.issue9924@psf.upfronthosting.co.za> Message-ID: <1458751131.34.0.643551687672.issue9924@psf.upfronthosting.co.za> Rian Hunter added the comment: This bug can also lead to subtle and unintuitive "database is locked" bugs, even when a large timeout is set on the connection. Many, many people are affected by this bug (search the web for "python sqlite database is locked"). I've attached code that demonstrates this issue. I disagree that the current behavior cuts down on SQLite file locking. As soon as any SELECT statement is opened, an implicit lock is held by SQLite (whether it resides within a BEGIN block or not): https://www.sqlite.org/lockingv3.html SQLite has been designed to do its own "late locking." Pysqlite does not need to duplicate this behavior. This is a clear-as-day bug and should be fixed. ---------- nosy: +rhunter Added file: http://bugs.python.org/file42260/unintuitive_sqlite_behavior.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 12:39:00 2016 From: report at bugs.python.org (Rian Hunter) Date: Wed, 23 Mar 2016 16:39:00 +0000 Subject: [issue9924] sqlite3 SELECT does not BEGIN a transaction, but should according to spec In-Reply-To: <1285214166.49.0.269440190097.issue9924@psf.upfronthosting.co.za> Message-ID: <1458751140.56.0.370060225509.issue9924@psf.upfronthosting.co.za> Changes by Rian Hunter : ---------- versions: +Python 3.2, Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 12:40:23 2016 From: report at bugs.python.org (Rian Hunter) Date: Wed, 23 Mar 2016 16:40:23 +0000 Subject: [issue10740] sqlite3 module breaks transactions and potentially corrupts data In-Reply-To: <1292868135.81.0.257293444934.issue10740@psf.upfronthosting.co.za> Message-ID: <1458751223.14.0.0981918334422.issue10740@psf.upfronthosting.co.za> Changes by Rian Hunter : ---------- nosy: -rhunter _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 12:41:45 2016 From: report at bugs.python.org (STINNER Victor) Date: Wed, 23 Mar 2016 16:41:45 +0000 Subject: [issue26624] Windows hangs in call to CRT setlocale() In-Reply-To: <1458747871.12.0.710719467032.issue26624@psf.upfronthosting.co.za> Message-ID: <1458751305.67.0.0558760863887.issue26624@psf.upfronthosting.co.za> STINNER Victor added the comment: Random links from Google: * http://stackoverflow.com/questions/35572792/setlocale-stuck-on-windows "Sometimes it works but sometimes it never returns from it. I can not identify the reason. I use Visual Studio 2015 and Windows 7." * https://bugs.chromium.org/p/webrtc/issues/detail?id=5507 " Summary: Dr Memory errors in MSVCP140D.dll when switching to VS2015" ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 12:53:03 2016 From: report at bugs.python.org (Terry J. Reedy) Date: Wed, 23 Mar 2016 16:53:03 +0000 Subject: [issue23551] IDLE to provide menu link to PIP gui. In-Reply-To: <1425155752.55.0.0736033483828.issue23551@psf.upfronthosting.co.za> Message-ID: <1458751983.83.0.210265446888.issue23551@psf.upfronthosting.co.za> Terry J. Reedy added the comment: Upendra and Eric: I look through and successfully ran both your files as they are, without change. You both show a basic ability to write a simple tkinter app. Upendra's is more complete as a demo because a) it has two tabs that I can switch between, even though the second is blank, and b) the first tab shows real data -- the list of installed packages on my system. Eric, if you submit a proposal for this project, I would like to see these upgrades (without copying, of course). Style nit: I don't like 'import *' and prefer 'as tk' or 'import Tk, Frame, ...'. This choice partly depends on whether one prefers to use for options the named constants like EXTENDED or literal strings like 'extended'. You don't need to rewrite now as long as you are *willing* to change, perhaps after discussing which alternative to use, if selected. Eric: classes should be capitalized, but not all caps. 'Pip' would be fine. In general, I want to follow PEP8 for new code. At least as important as style is structuring for testability, which IDLE is not :-(. Collecting data and displaying data should literally be separate functions: a get_data and a display_data. (An extra reason to do this in the stdlib context is that only a small subset of CPython buildbots have graphic screens and run gui tests.) Another change would be to replace Get_data sends a request to pip and parses the output strings into a Python data object. Its unittests would use a mock-pip that returns output copied and adapted from real pip request. The unittest would then check that the data object equals the expected object. Display_data receives the data object and changes the display. Testing this is trickier. It requires the 'gui' resource. An initial test is that it run without raising an exception. Some other checks can be automated. Checking that the display 'looks right' has to be done by a human. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 12:57:20 2016 From: report at bugs.python.org (Jeremy Kloth) Date: Wed, 23 Mar 2016 16:57:20 +0000 Subject: [issue26624] Windows hangs in call to CRT setlocale() In-Reply-To: <1458747871.12.0.710719467032.issue26624@psf.upfronthosting.co.za> Message-ID: <1458752240.63.0.794091101542.issue26624@psf.upfronthosting.co.za> Jeremy Kloth added the comment: >From the UCRT sources: // Deadlock Avoidance: When a new thread is created in the process, we // create a new PTD for the thread. The PTD initialization function is // called under the loader lock. This initialization function will also // acquire the locale lock in order to acquire a reference to the current // global locale for the new thread. // // Some of the locale APIs are not available on all supported target OSes. // We dynamically obtain these libraries via LoadLibrary/GetProcAddress. // We must ensure that no call to LoadLibrary is made while we hold the // locale lock, lest we deadlock due to lock order inversion between the // loader lock and the locale lock. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 12:58:02 2016 From: report at bugs.python.org (ink) Date: Wed, 23 Mar 2016 16:58:02 +0000 Subject: [issue26626] test_dbm_gnu Message-ID: <1458752282.36.0.8486326367.issue26626@psf.upfronthosting.co.za> New submission from ink: Hello, I was running post-build tests after building 3.5.1 when test_dbm_gnu hanged on an error. The same happens with 3.4.4 so it's not version relevant. Furthermore, this happens on an NFS mounted storage but not on our Lustre volume. Most of the time it just hangs on OSError. We probably don't need dbm but the issue seems to be directory related and directories cannot be handled properly there could be other implications. The build process was usual ./configure --prefix=/apps/python/3.5.1 --enable-shared --with-threads make make test Thank you for any advice By the way, on its own, the test runs fine LD_LIBRARY_PATH=/apps/python/src/Python-3.5.1 ./python ./Lib/test/test_dbm_gnu.py ..... ---------------------------------------------------------------------- Ran 5 tests in 0.026s OK but not as part of the regression tests [114/397/2] test_dbm_gnu Warning -- files was modified by test_dbm_gnu Traceback (most recent call last): File "/opt/gridware/apps/python/src/Python-3.5.1/Lib/test/support/__init__.py", line 899, in temp_dir yield path File "/opt/gridware/apps/python/src/Python-3.5.1/Lib/test/support/__init__.py", line 948, in temp_cwd yield cwd_dir File "/opt/gridware/apps/python/src/Python-3.5.1/Lib/test/regrtest.py", line 1591, in main_in_temp_cwd main() File "/opt/gridware/apps/python/src/Python-3.5.1/Lib/test/regrtest.py", line 554, in main sys.exit(0) SystemExit: 0 During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/opt/gridware/apps/python/src/Python-3.5.1/Lib/runpy.py", line 170, in _run_module_as_main "__main__", mod_spec) File "/opt/gridware/apps/python/src/Python-3.5.1/Lib/runpy.py", line 85, in _run_code exec(code, run_globals) File "/opt/gridware/apps/python/src/Python-3.5.1/Lib/test/regrtest.py", line 1616, in main_in_temp_cwd() File "/opt/gridware/apps/python/src/Python-3.5.1/Lib/test/regrtest.py", line 1591, in main_in_temp_cwd main() File "/opt/gridware/apps/python/src/Python-3.5.1/Lib/contextlib.py", line 77, in __exit__ self.gen.throw(type, value, traceback) File "/opt/gridware/apps/python/src/Python-3.5.1/Lib/test/support/__init__.py", line 948, in temp_cwd yield cwd_dir File "/opt/gridware/apps/python/src/Python-3.5.1/Lib/contextlib.py", line 77, in __exit__ self.gen.throw(type, value, traceback) File "/opt/gridware/apps/python/src/Python-3.5.1/Lib/test/support/__init__.py", line 902, in temp_dir shutil.rmtree(path) File "/opt/gridware/apps/python/src/Python-3.5.1/Lib/shutil.py", line 474, in rmtree _rmtree_safe_fd(fd, path, onerror) File "/opt/gridware/apps/python/src/Python-3.5.1/Lib/shutil.py", line 432, in _rmtree_safe_fd onerror(os.unlink, fullname, sys.exc_info()) File "/opt/gridware/apps/python/src/Python-3.5.1/Lib/shutil.py", line 430, in _rmtree_safe_fd os.unlink(name, dir_fd=topfd) OSError: [Errno 16] Device or resource busy: '.nfs00000000027813d70000000c' Traceback (most recent call last): File "/opt/gridware/apps/python/src/Python-3.5.1/Lib/runpy.py", line 170, in _run_module_as_main "__main__", mod_spec) File "/opt/gridware/apps/python/src/Python-3.5.1/Lib/runpy.py", line 85, in _run_code exec(code, run_globals) File "/opt/gridware/apps/python/src/Python-3.5.1/Lib/test/__main__.py", line 3, in regrtest.main_in_temp_cwd() File "/opt/gridware/apps/python/src/Python-3.5.1/Lib/test/regrtest.py", line 1591, in main_in_temp_cwd main() File "/opt/gridware/apps/python/src/Python-3.5.1/Lib/test/regrtest.py", line 756, in main raise Exception("Child error on {}: {}".format(test, result[1])) Exception: Child error on test_dbm_gnu: Exit code 1 ^CException ignored in: Traceback (most recent call last): File "/opt/gridware/apps/python/src/Python-3.5.1/Lib/threading.py", line 1288, in _shutdown t.join() File "/opt/gridware/apps/python/src/Python-3.5.1/Lib/threading.py", line 1054, in join self._wait_for_tstate_lock() File "/opt/gridware/apps/python/src/Python-3.5.1/Lib/threading.py", line 1070, in _wait_for_tstate_lock elif lock.acquire(block, timeout): KeyboardInterrupt ---------- components: Tests messages: 262288 nosy: ink priority: normal severity: normal status: open title: test_dbm_gnu type: crash versions: Python 3.4, Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 13:29:08 2016 From: report at bugs.python.org (Berker Peksag) Date: Wed, 23 Mar 2016 17:29:08 +0000 Subject: [issue26625] SELECT-initiated transactions can cause "database is locked" in sqlite In-Reply-To: <1458750514.03.0.475841204409.issue26625@psf.upfronthosting.co.za> Message-ID: <1458754148.13.0.979257776052.issue26625@psf.upfronthosting.co.za> Changes by Berker Peksag : ---------- stage: -> resolved superseder: -> sqlite3 SELECT does not BEGIN a transaction, but should according to spec _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 13:38:16 2016 From: report at bugs.python.org (Roundup Robot) Date: Wed, 23 Mar 2016 17:38:16 +0000 Subject: [issue23848] faulthandler: setup an exception handler on Windows In-Reply-To: <1427962559.63.0.750474204561.issue23848@psf.upfronthosting.co.za> Message-ID: <20160323173813.13399.12274.1C9B9085@psf.io> Roundup Robot added the comment: New changeset 3247f8df5514 by Victor Stinner in branch 'default': Issue #23848: Fix usage of _Py_DumpDecimal() https://hg.python.org/cpython/rev/3247f8df5514 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 13:40:53 2016 From: report at bugs.python.org (Roundup Robot) Date: Wed, 23 Mar 2016 17:40:53 +0000 Subject: [issue26525] Documentation of ord(c) easy to misread In-Reply-To: <1457599892.41.0.987128084347.issue26525@psf.upfronthosting.co.za> Message-ID: <20160323174043.40395.78831.C2A99D5C@psf.io> Roundup Robot added the comment: New changeset f3bd94c57cd8 by Terry Jan Reedy in branch '3.5': Issue #26525: Change chr example to match change in ord example. https://hg.python.org/cpython/rev/f3bd94c57cd8 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 13:42:15 2016 From: report at bugs.python.org (Terry J. Reedy) Date: Wed, 23 Mar 2016 17:42:15 +0000 Subject: [issue26525] Documentation of ord(c) easy to misread In-Reply-To: <1457599892.41.0.987128084347.issue26525@psf.upfronthosting.co.za> Message-ID: <1458754935.93.0.962460365294.issue26525@psf.upfronthosting.co.za> Terry J. Reedy added the comment: Agreed. Good catch. ---------- status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 13:47:56 2016 From: report at bugs.python.org (Roundup Robot) Date: Wed, 23 Mar 2016 17:47:56 +0000 Subject: [issue18787] Misleading error from getspnam function of spwd module In-Reply-To: <1376971981.98.0.467831293927.issue18787@psf.upfronthosting.co.za> Message-ID: <20160323174722.78791.80389.04D23347@psf.io> Roundup Robot added the comment: New changeset 430af393d8f1 by Victor Stinner in branch 'default': Try to fix test_spwd on OpenIndiana https://hg.python.org/cpython/rev/430af393d8f1 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 14:00:45 2016 From: report at bugs.python.org (Tadhg McDonald-Jensen) Date: Wed, 23 Mar 2016 18:00:45 +0000 Subject: [issue26627] IDLE incorrectly labeling error as internal Message-ID: <1458756045.86.0.656079576242.issue26627@psf.upfronthosting.co.za> New submission from Tadhg McDonald-Jensen: (I apologize if I'm doing something wrong) When using a file named run.py in idle, any errors raised from the module makes IDLE show a traceback like this: Traceback (most recent call last): ** IDLE Internal Exception: File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/idlelib/run.py", line 351, in runcode exec(code, self.locals) File "/Users/Tadhg/Documents/run.py", line 1, in raise ValueError ValueError I looked into idlelib.run and think the culprit is the way print_exception tries to exclude internal files, specifically line 180 in vs 2.7 and line 206 in vs3.5 exclude = ("run.py", "rpc.py", "threading.py", "queue.py", "RemoteDebugger.py", "bdb.py") this excludes paths with these names anywhere in the path (later in cleanup_traceback) instead of getting the absolute paths of these modules. ---------- components: IDLE files: run.py messages: 262293 nosy: Tadhg McDonald-Jensen priority: normal severity: normal status: open title: IDLE incorrectly labeling error as internal type: behavior versions: Python 2.7, Python 3.5 Added file: http://bugs.python.org/file42261/run.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 14:07:26 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 23 Mar 2016 18:07:26 +0000 Subject: [issue24266] raw_input + readline: Ctrl+C during search breaks readline In-Reply-To: <1432306683.9.0.470835567306.issue24266@psf.upfronthosting.co.za> Message-ID: <1458756446.87.0.748217011302.issue24266@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Thank you Martin. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 14:13:25 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 23 Mar 2016 18:13:25 +0000 Subject: [issue26627] IDLE incorrectly labeling error as internal In-Reply-To: <1458756045.86.0.656079576242.issue26627@psf.upfronthosting.co.za> Message-ID: <1458756805.59.0.0396840525617.issue26627@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- nosy: +kbk, roger.serwy, terry.reedy versions: +Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 14:26:09 2016 From: report at bugs.python.org (Alexander Belopolsky) Date: Wed, 23 Mar 2016 18:26:09 +0000 Subject: [issue26616] A bug in datetime.astimezone() method In-Reply-To: <1458710706.19.0.994284495334.issue26616@psf.upfronthosting.co.za> Message-ID: <1458757569.26.0.50498937201.issue26616@psf.upfronthosting.co.za> Changes by Alexander Belopolsky : ---------- assignee: -> belopolsky keywords: +patch nosy: +haypo, tim.peters stage: needs patch -> patch review Added file: http://bugs.python.org/file42262/issue26616.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 14:34:28 2016 From: report at bugs.python.org (Alexander Belopolsky) Date: Wed, 23 Mar 2016 18:34:28 +0000 Subject: [issue26616] A bug in datetime.astimezone() method In-Reply-To: <1458710706.19.0.994284495334.issue26616@psf.upfronthosting.co.za> Message-ID: <1458758068.76.0.0850994385844.issue26616@psf.upfronthosting.co.za> Alexander Belopolsky added the comment: This bug affects versions starting at 3.3. Can someone advise to what versions the patch should be applied? ---------- versions: +Python 3.3, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 14:38:07 2016 From: report at bugs.python.org (Berker Peksag) Date: Wed, 23 Mar 2016 18:38:07 +0000 Subject: [issue26616] A bug in datetime.astimezone() method In-Reply-To: <1458710706.19.0.994284495334.issue26616@psf.upfronthosting.co.za> Message-ID: <1458758287.59.0.566644090569.issue26616@psf.upfronthosting.co.za> Berker Peksag added the comment: 3.3 and 3.4 are in security-fix-only mode: https://docs.python.org/devguide/devcycle.html#summary So this can be fixed in 3.5 and default branches. ---------- nosy: +berker.peksag _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 14:42:06 2016 From: report at bugs.python.org (Zbynek Winkler) Date: Wed, 23 Mar 2016 18:42:06 +0000 Subject: [issue25824] 32-bit 2.7.11 installer creates registry keys that are incompatible with the installed python27.dll In-Reply-To: <1449584200.04.0.891595448742.issue25824@psf.upfronthosting.co.za> Message-ID: <1458758526.66.0.35390069036.issue25824@psf.upfronthosting.co.za> Changes by Zbynek Winkler : ---------- nosy: +Zbynek.Winkler _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 15:21:10 2016 From: report at bugs.python.org (paul j3) Date: Wed, 23 Mar 2016 19:21:10 +0000 Subject: [issue9694] argparse required arguments displayed under "optional arguments" In-Reply-To: <1282846759.11.0.900867962743.issue9694@psf.upfronthosting.co.za> Message-ID: <1458760870.93.0.510524470784.issue9694@psf.upfronthosting.co.za> paul j3 added the comment: This ArgumentDefaultHelpFormatter issue should probably be raised in its own issue. It applies to 'required' optionals, but any patch would be independent of the issues discussed here. This class defines a method that adds the '%(default)' string to the help in certain situations. It already skips required positionals. So adding a test for 'action.required' should be easy. def _get_help_string(self, action): help = action.help if '%(default)' not in action.help: if action.default is not SUPPRESS: defaulting_nargs = [OPTIONAL, ZERO_OR_MORE] if action.option_strings or action.nargs in defaulting_nargs: help += ' (default: %(default)s)' return help There are 2 easy user fixes. - a custom HelpFormatter class that implements this fix. - 'default=argparse.SUPPRESS' for arguments where you do not want to see the default. This SUPPRESS is checked else where in the code, but for a required argument I don't think that matters (but it needs testing). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 15:29:32 2016 From: report at bugs.python.org (Alexander Belopolsky) Date: Wed, 23 Mar 2016 19:29:32 +0000 Subject: [issue26591] datetime datetime.time to datetime.time comparison does nothing In-Reply-To: <1458373720.99.0.780228236927.issue26591@psf.upfronthosting.co.za> Message-ID: <1458761372.5.0.714482687516.issue26591@psf.upfronthosting.co.za> Changes by Alexander Belopolsky : ---------- nosy: +belopolsky _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 15:39:54 2016 From: report at bugs.python.org (Alexander Belopolsky) Date: Wed, 23 Mar 2016 19:39:54 +0000 Subject: [issue25729] update pure python datetime.timedelta creation In-Reply-To: <1448437946.34.0.869547453804.issue25729@psf.upfronthosting.co.za> Message-ID: <1458761994.06.0.727342856382.issue25729@psf.upfronthosting.co.za> Changes by Alexander Belopolsky : ---------- assignee: -> belopolsky stage: patch review -> commit review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 15:50:34 2016 From: report at bugs.python.org (Roundup Robot) Date: Wed, 23 Mar 2016 19:50:34 +0000 Subject: [issue26621] test_decimal fails with libmpdecimal 2.4.2 In-Reply-To: <1458736963.71.0.573230549815.issue26621@psf.upfronthosting.co.za> Message-ID: <20160323195031.21094.25221.1DA5E1F6@psf.io> Roundup Robot added the comment: New changeset 24c8bb9421f4 by Stefan Krah in branch 'default': Issue #26621: Update libmpdec version and remove unnecessary test case. https://hg.python.org/cpython/rev/24c8bb9421f4 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 15:57:46 2016 From: report at bugs.python.org (Stefan Krah) Date: Wed, 23 Mar 2016 19:57:46 +0000 Subject: [issue26621] test_decimal fails with libmpdecimal 2.4.2 In-Reply-To: <1458736963.71.0.573230549815.issue26621@psf.upfronthosting.co.za> Message-ID: <1458763066.29.0.770650558584.issue26621@psf.upfronthosting.co.za> Stefan Krah added the comment: Thanks, the test was not needed: It was more of a reminder to sync the version numbers. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 15:58:46 2016 From: report at bugs.python.org (Stefan Krah) Date: Wed, 23 Mar 2016 19:58:46 +0000 Subject: [issue26621] test_decimal fails with libmpdecimal 2.4.2 In-Reply-To: <1458736963.71.0.573230549815.issue26621@psf.upfronthosting.co.za> Message-ID: <1458763126.09.0.04590873143.issue26621@psf.upfronthosting.co.za> Changes by Stefan Krah : ---------- assignee: -> skrah resolution: -> fixed stage: -> resolved status: open -> closed type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 16:03:48 2016 From: report at bugs.python.org (Matthias Klose) Date: Wed, 23 Mar 2016 20:03:48 +0000 Subject: [issue26621] test_decimal fails with libmpdecimal 2.4.2 In-Reply-To: <1458736963.71.0.573230549815.issue26621@psf.upfronthosting.co.za> Message-ID: <1458763428.92.0.434402076581.issue26621@psf.upfronthosting.co.za> Matthias Klose added the comment: please apply this to the 3.5 branch as well ---------- status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 16:08:55 2016 From: report at bugs.python.org (Stefan Krah) Date: Wed, 23 Mar 2016 20:08:55 +0000 Subject: [issue26621] test_decimal fails with libmpdecimal 2.4.2 In-Reply-To: <1458736963.71.0.573230549815.issue26621@psf.upfronthosting.co.za> Message-ID: <1458763735.91.0.259042145983.issue26621@psf.upfronthosting.co.za> Stefan Krah added the comment: I did: Somehow roundup failed to catch it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 16:16:18 2016 From: report at bugs.python.org (Roundup Robot) Date: Wed, 23 Mar 2016 20:16:18 +0000 Subject: [issue26621] test_decimal fails with libmpdecimal 2.4.2 In-Reply-To: <1458736963.71.0.573230549815.issue26621@psf.upfronthosting.co.za> Message-ID: <20160323195416.36554.81067.5337C7FA@psf.io> Roundup Robot added the comment: New changeset 3ec98f352053 by Stefan Krah in branch '3.5': Issue #26621: Remove unnecessary test. https://hg.python.org/cpython/rev/3ec98f352053 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 16:16:18 2016 From: report at bugs.python.org (Roundup Robot) Date: Wed, 23 Mar 2016 20:16:18 +0000 Subject: [issue18787] Misleading error from getspnam function of spwd module In-Reply-To: <1376971981.98.0.467831293927.issue18787@psf.upfronthosting.co.za> Message-ID: <20160323201604.36554.69751.770DD3E2@psf.io> Roundup Robot added the comment: New changeset c1677c8f92e1 by Victor Stinner in branch 'default': Fix test_spwd on OpenIndiana https://hg.python.org/cpython/rev/c1677c8f92e1 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 16:19:53 2016 From: report at bugs.python.org (Stefan Krah) Date: Wed, 23 Mar 2016 20:19:53 +0000 Subject: [issue26621] test_decimal fails with libmpdecimal 2.4.2 In-Reply-To: <1458736963.71.0.573230549815.issue26621@psf.upfronthosting.co.za> Message-ID: <1458764393.13.0.276673201291.issue26621@psf.upfronthosting.co.za> Stefan Krah added the comment: The roundup timeline is a lie. :) I pushed the 3.5 patch shortly after the 3.6 one and well before msg262302. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 16:21:33 2016 From: report at bugs.python.org (Stefan Krah) Date: Wed, 23 Mar 2016 20:21:33 +0000 Subject: [issue26621] test_decimal fails with libmpdecimal 2.4.2 In-Reply-To: <1458736963.71.0.573230549815.issue26621@psf.upfronthosting.co.za> Message-ID: <1458764493.15.0.928675051706.issue26621@psf.upfronthosting.co.za> Changes by Stefan Krah : ---------- status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 16:29:30 2016 From: report at bugs.python.org (Antony Lee) Date: Wed, 23 Mar 2016 20:29:30 +0000 Subject: [issue20012] Re: Allow Path.relative_to() to accept non-ancestor paths In-Reply-To: <1387347011.06.0.0464883312921.issue20012@psf.upfronthosting.co.za> Message-ID: <1458764970.98.0.856831007555.issue20012@psf.upfronthosting.co.za> Antony Lee added the comment: Kindly bumping the issue. I'd suggest overriding `PurePath.relative_to` in the `Path` class, to something like `PurePath.relative_to(self, other, *, allow_ancestor=False): ...`, which would resolve each ancestor of `self` successively to check whether it is also an ancestor of `other`, so that symlinks would be handled correctly. ---------- nosy: +Antony.Lee _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 16:41:58 2016 From: report at bugs.python.org (Guido van Rossum) Date: Wed, 23 Mar 2016 20:41:58 +0000 Subject: [issue26391] Specialized sub-classes of Generic never call __init__ In-Reply-To: <1455882742.53.0.118642694532.issue26391@psf.upfronthosting.co.za> Message-ID: <1458765718.2.0.271478140613.issue26391@psf.upfronthosting.co.za> Guido van Rossum added the comment: You've hit a type where PEP 484 and mypy disagree. The PEP shows a few examples of this: https://www.python.org/dev/peps/pep-0484/#instantiating-generic-classes-and-type-erasure However when I feed the examples from the PEP to mypy I get an error on each of the last two lines: ----- from typing import TypeVar, Generic T = TypeVar('T') class Node(Generic[T]): pass x = Node[T]() y = Node[int]() ----- b.py:5: error: Invalid type "b.T" b.py:5: error: Generic type not valid as an expression any more (use '# type:' comment instead) b.py:6: error: Generic type not valid as an expression any more (use '# type:' comment instead) I suspect that mypy is right and the PEP didn't catch up to the change of mind in the flurry of activity right before acceptance. Since it's provisional I'd like to change the PEP to disallow this. At the same time at runtime I think it should either fail loudly or work, not silently return an uninitialized instance, so typing.py also needs to be fixed. Thanks for the report! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 16:49:34 2016 From: report at bugs.python.org (SilentGhost) Date: Wed, 23 Mar 2016 20:49:34 +0000 Subject: [issue26626] test_dbm_gnu In-Reply-To: <1458752282.36.0.8486326367.issue26626@psf.upfronthosting.co.za> Message-ID: <1458766174.44.0.627321489222.issue26626@psf.upfronthosting.co.za> Changes by SilentGhost : ---------- nosy: +georg.brandl versions: -Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 16:52:16 2016 From: report at bugs.python.org (Thomas) Date: Wed, 23 Mar 2016 20:52:16 +0000 Subject: [issue26628] Segfault in cffi with ctypes.union argument Message-ID: <1458766336.13.0.0388960184699.issue26628@psf.upfronthosting.co.za> New submission from Thomas: Passing ctypes.Union types as arguments crashes python. Attached is a minimal example to reproduce. Due to undefined behavior, you may have to increase the union _fields_ to reproduce. I tested with 3.5.1 and 2.7.11. It seems that cffi treats the union as a normal struct. In classify_argument, it loops through the type->elements. The byte_offset increases for each union element until pos exceeds enum x86_64_reg_class classes[MAX_CLASSES], causing an invalid write here: size_t pos = byte_offset / 8; classes[i + pos] = merge_classes (subclasses[i], classes[i + pos]); I am quite scared considering the lack of any index checks in this code. At this point I'm not yet sure whether this is a bug in ctypes or libffi. #0 classify_argument (type=0xce41b8, classes=0x7fffffffb4e0, byte_offset=8) at Python-3.5.1/Modules/_ctypes/libffi/src/x86/ffi64.c:248 #1 0x00007ffff6bc6409 in examine_argument (type=0xce41b8, classes=0x7fffffffb4e0, in_return=false, pngpr=0x7fffffffb4dc, pnsse=0x7fffffffb4d8) at Python-3.5.1/Modules/_ctypes/libffi/src/x86/ffi64.c:318 #2 0x00007ffff6bc68ce in ffi_call (cif=0x7fffffffb590, fn=0x7ffff751d5a0, rvalue=0x7fffffffb660, avalue=0x7fffffffb640) at Python-3.5.1/Modules/_ctypes/libffi/src/x86/ffi64.c:462 #3 0x00007ffff6bb589e in _call_function_pointer (flags=4353, pProc=0x7ffff751d5a0, avalues=0x7fffffffb640, atypes=0x7fffffffb620, restype=0xcdd488, resmem=0x7fffffffb660, argcount=1) at Python-3.5.1/Modules/_ctypes/callproc.c:811 #4 0x00007ffff6bb6593 in _ctypes_callproc (pProc=0x7ffff751d5a0, argtuple=0xc8b3e8, flags=4353, argtypes=0xcb2098, restype=0xcdcd38, checker=0x0) at Python-3.5.1/Modules/_ctypes/callproc.c:1149 #5 0x00007ffff6baf84f in PyCFuncPtr_call (self=0xcf3708, inargs=0xc8b3e8, kwds=0x0) at Python-3.5.1/Modules/_ctypes/_ctypes.c:3869 #6 0x000000000043b66a in PyObject_Call (func=0xcf3708, arg=0xc8b3e8, kw=0x0) at ../../Python-3.5.1/Objects/abstract.c:2165 ---------- components: ctypes files: unioncrash.py messages: 262307 nosy: tilsche priority: normal severity: normal status: open title: Segfault in cffi with ctypes.union argument type: crash versions: Python 2.7, Python 3.5 Added file: http://bugs.python.org/file42263/unioncrash.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 16:54:27 2016 From: report at bugs.python.org (Buraddin Ibn-Karlo) Date: Wed, 23 Mar 2016 20:54:27 +0000 Subject: [issue26629] Need an ability to build standard DLLs with distutils Message-ID: <1458766467.89.0.930968148514.issue26629@psf.upfronthosting.co.za> New submission from Buraddin Ibn-Karlo: I want to make a a dynamic library to run its function with ctypes. Also I want to build the library from sources with distutils (the C++ sources are distributed with my Python code). But alas! Our distutils fails, if the library doesn't have initialization function (something like init_). Even if the module does not need any initialization. I did a quick and dirty solution: added a dummy function: void init_(){} It somehow works, but I don't think that it is a good idea. Cannot you add the possibility to tell distutils, that this extention module is just a simple DLL, that will be used via ctypes (or somehow else) and it does not need any extra init script? Also, cannot you add an extra section to ctypes documentation? With a description how to build such extensions via distutils? ---------- assignee: docs at python components: Build, Documentation, Extension Modules, Windows, ctypes messages: 262308 nosy: Buraddin Ibn-Karlo, docs at python, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: Need an ability to build standard DLLs with distutils type: enhancement versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 16:57:56 2016 From: report at bugs.python.org (SilentGhost) Date: Wed, 23 Mar 2016 20:57:56 +0000 Subject: [issue26628] Segfault in cffi with ctypes.union argument In-Reply-To: <1458766336.13.0.0388960184699.issue26628@psf.upfronthosting.co.za> Message-ID: <1458766676.05.0.916353427523.issue26628@psf.upfronthosting.co.za> Changes by SilentGhost : ---------- nosy: +amaury.forgeotdarc, belopolsky, meador.inge _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 17:05:18 2016 From: report at bugs.python.org (Roundup Robot) Date: Wed, 23 Mar 2016 21:05:18 +0000 Subject: [issue26588] _tracemalloc: add support for multiple address spaces (domains) In-Reply-To: <1458337167.06.0.908004959718.issue26588@psf.upfronthosting.co.za> Message-ID: <20160323210514.8158.45720.08CE4DAA@psf.io> Roundup Robot added the comment: New changeset 06552275fa30 by Victor Stinner in branch 'default': _tracemalloc: use compact key for traces https://hg.python.org/cpython/rev/06552275fa30 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 17:08:14 2016 From: report at bugs.python.org (Thomas) Date: Wed, 23 Mar 2016 21:08:14 +0000 Subject: [issue26628] Segfault in cffi with ctypes.union argument In-Reply-To: <1458766336.13.0.0388960184699.issue26628@psf.upfronthosting.co.za> Message-ID: <1458767294.17.0.87118649712.issue26628@psf.upfronthosting.co.za> Thomas added the comment: Note [http://www.atmark-techno.com/~yashi/libffi.html] > Although ?libffi? has no special support for unions or bit-fields, it is perfectly happy passing structures back and forth. You must first describe the structure to ?libffi? by creating a new ffi_type object for it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 17:31:41 2016 From: report at bugs.python.org (paul j3) Date: Wed, 23 Mar 2016 21:31:41 +0000 Subject: [issue26602] argparse doc introduction is inappropriately targeted In-Reply-To: <1458562294.77.0.347454712136.issue26602@psf.upfronthosting.co.za> Message-ID: <1458768701.65.0.131695568245.issue26602@psf.upfronthosting.co.za> paul j3 added the comment: By text and location the sidebar does not apply specifically to this example. It applies to the whole page, 'This page contains the API reference information.' Documentation for argparse is indeed a problem - both because of its complexity and how it is used. Many other reference modules focus on the classes and their methods. This is organized about one class, the parser object, and a couple of its methods. It's really more of an advanced user's tutorial, making most sense to users who already have use optparse and getopt. For them that initial example is appropriate, selling them on the power of this parser. For beginners I'd focus on the tutorial and its examples. Example or not this reference section can be overwhelming to beginning Python users. ---------- nosy: +paul.j3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 18:06:25 2016 From: report at bugs.python.org (Jason Erickson) Date: Wed, 23 Mar 2016 22:06:25 +0000 Subject: [issue26630] Windows EXE extension installers not finding 32bit Python 3.5 installation Message-ID: <1458770785.37.0.707130037196.issue26630@psf.upfronthosting.co.za> New submission from Jason Erickson: On both 64 and 32 bit Windows OSes, the 32bit version of Python 3.5 is unable to install extensions created with the command: setup.py bdist_wininst To reproduce, install the 32bit version of Python 3.5 and run the .exe installation for an extension, such as: http://www.stickpeople.com/projects/python/win-psycopg/2.6.1/psycopg2-2.6.1.win32-py3.5.exe https://bintray.com/artifact/download/pycurl/pycurl/pycurl-7.43.0.win32-py3.5.exe Clicking 'Next', the message "Python version 3.5 required, which was not found in the registry." will be displayed. Temporarily renaming the registry key (For 64bit Windows, under HKCU or HKLM): SOFTWARE\WOW6432Node\Python\PythonCore\3.5-32 to: SOFTWARE\WOW6432Node\Python\PythonCore\3.5 Allows the extensions to be installed. This indicates this is because 32bit Python 3.5 now uses the '3.5-32' as the string for the registry key whereas the bdist_wininst 'stub' is still expecting just the version, '3.5'. ---------- components: Distutils messages: 262312 nosy: dstufft, eric.araujo, jerickso priority: normal severity: normal status: open title: Windows EXE extension installers not finding 32bit Python 3.5 installation type: behavior versions: Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 18:23:18 2016 From: report at bugs.python.org (J Osell) Date: Wed, 23 Mar 2016 22:23:18 +0000 Subject: [issue26631] Unable to install Python 3.5.1 on Windows 10 - Error 0x80070643: Failed to install MSI package. Message-ID: <1458771798.71.0.333968276616.issue26631@psf.upfronthosting.co.za> New submission from J Osell: Unable to install Python 3.5.1 on Windows 10 - Error 0x80070643: Failed to install MSI package. ---------- components: Installation files: Python 3.5.1 (64-bit)_20160323181333.log messages: 262313 nosy: oselljr priority: normal severity: normal status: open title: Unable to install Python 3.5.1 on Windows 10 - Error 0x80070643: Failed to install MSI package. type: behavior versions: Python 3.5 Added file: http://bugs.python.org/file42264/Python 3.5.1 (64-bit)_20160323181333.log _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 19:06:50 2016 From: report at bugs.python.org (Jared Deckard) Date: Wed, 23 Mar 2016 23:06:50 +0000 Subject: [issue22401] argparse: 'resolve' conflict handler damages the actions of the parent parser In-Reply-To: <1410673598.78.0.274465754789.issue22401@psf.upfronthosting.co.za> Message-ID: <1458774410.78.0.628119248329.issue22401@psf.upfronthosting.co.za> Jared Deckard added the comment: This behavior is preventing me from using more than one parent parser. My use case is a convenience subcommand that performs two existing subcommands, therefore logically its subparser is required to support the arguments of both subparsers. The only conflict is the "help" argument, which is annoying, but setting the conflict handler to "resolve" on the child subparser should just ignore the first parent's "help" argument in favor of the second parent. Instead the "resolve" conflict handler breaks the first parent and causes it to output the help info no matter what arguments are given to it. I am forced to only include one parent and manually duplicate the arguments for any additional parents. ---------- components: -Documentation, Tests nosy: +deckar01 versions: +Python 2.7 -Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 20:31:41 2016 From: report at bugs.python.org (Martin Panter) Date: Thu, 24 Mar 2016 00:31:41 +0000 Subject: [issue9694] argparse required arguments displayed under "optional arguments" In-Reply-To: <1282846759.11.0.900867962743.issue9694@psf.upfronthosting.co.za> Message-ID: <1458779501.69.0.959696176989.issue9694@psf.upfronthosting.co.za> Martin Panter added the comment: Still applicable to Python 3 AFAIK ---------- versions: +Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 21:03:04 2016 From: report at bugs.python.org (Martin Panter) Date: Thu, 24 Mar 2016 01:03:04 +0000 Subject: [issue26620] Fix ResourceWarning warnings in test_urllib2_localnet In-Reply-To: <1458730745.01.0.796601838932.issue26620@psf.upfronthosting.co.za> Message-ID: <1458781384.22.0.450409880719.issue26620@psf.upfronthosting.co.za> Martin Panter added the comment: This patch looks okay to me. I left one review suggestion. Focussing on test_sending_headers(), the ResourceWarning seems to be only shown since revision 46329eec5515 (Issue 26590). In simpler cases, the warning would be bypassed due to Issue 19829. But in this cases it seems there is a garbage cycle which may be involved in the new warning. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 21:06:23 2016 From: report at bugs.python.org (Martin Panter) Date: Thu, 24 Mar 2016 01:06:23 +0000 Subject: [issue26612] test_ssl: use context manager (with) to fix ResourceWarning In-Reply-To: <1458694066.07.0.537208093993.issue26612@psf.upfronthosting.co.za> Message-ID: <1458781583.07.0.204974449954.issue26612@psf.upfronthosting.co.za> Martin Panter added the comment: My point about Python 2 was that this might add an annoying difference between the two branches. Even if you don?t apply this to Py 2, the next person adding or updating a test might be inclined to do it. Looking closer at your patch I admit that addCleanup() wouldn?t be appropriate except for the first change. Maybe it would be okay to leave the ?try / finally? cases as they are? Moving connect() inside is good though IMO. Anyway, I?m only mildly against this. I don?t see much benefit, but I could tolerate the downsides. I guess it?s up to you. ---------- components: +Tests stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 21:57:08 2016 From: report at bugs.python.org (paul j3) Date: Thu, 24 Mar 2016 01:57:08 +0000 Subject: [issue22401] argparse: 'resolve' conflict handler damages the actions of the parent parser In-Reply-To: <1410673598.78.0.274465754789.issue22401@psf.upfronthosting.co.za> Message-ID: <1458784628.89.0.137151208464.issue22401@psf.upfronthosting.co.za> paul j3 added the comment: Is this the kind of scenario that you have problems with? parser = argparse.ArgumentParser() sp = parser.add_subparsers(dest='cmd') p1 = sp.add_parser('cmd1') p1.add_argument('-f') p2 = sp.add_parser('cmd2') p2.add_argument('-b') p3 = sp.add_parser('cmd3', parents=[p1,p2],add_help=False, conflict_handler='resolve') p3.add_argument('-c') The problem is, apparently, that 'resolve' removes the '-h' option_string from the 1st subparser (but does not delete the whole action). A kludgy fix is to add the '-h' back in (after p3 is created): p1._actions[0].option_strings=['-h'] 'p1._actions' is the list of actions (arguments) for subparser p1. Usually help is the first action (if isn't in p3 because of the parents resolve action). I may work out a custom conflict handler function, but for now this appears to solve the issue. I don't know if the patch I proposed solves your issue or not. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 22:33:17 2016 From: report at bugs.python.org (Barry A. Warsaw) Date: Thu, 24 Mar 2016 02:33:17 +0000 Subject: [issue26632] __all__ decorator Message-ID: <1458786797.31.0.0749407715279.issue26632@psf.upfronthosting.co.za> New submission from Barry A. Warsaw: This is probably terrible, but given how difficult it is to keep __all__'s up to date, maybe something like this can be useful. I literally whipped this up in about 5 minutes, so sit back and watch the bikeshedding! import sys def public(thing): if isinstance(thing, str): mdict = sys._getframe(1).f_globals name = thing else: mdict = sys.modules[thing.__module__].__dict__ name = thing.__name__ dunder_all = mdict.setdefault('__all__', []) dunder_all.append(name) return thing Then: @public def baz(a, b): return a + b @public def buz(c, d): return c / d def qux(e, f): return e * f class zup: pass @public class zap: pass public('CONST1') CONST1 = 3 CONST2 = 4 public('CONST3') CONST3 = 5 Normally for any callable with an __name__, you can just decorate it with @public to add it to __all__. Of course that doesn't worth with things like constants, thus the str argument. But of course that also requires sys._getframe() so blech. ---------- messages: 262319 nosy: barry priority: normal severity: normal status: open title: __all__ decorator versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 22:35:23 2016 From: report at bugs.python.org (Barry A. Warsaw) Date: Thu, 24 Mar 2016 02:35:23 +0000 Subject: [issue26632] __all__ decorator In-Reply-To: <1458786797.31.0.0749407715279.issue26632@psf.upfronthosting.co.za> Message-ID: <1458786923.78.0.0239129941162.issue26632@psf.upfronthosting.co.za> Barry A. Warsaw added the comment: Oh, and it should be a built-in ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 22:38:46 2016 From: report at bugs.python.org (Ethan Furman) Date: Thu, 24 Mar 2016 02:38:46 +0000 Subject: [issue26632] __all__ decorator In-Reply-To: <1458786797.31.0.0749407715279.issue26632@psf.upfronthosting.co.za> Message-ID: <1458787126.49.0.872971478118.issue26632@psf.upfronthosting.co.za> Changes by Ethan Furman : ---------- nosy: +ethan.furman _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 22:48:08 2016 From: report at bugs.python.org (Ethan Furman) Date: Thu, 24 Mar 2016 02:48:08 +0000 Subject: [issue26632] __all__ decorator In-Reply-To: <1458786797.31.0.0749407715279.issue26632@psf.upfronthosting.co.za> Message-ID: <1458787688.43.0.0467845359815.issue26632@psf.upfronthosting.co.za> Ethan Furman added the comment: def public(thing, value=None): if isinstance(thing, str): mdict = sys._getframe(1).f_globals name = thing mdict[name] = thing # no need for retyping! ;) else: mdict = sys.modules[thing.__module__].__dict__ name = thing.__name__ dunder_all = mdict.setdefault('__all__', []) dunder_all.append(name) return thing @public def baz(a, b): return a+ b public('CONST1', 3) CONST2 = 4 ---------------------------- On the down side, you know somebody is going to @public a class' method -- how do we check for that? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 22:50:09 2016 From: report at bugs.python.org (Tadhg McDonald-Jensen) Date: Thu, 24 Mar 2016 02:50:09 +0000 Subject: [issue26627] IDLE incorrectly labeling error as internal In-Reply-To: <1458756045.86.0.656079576242.issue26627@psf.upfronthosting.co.za> Message-ID: <1458787809.17.0.243621135757.issue26627@psf.upfronthosting.co.za> Tadhg McDonald-Jensen added the comment: other then bdb.py all of the excluded modules are imported into idlelib.run so that line could be replaced with: import bdb exclude = (__file__, rpc.__file__, threading.__file__, queue.__file__, RemoteDebugger.__file__, bdb.__file__) although it is really only necessary for run, rpc and RemoteDebugger since they are imported through `idlelib.__` so it could also use a notation like this: exclude = ("idlelib/run.py", "idlelib/rpc.py", "threading.py", "queue.py", "idlelib/RemoteDebugger.py", "bdb.py") although this would need to make use of os.path.join or equivalent to be cross compatible. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 23:03:26 2016 From: report at bugs.python.org (paul j3) Date: Thu, 24 Mar 2016 03:03:26 +0000 Subject: [issue9694] argparse required arguments displayed under "optional arguments" In-Reply-To: <1282846759.11.0.900867962743.issue9694@psf.upfronthosting.co.za> Message-ID: <1458788606.77.0.792929990234.issue9694@psf.upfronthosting.co.za> paul j3 added the comment: I can see changing the group title from 'optional arguments' to 'options' or 'optionals' parser._optionals.title 'optional arguments' But I don't think there's a need to change references in the code or its comments from 'optionals' to 'options'. I like the parallelism between 'optionals' and 'positionals'. The terms are well defined in the code. During parsing, the 'required' attribute is only used at the end to check for missing arguments. In Stackoverflow questions I'm tended to talk about 'flagged arguments'. I still favor encouraging users to define their argument group(s), and making it easier to modify the titles of the two predefined groups. I don't see enough of a consensus on alternative titles to make more sweeping changes. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 23:17:15 2016 From: report at bugs.python.org (Josh Rosenberg) Date: Thu, 24 Mar 2016 03:17:15 +0000 Subject: [issue26633] multiprocessing behavior combining daemon with non-daemon children inconsistent with threading Message-ID: <1458789435.04.0.43504353002.issue26633@psf.upfronthosting.co.za> New submission from Josh Rosenberg: Unclear if this is just unclear docs, or incorrect behavior. Per this Stack Overflow question ( https://stackoverflow.com/questions/36191447/why-doesnt-the-daemon-program-exit-without-join ), you get some rather odd behavior when you have both daemon and non-daemon child processes. In the case described, the following steps occur: 1. A daemon Process is launched which prints a message, waits two seconds, then prints a second message 2. The main process sleeps one second 3. A non-daemon process is launched which behaves the same as the daemon process, but sleeps six seconds before the second message. 4. The main process completes The expected behavior (to my mind and the questioner on SO) is that since there is a non-daemon process running, the "process family" should stay alive until the non-daemon process finishes, which gives the daemon process time to wake up and print its second message (five seconds before the non-daemon process wakes to finish its "work"). But in fact, the atexit function used for cleanup in multiprocessing first calls .terminate() on all daemon children before join-ing all children. So the moment the main process completes, it immediately terminates the daemon child, even though the "process family" is still alive. This seems counter-intuitive; in the threading case, which multiprocessing is supposed to emulate, all non-daemon threads are equivalent, so no daemon threads are cleaned until the last non-daemon thread exits. To match the threading behavior, it seems like the cleanup code should first join all the non-daemon children, then terminate the daemon children, then join the daemon children. This would change the code here ( https://hg.python.org/cpython/file/3.5/Lib/multiprocessing/util.py#l303 ) from: for p in active_children(): if p.daemon: info('calling terminate() for daemon %s', p.name) p._popen.terminate() for p in active_children(): info('calling join() for process %s', p.name) p.join() to: # Wait on non-daemons first for p in active_children(): info('calling join() for process %s', p.name) if not p.daemon: p.join() # Terminate and clean up daemons now that non-daemons done for p in active_children(): if p.daemon: info('calling terminate() for daemon %s', p.name) p._popen.terminate() info('calling join() for process %s', p.name) p.join() I've attached repro code to demonstrate; using multiprocessing, the daemon never prints its exiting message, while switching to multiprocessing.dummy (backed by threading) correctly prints the exit message. ---------- components: Library (Lib) files: testmpdaemon.py messages: 262324 nosy: josh.r priority: normal severity: normal status: open title: multiprocessing behavior combining daemon with non-daemon children inconsistent with threading type: behavior versions: Python 2.7, Python 3.5, Python 3.6 Added file: http://bugs.python.org/file42265/testmpdaemon.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 23:21:10 2016 From: report at bugs.python.org (Josh Rosenberg) Date: Thu, 24 Mar 2016 03:21:10 +0000 Subject: [issue26633] multiprocessing behavior combining daemon with non-daemon children inconsistent with threading In-Reply-To: <1458789435.04.0.43504353002.issue26633@psf.upfronthosting.co.za> Message-ID: <1458789670.73.0.25848131137.issue26633@psf.upfronthosting.co.za> Josh Rosenberg added the comment: Oops, left the info log in my replacement code for the non-daemon case outside the if not daemon: block; it should be inside (since it's not joining the daemon threads). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 23:36:39 2016 From: report at bugs.python.org (Zachary Ware) Date: Thu, 24 Mar 2016 03:36:39 +0000 Subject: [issue26631] Unable to install Python 3.5.1 on Windows 10 - Error 0x80070643: Failed to install MSI package. In-Reply-To: <1458771798.71.0.333968276616.issue26631@psf.upfronthosting.co.za> Message-ID: <1458790599.95.0.406535656651.issue26631@psf.upfronthosting.co.za> Changes by Zachary Ware : ---------- components: +Windows nosy: +paul.moore, steve.dower, tim.golden, zach.ware _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 00:09:36 2016 From: report at bugs.python.org (Xiang Zhang) Date: Thu, 24 Mar 2016 04:09:36 +0000 Subject: [issue26634] recursive_repr forgets to override __qualname__ of wrapper Message-ID: <1458792576.69.0.965727650976.issue26634@psf.upfronthosting.co.za> New submission from Xiang Zhang: In reprlib.recursive_repr, it seems __qualname__ is forgotten. Giving the example in reprlib document, it gives a strange result 'recursive_repr..decorating_function..wrapper' of Mylist.__repr__.__qualname__. I simply add the assignment of __qualname__. But I doubt the treatment of __module__, __doc__, __name__, __qualname__ will raise AttributeError when they don't exist in user_function. Is this the desired behaviour or we'd better treat them like functools.update_wrapper, catch and then ignore the error. ---------- components: Library (Lib) files: qualname_of_recursive_repr_in_reprlib.patch keywords: patch messages: 262326 nosy: xiang.zhang priority: normal severity: normal status: open title: recursive_repr forgets to override __qualname__ of wrapper type: behavior versions: Python 3.6 Added file: http://bugs.python.org/file42266/qualname_of_recursive_repr_in_reprlib.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 01:02:06 2016 From: report at bugs.python.org (Raymond Hettinger) Date: Thu, 24 Mar 2016 05:02:06 +0000 Subject: [issue26634] recursive_repr forgets to override __qualname__ of wrapper In-Reply-To: <1458792576.69.0.965727650976.issue26634@psf.upfronthosting.co.za> Message-ID: <1458795726.74.0.677415763095.issue26634@psf.upfronthosting.co.za> Raymond Hettinger added the comment: FWIW, qualname was invented *after* recursive_repr, so it would be more accurate to say that qualname forgot recursive_repr :-) If you don't mind, please add a test to your patch. ---------- assignee: -> rhettinger nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 01:09:04 2016 From: report at bugs.python.org (Brian Guo) Date: Thu, 24 Mar 2016 05:09:04 +0000 Subject: [issue26616] A bug in datetime.astimezone() method In-Reply-To: <1458710706.19.0.994284495334.issue26616@psf.upfronthosting.co.za> Message-ID: <1458796144.41.0.731099721677.issue26616@psf.upfronthosting.co.za> Brian Guo added the comment: >From the datetime documentation of astimezone(): https://docs.python.org/3.5/library/datetime.html#datetime.datetime.astimezone : 'If called without arguments (or with tz=None) the system local timezone is assumed. The tzinfo attribute of the converted datetime instance will be set to an instance of timezone with the zone name and offset obtained from the OS.' You are correct in saying that there is an error in this implementation, but it is not that the second call should not change the timezone. Rather, the first call should have changed the timezone from UTC to America/New_York, or EST/EDT. When you made your first astimezone() call, (t = u.astimezone()), it was made without a tzinfo parameter, and should result in t's timzeone being EST by the documentation. I have provided a patch that successfully adheres to this documentation. On changing the method, some of the tests failed; I have changed those tests to pass on the correct implementation of the method. ---------- nosy: +BGuo1 Added file: http://bugs.python.org/file42267/bguo.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 01:11:43 2016 From: report at bugs.python.org (Eryk Sun) Date: Thu, 24 Mar 2016 05:11:43 +0000 Subject: [issue26630] Windows EXE extension installers not finding 32bit Python 3.5 installation In-Reply-To: <1458770785.37.0.707130037196.issue26630@psf.upfronthosting.co.za> Message-ID: <1458796303.69.0.906980603808.issue26630@psf.upfronthosting.co.za> Changes by Eryk Sun : ---------- components: +Windows nosy: +paul.moore, steve.dower, tim.golden, zach.ware resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> bdist_wininst created binaries fail to start and find 32bit Pythons _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 02:21:11 2016 From: report at bugs.python.org (Xiang Zhang) Date: Thu, 24 Mar 2016 06:21:11 +0000 Subject: [issue26634] recursive_repr forgets to override __qualname__ of wrapper In-Reply-To: <1458792576.69.0.965727650976.issue26634@psf.upfronthosting.co.za> Message-ID: <1458800471.1.0.329965624611.issue26634@psf.upfronthosting.co.za> Xiang Zhang added the comment: Hi, Raymond, I've added the test to test the assigned attributes. I use WRAPPER_ASSIGNMENTS in functools so we can keep them consistent. I don't know how to get the original func from the already decorated methods in this case so I define a new container. If there are mistakes or better solution, I am willing to know. ---------- Added file: http://bugs.python.org/file42268/qualname_of_recursive_repr_in_reprlib_v2.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 04:21:48 2016 From: report at bugs.python.org (Roundup Robot) Date: Thu, 24 Mar 2016 08:21:48 +0000 Subject: [issue25911] Regression: os.walk now using os.scandir() breaks bytes filenames on windows In-Reply-To: <1450539578.39.0.976654454489.issue25911@psf.upfronthosting.co.za> Message-ID: <20160324082139.78629.61811.82D0ADC6@psf.io> Roundup Robot added the comment: New changeset d54ee39b061f by Victor Stinner in branch 'default': Fix DeprecationWarning on Windows https://hg.python.org/cpython/rev/d54ee39b061f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 04:54:16 2016 From: report at bugs.python.org (SilentGhost) Date: Thu, 24 Mar 2016 08:54:16 +0000 Subject: [issue26633] multiprocessing behavior combining daemon with non-daemon children inconsistent with threading In-Reply-To: <1458789435.04.0.43504353002.issue26633@psf.upfronthosting.co.za> Message-ID: <1458809656.31.0.969823878875.issue26633@psf.upfronthosting.co.za> Changes by SilentGhost : ---------- nosy: +jnoller, sbt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 06:38:27 2016 From: report at bugs.python.org (SilentGhost) Date: Thu, 24 Mar 2016 10:38:27 +0000 Subject: [issue26076] redundant checks in tok_get in Parser\tokenizer.c In-Reply-To: <1452452400.02.0.853203557937.issue26076@psf.upfronthosting.co.za> Message-ID: <1458815907.37.0.262073301951.issue26076@psf.upfronthosting.co.za> SilentGhost added the comment: Could any one of the core developers have a look? Seems like a rather straightforward change. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 07:25:57 2016 From: report at bugs.python.org (Roundup Robot) Date: Thu, 24 Mar 2016 11:25:57 +0000 Subject: [issue25911] Regression: os.walk now using os.scandir() breaks bytes filenames on windows In-Reply-To: <1450539578.39.0.976654454489.issue25911@psf.upfronthosting.co.za> Message-ID: <20160324112553.93119.2284.79AD4A07@psf.io> Roundup Robot added the comment: New changeset eb91d0387d59 by Victor Stinner in branch 'default': Enhance os._DummyDirEntry https://hg.python.org/cpython/rev/eb91d0387d59 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 07:31:41 2016 From: report at bugs.python.org (STINNER Victor) Date: Thu, 24 Mar 2016 11:31:41 +0000 Subject: [issue25911] Regression: os.walk now using os.scandir() breaks bytes filenames on windows In-Reply-To: <1450539578.39.0.976654454489.issue25911@psf.upfronthosting.co.za> Message-ID: <1458819101.87.0.273444842629.issue25911@psf.upfronthosting.co.za> STINNER Victor added the comment: I faile to reproduce the bug by running test_os alone on Windows 8. I wrote a script to try to isolate a sequential list of tests which reproduce the bug on Windows, but I failed to find such list after 2 hours: https://bitbucket.org/haypo/misc/src/3e2e6138798c6cec061544ff116e50a8d1d6d2b8/python/isolate.py?fileviewer=file-view-default So I'm unable to reproduce the bug, I tried a change to enhance os._DummyDirEntry, it should now mimick better the C implementation of os.DirEntry. Let's see if the test still fails randomly... ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 08:07:57 2016 From: report at bugs.python.org (Eric Khoo Jiun Hooi) Date: Thu, 24 Mar 2016 12:07:57 +0000 Subject: [issue23551] IDLE to provide menu link to PIP gui. In-Reply-To: <1425155752.55.0.0736033483828.issue23551@psf.upfronthosting.co.za> Message-ID: <1458821277.23.0.83507681633.issue23551@psf.upfronthosting.co.za> Eric Khoo Jiun Hooi added the comment: Thank @Terry for your suggestion. I have been working on this few hour to fix and improve the code. I have also add some new feature into the application. Hope you can help me to review it again. Thank. About the proposal, please help me to review it if you have free time. ---------- Added file: http://bugs.python.org/file42269/pip_gui_v2.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 08:09:27 2016 From: report at bugs.python.org (Eric Khoo Jiun Hooi) Date: Thu, 24 Mar 2016 12:09:27 +0000 Subject: [issue23551] IDLE to provide menu link to PIP gui. In-Reply-To: <1425155752.55.0.0736033483828.issue23551@psf.upfronthosting.co.za> Message-ID: <1458821367.41.0.197243209427.issue23551@psf.upfronthosting.co.za> Changes by Eric Khoo Jiun Hooi : Added file: http://bugs.python.org/file42270/GSoC2016Proposal(1).pdf _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 08:27:28 2016 From: report at bugs.python.org (Eric Khoo Jiun Hooi) Date: Thu, 24 Mar 2016 12:27:28 +0000 Subject: [issue23551] IDLE to provide menu link to PIP gui. In-Reply-To: <1425155752.55.0.0736033483828.issue23551@psf.upfronthosting.co.za> Message-ID: <1458822448.38.0.672784122855.issue23551@psf.upfronthosting.co.za> Eric Khoo Jiun Hooi added the comment: I also change some of the design like instead of showing the installed package information beside the list, I think that it will be better to show the package information on a new pop up window. You can try to double click the list of search tab and installed package tab. It is functional now. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 08:34:38 2016 From: report at bugs.python.org (Mark Dickinson) Date: Thu, 24 Mar 2016 12:34:38 +0000 Subject: [issue26614] False/0 and True/1 collision when used as dict keys? In-Reply-To: <1458702240.3.0.550475924064.issue26614@psf.upfronthosting.co.za> Message-ID: <1458822878.11.0.575444817451.issue26614@psf.upfronthosting.co.za> Mark Dickinson added the comment: "Apparently True and 1 hash to the same item and False and 0 hash to the same item" Just to clear up a possible misconception here, the key point here is not that they hash to the same integer, but that they're *equal*: >>> True == 1 True >>> False == 0 True In contrast, here are two elements whose hash is equal but which serve as distinct keys: >>> hash(-1) == hash(-2) True >>> len({-1: -1, -2: -2}) 2 IOW, dictionary semantics are defined in terms of equality, not hashing. The hashing part should really be thought of as just a (somewhat exposed) implementation detail. ---------- nosy: +mark.dickinson _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 08:45:38 2016 From: report at bugs.python.org (Itay Grudev) Date: Thu, 24 Mar 2016 12:45:38 +0000 Subject: [issue26635] Python default date does not match Unix time Message-ID: <1458823538.48.0.621744004031.issue26635@psf.upfronthosting.co.za> New submission from Itay Grudev: When parsing a time only string like: ``` datetime.datetime.strptime('13:48:25', '%H:%M:%S') ``` This produces: ``` datetime.datetime(1900, 1, 1, 13, 48, 25) ``` Not that the year is `1900` which just doesn't make sense. This will produce `-1` when you attempt to get it's UNIX timestamp. And while that sounds weird it is very useful. The default year should be 1970. And this will resolve the issue. ---------- messages: 262337 nosy: Itay Grudev priority: normal severity: normal status: open title: Python default date does not match Unix time type: behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 08:47:51 2016 From: report at bugs.python.org (STINNER Victor) Date: Thu, 24 Mar 2016 12:47:51 +0000 Subject: [issue26614] False/0 and True/1 collision when used as dict keys? In-Reply-To: <1458702240.3.0.550475924064.issue26614@psf.upfronthosting.co.za> Message-ID: <1458823671.11.0.747941497664.issue26614@psf.upfronthosting.co.za> STINNER Victor added the comment: Many values have the same hash value, it's not an issue. The hash is only a best effort function to reduce hash collision, but hash collision is well handled in the dict type (as explained in other messages). >>> hash(1) == hash(1.0) == hash(1.0+0j) == 1 True >>> hash('') == hash(b'') == hash(0) == hash(0.0) == hash(0.0j) == 0 True ---------- nosy: +haypo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 08:52:44 2016 From: report at bugs.python.org (STINNER Victor) Date: Thu, 24 Mar 2016 12:52:44 +0000 Subject: [issue26635] Python default date does not match Unix time In-Reply-To: <1458823538.48.0.621744004031.issue26635@psf.upfronthosting.co.za> Message-ID: <1458823964.91.0.342619506433.issue26635@psf.upfronthosting.co.za> STINNER Victor added the comment: The year 1900 is a delibrate choice, it's even documented: https://docs.python.org/dev/library/datetime.html#strftime-and-strptime-behavior "For time objects, the format codes for year, month, and day should not be used, as time objects have no such values. If they?re used anyway, 1900 is substituted for the year, and 1 for the month and day." > The default year should be If you expect a year, you can easily use dt.replace(year=), no? Or start with a datetime.time object and then build a datetime.datetime using the time? It's up to you. We will not change a default value, it will break the backward compatibility. ---------- nosy: +belopolsky, haypo resolution: -> not a bug status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 09:17:38 2016 From: report at bugs.python.org (Roundup Robot) Date: Thu, 24 Mar 2016 13:17:38 +0000 Subject: [issue26620] Fix ResourceWarning warnings in test_urllib2_localnet In-Reply-To: <1458730745.01.0.796601838932.issue26620@psf.upfronthosting.co.za> Message-ID: <20160324131731.12211.25495.C888B551@psf.io> Roundup Robot added the comment: New changeset 54d7e9919876 by Victor Stinner in branch 'default': Closes #26620: Fix ResourceWarning in test_urllib2_localnet https://hg.python.org/cpython/rev/54d7e9919876 ---------- nosy: +python-dev resolution: -> fixed stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 09:20:46 2016 From: report at bugs.python.org (STINNER Victor) Date: Thu, 24 Mar 2016 13:20:46 +0000 Subject: [issue26620] Fix ResourceWarning warnings in test_urllib2_localnet In-Reply-To: <1458730745.01.0.796601838932.issue26620@psf.upfronthosting.co.za> Message-ID: <1458825646.79.0.319993668909.issue26620@psf.upfronthosting.co.za> STINNER Victor added the comment: Martin wrote: > This patch looks okay to me. I left one review suggestion. Thanks for the review, I changed this code. While testing one more time my patch with CTRL+c, I noticed that sometimes the servers are not stopped properly and os.environ is not restored. I made some extra changes to try to restore os.environ and try to close the server in more cases. It's not perfect. Since unittest.TestCase.doCleanups() doesn't handle KeyboardInterrupt, there is no warranty that cleanup functions are always executed. > Focussing on test_sending_headers(), the ResourceWarning seems to be only shown since revision 46329eec5515 (Issue 26590). In simpler cases, the warning would be bypassed due to Issue 19829. But in this cases it seems there is a garbage cycle which may be involved in the new warning. It's possible that Python 3.5 failed to log ResourceWarning in some cases, Python 3.6 should be better on this part. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 09:25:54 2016 From: report at bugs.python.org (Steve Dower) Date: Thu, 24 Mar 2016 13:25:54 +0000 Subject: [issue23551] IDLE to provide menu link to PIP gui. In-Reply-To: <1425155752.55.0.0736033483828.issue23551@psf.upfronthosting.co.za> Message-ID: <1458825954.78.0.138968458543.issue23551@psf.upfronthosting.co.za> Changes by Steve Dower : ---------- nosy: -steve.dower _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 09:27:15 2016 From: report at bugs.python.org (Thomas) Date: Thu, 24 Mar 2016 13:27:15 +0000 Subject: [issue26628] Undefined behavior calling C functions with ctypes.Union arguments In-Reply-To: <1458766336.13.0.0388960184699.issue26628@psf.upfronthosting.co.za> Message-ID: <1458826035.51.0.974645660777.issue26628@psf.upfronthosting.co.za> Thomas added the comment: So after some more pondering about the issue I read the documentation again: > Warning ctypes does not support passing unions or structures with bit-fields to functions by value. Previously I always read this as 'does not support passing unions with bit-fields'... I guess it is meant otherwise. IMHO this should be formulated more clearly, like: "does not support passing structures with bit-fields or unions to functions by value.". Also I would strongly argue to generally prohibit this with an exception instead of just trying if libffi maybe handles this on the current architecture. libffi clearly does not support unions. This just introduces subtle bugs. See also: https://github.com/atgreen/libffi/issues/33 ---------- title: Segfault in cffi with ctypes.union argument -> Undefined behavior calling C functions with ctypes.Union arguments _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 10:07:40 2016 From: report at bugs.python.org (Terry J. Reedy) Date: Thu, 24 Mar 2016 14:07:40 +0000 Subject: [issue23551] IDLE to provide menu link to PIP gui. In-Reply-To: <1425155752.55.0.0736033483828.issue23551@psf.upfronthosting.co.za> Message-ID: <1458828460.18.0.0173294333123.issue23551@psf.upfronthosting.co.za> Terry J. Reedy added the comment: After running the code, I want to stick with details in the same window. The tab should be a Frame with a PanedWindow on top with list frame on left and detail frame on right. The buttons would be under the paned window. Run Lib/turtledemo/__main__.py either from IDLE or with 'python -m turtledemo' to see an example. Eric: make sure you read my response to Upendra on core-mentorship list: "Inquiry about the "PIP GUI Project". Raymond and Donald: I am seriously considering mentoring this as a GSOC project next summer. Can I count on at least one of you occasionally reviewing the design and functioning of interim submissions (by running the code and clicking around)? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 10:15:58 2016 From: report at bugs.python.org (STINNER Victor) Date: Thu, 24 Mar 2016 14:15:58 +0000 Subject: [issue19829] _pyio.BufferedReader and _pyio.TextIOWrapper destructor don't emit ResourceWarning if the file is not closed In-Reply-To: <1385721421.95.0.384748799117.issue19829@psf.upfronthosting.co.za> Message-ID: <1458828958.46.0.629459261211.issue19829@psf.upfronthosting.co.za> STINNER Victor added the comment: Attached patch modifies _pyio to mimick better the reference io module: * Add IOBase._finalizing * IOBase.__del__() sets _finalizing to True * Add FileIO._dealloc_warn() * Remove FileIO.__del__() * FileIO.close(), _BufferedIOMixin.close() and TextIOWrapper.close() now calls _dealloc_warn() if _finalizing is true * Override closed() method in FileIO: needed because FileIO.close() now calls super().close() before logging the ResourceWarning, and the file is expected to see open in the warning * FileIO.close() now calls super().close() *before* closing the file descriptor I added hasattr(.., '_dealloc_warn') sanity checks because _dealloc_warn() are added to concrete classes, not to base classes. ---------- Added file: http://bugs.python.org/file42271/pyio_res_warn.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 10:16:42 2016 From: report at bugs.python.org (STINNER Victor) Date: Thu, 24 Mar 2016 14:16:42 +0000 Subject: [issue19829] _pyio.BufferedReader and _pyio.TextIOWrapper destructor don't emit ResourceWarning if the file is not closed In-Reply-To: <1385721421.95.0.384748799117.issue19829@psf.upfronthosting.co.za> Message-ID: <1458829002.96.0.568100498684.issue19829@psf.upfronthosting.co.za> Changes by STINNER Victor : Removed file: http://bugs.python.org/file42271/pyio_res_warn.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 10:17:00 2016 From: report at bugs.python.org (STINNER Victor) Date: Thu, 24 Mar 2016 14:17:00 +0000 Subject: [issue19829] _pyio.BufferedReader and _pyio.TextIOWrapper destructor don't emit ResourceWarning if the file is not closed In-Reply-To: <1385721421.95.0.384748799117.issue19829@psf.upfronthosting.co.za> Message-ID: <1458829020.94.0.298974067626.issue19829@psf.upfronthosting.co.za> STINNER Victor added the comment: (oops, there was a typo in my first patch) ---------- Added file: http://bugs.python.org/file42272/pyio_res_warn-2.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 10:19:49 2016 From: report at bugs.python.org (Barry A. Warsaw) Date: Thu, 24 Mar 2016 14:19:49 +0000 Subject: [issue26632] __all__ decorator In-Reply-To: <1458787688.43.0.0467845359815.issue26632@psf.upfronthosting.co.za> Message-ID: <20160324101945.444d4084@subdivisions.wooz.org> Barry A. Warsaw added the comment: On Mar 24, 2016, at 02:48 AM, Ethan Furman wrote: >On the down side, you know somebody is going to @public a class' method -- >how do we check for that? Do we need to? Consenting adults and __all__. OT1H, you do get an AttributeError if you from-import-* and there are things in __all__ that aren't in the module. OTOH, it's a pretty obvious error. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 10:31:11 2016 From: report at bugs.python.org (STINNER Victor) Date: Thu, 24 Mar 2016 14:31:11 +0000 Subject: [issue19829] _pyio.BufferedReader and _pyio.TextIOWrapper destructor don't emit ResourceWarning if the file is not closed In-Reply-To: <1385721421.95.0.384748799117.issue19829@psf.upfronthosting.co.za> Message-ID: <1458829871.39.0.173590910441.issue19829@psf.upfronthosting.co.za> STINNER Victor added the comment: Oh, the io module is more complex than what I expected :-) test_io fails with pyio_res_warn-2.patch. test_io now pass with pyio_res_warn-3.patch. I fixed FileIO.close() to always call super().close(), and set self._fd to -1 even if logging the ResourceWarning raised an exception. ---------- Added file: http://bugs.python.org/file42273/pyio_res_warn-3.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 10:32:26 2016 From: report at bugs.python.org (STINNER Victor) Date: Thu, 24 Mar 2016 14:32:26 +0000 Subject: [issue19829] _pyio.BufferedReader and _pyio.TextIOWrapper destructor don't emit ResourceWarning if the file is not closed In-Reply-To: <1385721421.95.0.384748799117.issue19829@psf.upfronthosting.co.za> Message-ID: <1458829946.32.0.524886574288.issue19829@psf.upfronthosting.co.za> STINNER Victor added the comment: Try attached res_warn.py script to test manually all ResourceWarning warnings. Ouput of python3.6 -Wd res_warn.py: -------------------------- text <_pyio.TextIOWrapper name='/etc/issue' mode='r' encoding='UTF-8'> res_warn.py:9: ResourceWarning: unclosed file <_pyio.FileIO name='/etc/issue' mode='rb' closefd=True> f = None buffered <_pyio.BufferedReader name='/etc/issue'> res_warn.py:15: ResourceWarning: unclosed file <_pyio.FileIO name='/etc/issue' mode='rb' closefd=True> f=None raw <_pyio.FileIO name='/etc/issue' mode='rb' closefd=True> res_warn.py:21: ResourceWarning: unclosed file <_pyio.FileIO name='/etc/issue' mode='rb' closefd=True> f=None fileio <_pyio.FileIO name='/etc/issue' mode='rb' closefd=True> res_warn.py:27: ResourceWarning: unclosed file <_pyio.FileIO name='/etc/issue' mode='rb' closefd=True> f=None -------------------------- Ouput of python3.6 -X tracemalloc=2 -Wd res_warn.py: -------------------------- text <_pyio.TextIOWrapper name='/etc/issue' mode='r' encoding='UTF-8'> res_warn.py:9: ResourceWarning: unclosed file <_pyio.FileIO name='/etc/issue' mode='rb' closefd=True> f = None Object allocated at (most recent call first): File "/home/haypo/prog/python/default/Lib/_pyio.py", lineno 209 closefd, opener=opener) File "res_warn.py", lineno 7 f = _pyio.open(fn, "r") buffered <_pyio.BufferedReader name='/etc/issue'> res_warn.py:15: ResourceWarning: unclosed file <_pyio.FileIO name='/etc/issue' mode='rb' closefd=True> f=None Object allocated at (most recent call first): File "/home/haypo/prog/python/default/Lib/_pyio.py", lineno 209 closefd, opener=opener) File "res_warn.py", lineno 13 f = _pyio.open(fn, "rb") raw <_pyio.FileIO name='/etc/issue' mode='rb' closefd=True> res_warn.py:21: ResourceWarning: unclosed file <_pyio.FileIO name='/etc/issue' mode='rb' closefd=True> f=None Object allocated at (most recent call first): File "/home/haypo/prog/python/default/Lib/_pyio.py", lineno 209 closefd, opener=opener) File "res_warn.py", lineno 19 f = _pyio.open(fn, "rb", 0) fileio <_pyio.FileIO name='/etc/issue' mode='rb' closefd=True> res_warn.py:27: ResourceWarning: unclosed file <_pyio.FileIO name='/etc/issue' mode='rb' closefd=True> f=None Object allocated at (most recent call first): File "res_warn.py", lineno 25 f = _pyio.FileIO(fn, "rb") -------------------------- ---------- Added file: http://bugs.python.org/file42274/res_warn.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 10:35:24 2016 From: report at bugs.python.org (Denis) Date: Thu, 24 Mar 2016 14:35:24 +0000 Subject: [issue26636] SystemError while running tests: extra exception raised Message-ID: <1458830124.86.0.833063009282.issue26636@psf.upfronthosting.co.za> New submission from Denis: Looks like related to Issue23571 Probably same issue as in Django, but in other Python module. While compiling python-module-crypto: ===================================================================== ERROR: test_getStrongPrime_randfunc_bogus (Crypto.SelfTest.Util.test_number.FastmathTests) Test that when getStrongPrime is called, an exception is raised if randfunc returns something bogus. ---------------------------------------------------------------------- TypeError: randfunc must return a string of random bytes During handling of the above exception, another exception occurred: SystemError: PyEval_EvalFrameEx returned a result with an error set During handling of the above exception, another exception occurred: Traceback (most recent call last): ?File "build/lib.linux-i686-3.5/Crypto/SelfTest/Util/test_number.py", line 322, in test_getStrongPrime_randfunc_bogus ???self.assertRaises(TypeError, number._fastmath.getStrongPrime, 512, randfunc=randfunc) ?File "/usr/lib/python3.5/unittest/case.py", line 765, in assertRaises ???return context.handle('assertRaises', args, kwargs) ?File "/usr/lib/python3.5/unittest/case.py", line 214, in handle ???callable_obj(*args, **kwargs) SystemError: PyEval_EvalFrameEx returned a result with an error set ====================================================================== ERROR: test_getStrongPrime_randfunc_exception (Crypto.SelfTest.Util.test_number.FastmathTests) Test that when getStrongPrime is called, an exception raised in randfunc is propagated. ---------------------------------------------------------------------- Crypto.SelfTest.Util.test_number.MyError During handling of the above exception, another exception occurred: SystemError: returned a result with an error set During handling of the above exception, another exception occurred: Traceback (most recent call last): ?File "build/lib.linux-i686-3.5/Crypto/SelfTest/Util/test_number.py", line 308, in test_getStrongPrime_randfunc_exception ???self.assertRaises(MyError, number._fastmath.getStrongPrime, 512, randfunc=randfunc) ?File "/usr/lib/python3.5/unittest/case.py", line 765, in assertRaises ???return context.handle('assertRaises', args, kwargs) ?File "/usr/lib/python3.5/unittest/case.py", line 214, in handle ???callable_obj(*args, **kwargs) ?File "build/lib.linux-i686-3.5/Crypto/SelfTest/Util/test_number.py", line 307, in randfunc ???raise MyError SystemError: returned a result with an error set The file that cause that exception can be found at http://git.altlinux.org/gears/p/python-module-pycrypto.git?p=python-module-pycrypto.git;a=blob;f=lib/Crypto/SelfTest/Util/test_number.py;h=ac23e917b6e7d982a33fff0a14bec3e769500ba0;hb=86c4aa4683cd89f89c3d01a689efa525f961d340 ---------- components: Interpreter Core messages: 262349 nosy: nbr_alt priority: normal severity: normal status: open title: SystemError while running tests: extra exception raised type: behavior versions: Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 10:38:14 2016 From: report at bugs.python.org (STINNER Victor) Date: Thu, 24 Mar 2016 14:38:14 +0000 Subject: [issue19829] _pyio.BufferedReader and _pyio.TextIOWrapper destructor don't emit ResourceWarning if the file is not closed In-Reply-To: <1385721421.95.0.384748799117.issue19829@psf.upfronthosting.co.za> Message-ID: <1458830294.93.0.306432798425.issue19829@psf.upfronthosting.co.za> STINNER Victor added the comment: del-detach.patch: I don't understand the change in _pyio.py. I think that the change on socket.py is no more need since the change 46329eec5515 (issue #26590). del-flush.patch: * change on IOBase.__del__() change the behaviour compared to the io module, I don't think that it's correct. I may also break backward compatibility :-/ * change on fileio.c implements a finalizer for FileIO: io.IOBase already implements a finalizer which calls close(), I'm not sure that this change is needed? * change on iobase.c removes io.IOBase finalizer. I don't understand this. It breaks ResourceWarning on io.Buffered* and io.TextIOWrapper classes, no? Well, I guess that these two patches were written before Serhiy reimplemented the FileIO in pure Python, and this change outdated your two patches. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 10:45:45 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 24 Mar 2016 14:45:45 +0000 Subject: [issue19829] _pyio.BufferedReader and _pyio.TextIOWrapper destructor don't emit ResourceWarning if the file is not closed In-Reply-To: <1385721421.95.0.384748799117.issue19829@psf.upfronthosting.co.za> Message-ID: <1458830745.68.0.601988740756.issue19829@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: I don't like _dealloc_warn() at all. It looks as a dirty hack and doesn't work with custom file-like objects. I think we should use one of Martin's option. If there are any issues with garbage collecting, we should fix the garbage collector. ---------- versions: +Python 3.5, Python 3.6 -Python 3.3, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 10:47:49 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 24 Mar 2016 14:47:49 +0000 Subject: [issue26636] SystemError while running tests: extra exception raised In-Reply-To: <1458830124.86.0.833063009282.issue26636@psf.upfronthosting.co.za> Message-ID: <1458830869.33.0.299785337374.issue26636@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- nosy: +haypo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 10:56:29 2016 From: report at bugs.python.org (A. Jesse Jiryu Davis) Date: Thu, 24 Mar 2016 14:56:29 +0000 Subject: [issue6721] Locks in the standard library should be sanitized on fork In-Reply-To: <1250550378.97.0.072881968798.issue6721@psf.upfronthosting.co.za> Message-ID: <1458831389.34.0.796467122268.issue6721@psf.upfronthosting.co.za> Changes by A. Jesse Jiryu Davis : ---------- nosy: +emptysquare _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 11:06:33 2016 From: report at bugs.python.org (STINNER Victor) Date: Thu, 24 Mar 2016 15:06:33 +0000 Subject: [issue26637] importlib: better error message when import fail during Python shutdown Message-ID: <1458831993.32.0.609008052486.issue26637@psf.upfronthosting.co.za> New submission from STINNER Victor: Example of script.py: ------------------------- class Bla: def __del__(self): try: import xxxx except Exception as exc: print("import error: [%s] %r" % (type(exc), exc)) bla = Bla() ------------------------- Running this example logs a strange error: ------------------------- $ python3.5 script.py import error: [] TypeError("'NoneType' object is not iterable",) ------------------------- The error comes from importlib._bootstrap._find_spec() which tries to iterator on sys.meta_path, whereas PyImport_Cleanup() was called and this function setted sys.meta_path to None. Attached patch enhances _find_spec() to handle this case to return None. Error with the patch: ------------------------- $ python3.5 script.py import error: [] ImportError('sys.meta_path is None, Python is likely shutting down',) ------------------------- ---------- components: Library (Lib) files: importlib_shutdown.patch keywords: patch messages: 262352 nosy: brett.cannon, eric.snow, haypo priority: normal severity: normal status: open title: importlib: better error message when import fail during Python shutdown versions: Python 2.7, Python 3.5, Python 3.6 Added file: http://bugs.python.org/file42275/importlib_shutdown.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 11:10:48 2016 From: report at bugs.python.org (STINNER Victor) Date: Thu, 24 Mar 2016 15:10:48 +0000 Subject: [issue21925] ResourceWarning sometimes doesn't display In-Reply-To: <1404614973.3.0.388136336832.issue21925@psf.upfronthosting.co.za> Message-ID: <1458832248.19.0.24241631051.issue21925@psf.upfronthosting.co.za> STINNER Victor added the comment: It looks like the warnings is logged when the C implemention is used. When the Python implementation is used, "import linecache" or "linecache.getline()" fail, and so the warnings is skipped. Attached patch makes the Python implementation safer when Python is shutting down. Add "try/except Exception" to ignore exceptions on import, linecache and tracemalloc. ---------- Added file: http://bugs.python.org/file42276/warnings_shutdown.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 11:11:07 2016 From: report at bugs.python.org (STINNER Victor) Date: Thu, 24 Mar 2016 15:11:07 +0000 Subject: [issue21925] ResourceWarning sometimes doesn't display In-Reply-To: <1404614973.3.0.388136336832.issue21925@psf.upfronthosting.co.za> Message-ID: <1458832267.09.0.71010986753.issue21925@psf.upfronthosting.co.za> STINNER Victor added the comment: See also the issue #26637: "importlib: better error message when import fail during Python shutdown". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 11:12:36 2016 From: report at bugs.python.org (STINNER Victor) Date: Thu, 24 Mar 2016 15:12:36 +0000 Subject: [issue10305] Cleanup up ResourceWarnings in multiprocessing In-Reply-To: <1288832616.21.0.291852483251.issue10305@psf.upfronthosting.co.za> Message-ID: <1458832356.35.0.479436493283.issue10305@psf.upfronthosting.co.za> STINNER Victor added the comment: Sorry but without any information about the module or function which emits such ResourceWarning, I prefer to close the issue. Anyway, with Python 3.6, it became trivial to identify the root cause of ResourceWarning warinings: https://docs.python.org/dev/whatsnew/3.6.html#warnings So it should now be much easier to fix them. ---------- nosy: +haypo resolution: -> out of date status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 11:20:41 2016 From: report at bugs.python.org (STINNER Victor) Date: Thu, 24 Mar 2016 15:20:41 +0000 Subject: [issue22898] segfault during shutdown attempting to log ResourceWarning In-Reply-To: <1416345976.57.0.643107529371.issue22898@psf.upfronthosting.co.za> Message-ID: <1458832841.47.0.0123093646745.issue22898@psf.upfronthosting.co.za> STINNER Victor added the comment: I tried the following script on Python 3.5 and Python 3.6 and I failed to reproduce the bug: --- import sys, traceback class MyException(Exception): def __init__(self, *args): 1/0 def gen(): f = open(__file__, mode='rb', buffering=0) yield g = gen() next(g) recursionlimit = sys.getrecursionlimit() sys.setrecursionlimit(len(traceback.extract_stack())+3) try: g.throw(MyException) finally: sys.setrecursionlimit(recursionlimit) print('Done.') --- Note: I had to add "+3" to the sys.setrecursionlimit() call, otherwise the limit is too low and you get a RecursionError (it's a recent bugfix, issue #25274). Can somone else please confirm that the bug is fixed? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 11:21:25 2016 From: report at bugs.python.org (STINNER Victor) Date: Thu, 24 Mar 2016 15:21:25 +0000 Subject: [issue25654] test_multiprocessing_spawn ResourceWarning with -Werror In-Reply-To: <1447830828.22.0.981390741581.issue25654@psf.upfronthosting.co.za> Message-ID: <1458832885.66.0.76790793642.issue25654@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- nosy: +haypo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 11:23:35 2016 From: report at bugs.python.org (STINNER Victor) Date: Thu, 24 Mar 2016 15:23:35 +0000 Subject: [issue10305] Cleanup up ResourceWarnings in multiprocessing In-Reply-To: <1288832616.21.0.291852483251.issue10305@psf.upfronthosting.co.za> Message-ID: <1458833015.03.0.010902525216.issue10305@psf.upfronthosting.co.za> STINNER Victor added the comment: Oh, I found the issue #25654 which contains more information and even patches. ---------- superseder: -> test_multiprocessing_spawn ResourceWarning with -Werror _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 11:23:47 2016 From: report at bugs.python.org (STINNER Victor) Date: Thu, 24 Mar 2016 15:23:47 +0000 Subject: [issue25654] test_multiprocessing_spawn ResourceWarning with -Werror In-Reply-To: <1447830828.22.0.981390741581.issue25654@psf.upfronthosting.co.za> Message-ID: <1458833027.36.0.312379782172.issue25654@psf.upfronthosting.co.za> STINNER Victor added the comment: I marked the issue #10305 as a duplicate of this issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 11:27:21 2016 From: report at bugs.python.org (STINNER Victor) Date: Thu, 24 Mar 2016 15:27:21 +0000 Subject: [issue26636] SystemError while running tests: extra exception raised In-Reply-To: <1458830124.86.0.833063009282.issue26636@psf.upfronthosting.co.za> Message-ID: <1458833241.93.0.0456637246565.issue26636@psf.upfronthosting.co.za> STINNER Victor added the comment: > Probably same issue as in Django, but in other Python module. Do you understand that bug very likely comes from your code? Please review the code of the Crypto module (especially number._fastmath.getStrongPrime) to ensure that it doesn't return a result with an exception set. If a function raises an exception, it must returns NULL. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 11:33:19 2016 From: report at bugs.python.org (Steve Dower) Date: Thu, 24 Mar 2016 15:33:19 +0000 Subject: [issue26624] Windows hangs in call to CRT setlocale() In-Reply-To: <1458747871.12.0.710719467032.issue26624@psf.upfronthosting.co.za> Message-ID: <1458833599.45.0.578777854606.issue26624@psf.upfronthosting.co.za> Steve Dower added the comment: If the comment is in the sources, presumably it's also handled correctly. But it does seem like there's potential here for simultaneous thread creation and first-time calls into OS locale functions to cause a deadlock. I'll email the CRT team and see what they know about this. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 11:34:35 2016 From: report at bugs.python.org (STINNER Victor) Date: Thu, 24 Mar 2016 15:34:35 +0000 Subject: [issue26624] Windows hangs in call to CRT setlocale() In-Reply-To: <1458747871.12.0.710719467032.issue26624@psf.upfronthosting.co.za> Message-ID: <1458833675.11.0.862110198867.issue26624@psf.upfronthosting.co.za> STINNER Victor added the comment: > I'll email the CRT team and see what they know about this. Thanks. It helps to have a Microsoft employee working on CPython :-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 11:36:40 2016 From: report at bugs.python.org (STINNER Victor) Date: Thu, 24 Mar 2016 15:36:40 +0000 Subject: [issue19829] _pyio.BufferedReader and _pyio.TextIOWrapper destructor don't emit ResourceWarning if the file is not closed In-Reply-To: <1385721421.95.0.384748799117.issue19829@psf.upfronthosting.co.za> Message-ID: <1458833800.28.0.0761624538707.issue19829@psf.upfronthosting.co.za> STINNER Victor added the comment: > I don't like _dealloc_warn() at all. It looks as a dirty hack and doesn't work with custom file-like objects. I tried to support emitting a ResourceWarning when the close() method is overriden in a subclass, but then I saw that io doesn't support this use case neither: --- import io import os class MyFile(io.FileIO): def close(self): os.close(self.fileno()) f = MyFile('/etc/issue') f = None --- => no warning Ok, now I have to read again Martin's patches since I didn't understand them at the first read :-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 11:58:46 2016 From: report at bugs.python.org (Eric Khoo Jiun Hooi) Date: Thu, 24 Mar 2016 15:58:46 +0000 Subject: [issue23551] IDLE to provide menu link to PIP gui. In-Reply-To: <1425155752.55.0.0736033483828.issue23551@psf.upfronthosting.co.za> Message-ID: <1458835126.83.0.57644922133.issue23551@psf.upfronthosting.co.za> Eric Khoo Jiun Hooi added the comment: The implementation of features that already provided by command line interface should not be a problem. However, I do not understand how the search for package and change default repository function. Is it going to search the package from other website? Terry, is the pip_test.py need urgently? Because I am not familiar with the unittest library and it required me a few days to read its documentation. Maybe I can write one after the submission of proposal. But my first priority now is to change the design of the pip_gui.py file. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 12:29:05 2016 From: report at bugs.python.org (Steve Dower) Date: Thu, 24 Mar 2016 16:29:05 +0000 Subject: [issue26624] Windows hangs in call to CRT setlocale() In-Reply-To: <1458747871.12.0.710719467032.issue26624@psf.upfronthosting.co.za> Message-ID: <1458836945.74.0.133038266294.issue26624@psf.upfronthosting.co.za> Steve Dower added the comment: It's been fixed, just figuring out when the update will be available, or how to get it if it already is. Jeremy - how up to date is your build machine? It's likely this fix will come through Windows Update for most users, but since you're running debug builds I think you'll need the latest Visual Studio updates to get it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 12:46:19 2016 From: report at bugs.python.org (Jared Deckard) Date: Thu, 24 Mar 2016 16:46:19 +0000 Subject: [issue22401] argparse: 'resolve' conflict handler damages the actions of the parent parser In-Reply-To: <1410673598.78.0.274465754789.issue22401@psf.upfronthosting.co.za> Message-ID: <1458837979.58.0.21880884415.issue22401@psf.upfronthosting.co.za> Jared Deckard added the comment: That is correct. (Thank you for whipping up a repro script from my description). I appreciate the work around, but it is nearly as verbose as manually duplicating the parameters on the child and I would have to type up a large comment block to educate future developers on the hack. Is there some documentation I am missing or is the "resolve" conflict handler broken? > The parents= argument takes a list of ArgumentParser objects, collects all the positional and optional actions from them, and adds these actions to the ArgumentParser object being constructed. https://docs.python.org/3.6/library/argparse.html#parents It would be nice if the "error" conflict handler ignored conflicts when the actions are identical. It should be expected that the "resolve" conflict handler would not modify the parents. It is exhibiting undocumented and undesirable side effect, which indicates to me that it is a bug not a missing feature. As for the patch, I'm not sure why you would ever want "action_copy" to be False. It seems like creating copies to insulate the originals ignores the underlying issue that these parents are being mutated when the operation implies a union of properties with no side effects. I don't think the fix for this should be behind an optional flag, I think the fix is to update "resolve" to take into consideration multiple parents like the custom conflict handler in your sample. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 12:48:34 2016 From: report at bugs.python.org (Jared Deckard) Date: Thu, 24 Mar 2016 16:48:34 +0000 Subject: [issue22401] argparse: 'resolve' conflict handler damages the actions of the parent parser In-Reply-To: <1410673598.78.0.274465754789.issue22401@psf.upfronthosting.co.za> Message-ID: <1458838114.2.0.698891438867.issue22401@psf.upfronthosting.co.za> Jared Deckard added the comment: Adding back components and version data I unintentionally removed in http://bugs.python.org/msg262314 ---------- components: +Documentation, Tests versions: +Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 12:57:45 2016 From: report at bugs.python.org (STINNER Victor) Date: Thu, 24 Mar 2016 16:57:45 +0000 Subject: [issue26637] importlib: better error message when import fail during Python shutdown In-Reply-To: <1458831993.32.0.609008052486.issue26637@psf.upfronthosting.co.za> Message-ID: <1458838665.14.0.368684145112.issue26637@psf.upfronthosting.co.za> STINNER Victor added the comment: Updated patch with a dot in the comment :-) Is ImportError the best exception in this case? ---------- Added file: http://bugs.python.org/file42277/importlib_shutdown-2.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 13:00:11 2016 From: report at bugs.python.org (Brett Cannon) Date: Thu, 24 Mar 2016 17:00:11 +0000 Subject: [issue26637] importlib: better error message when import fail during Python shutdown In-Reply-To: <1458831993.32.0.609008052486.issue26637@psf.upfronthosting.co.za> Message-ID: <1458838811.35.0.53840805922.issue26637@psf.upfronthosting.co.za> Brett Cannon added the comment: Either ImportError or TypeError. ImportError makes sense since this is directly related to import semantics while TypeError makes sense as we are saying None specifically is not allowed. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 13:22:20 2016 From: report at bugs.python.org (Upendra Kumar) Date: Thu, 24 Mar 2016 17:22:20 +0000 Subject: [issue23551] IDLE to provide menu link to PIP gui. In-Reply-To: <1425155752.55.0.0736033483828.issue23551@psf.upfronthosting.co.za> Message-ID: <1458840140.33.0.561763648086.issue23551@psf.upfronthosting.co.za> Upendra Kumar added the comment: Here, I have one doubt regarding the get_data function that should the get_data function be a common function for different features for example : def _get_data(self, func_option): """ A separate function for extracting data from the runpip() function. It is done in order to get this function tested using unittest module According to func_option, it returns the data extracted : Options: ------- 1. list : for listing all currently installed packages 2. show : show details of installed packages 3. search : show formated search results 4. install : get results while installing packages """ splitted_options = func_option.split() if splitted_options[0] == 'list': return runpip(func_option) elif splitted_options[0] == 'show': return runpip(func_option) elif splitted_options[0] == 'search': return runpip(func_option) elif splitted_options[0] == 'install': return runpip(func_option) I am not clear would this single function for retrieving data would be good for uniitest or different functions would be good for retrieving data. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 14:01:31 2016 From: report at bugs.python.org (Aviv Palivoda) Date: Thu, 24 Mar 2016 18:01:31 +0000 Subject: [issue25951] SSLSocket.sendall() does not return None on success like socket.sendall() In-Reply-To: <1451054715.95.0.578529633079.issue25951@psf.upfronthosting.co.za> Message-ID: <1458842491.25.0.0332850571878.issue25951@psf.upfronthosting.co.za> Aviv Palivoda added the comment: Changed SSLSocket.sendall() to return None. Also added a check of the return value of the SSLSocket.send(), SSLSocket.sendall() in the tests. ---------- keywords: +patch nosy: +palaviv Added file: http://bugs.python.org/file42278/25951.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 15:05:42 2016 From: report at bugs.python.org (Brett Cannon) Date: Thu, 24 Mar 2016 19:05:42 +0000 Subject: [issue25609] Add a ContextManager ABC and type In-Reply-To: <1447355679.68.0.225089426373.issue25609@psf.upfronthosting.co.za> Message-ID: <1458846342.51.0.409609245791.issue25609@psf.upfronthosting.co.za> Brett Cannon added the comment: Here is an updated patch implementing Nick's suggestions and is ready for 3.6 sans a What's New entry. As for Python 3.5, I think I will copy __subclasshook__() from contextlib.AbstractContextManager and put it in typing.ContextManager so the isinstance() checks will work with the type structurally. LMK if this all sounds/looks reasonable. ---------- Added file: http://bugs.python.org/file42279/contextmanagertype.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 15:33:08 2016 From: report at bugs.python.org (Xavier de Gaye) Date: Thu, 24 Mar 2016 19:33:08 +0000 Subject: [issue22898] segfault during shutdown attempting to log ResourceWarning In-Reply-To: <1416345976.57.0.643107529371.issue22898@psf.upfronthosting.co.za> Message-ID: <1458847988.27.0.393412613833.issue22898@psf.upfronthosting.co.za> Xavier de Gaye added the comment: When tested with runtimerror_singleton_3.py (see msg 231933 above), the latest Python 3.6.0a0 (default:3eec7bcc14a4, Mar 24 2016, 20:16:19) still crashes: $ python runtimerror_singleton_3.py Importing mymodule. Traceback (most recent call last): File "runtimerror_singleton_3.py", line 26, in foo() File "runtimerror_singleton_3.py", line 23, in foo g.throw(MyException) # Entering PyErr_NormalizeException() File "runtimerror_singleton_3.py", line 14, in gen yield RecursionError: maximum recursion depth exceeded Segmentation fault (core dumped) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 16:16:19 2016 From: report at bugs.python.org (paul j3) Date: Thu, 24 Mar 2016 20:16:19 +0000 Subject: [issue22401] argparse: 'resolve' conflict handler damages the actions of the parent parser In-Reply-To: <1410673598.78.0.274465754789.issue22401@psf.upfronthosting.co.za> Message-ID: <1458850579.12.0.667719402728.issue22401@psf.upfronthosting.co.za> paul j3 added the comment: Neither 'parents' or 'resolve' are documented in any detail. Most of what I know comes from reading the code. 'parents' are, I think, most useful when importing a parser from some other module. It lets you add arguments to your own parser without digging into the other module's code. And 'resolve' lets you overwrite arguments. Copying arguments by reference is the easiest thing to do in Python, and apparently no one asked, 'what if the user wants to use the parent independently?' Note I had to add a 'copy' method, because nothing else in 'argparse' needs it. And no one has written code to check whether two Actions are the same (other than the obvious one of checking object ids). Again, no need. Copy and paste and utility functions are great ways of defining multiple arguments when mechanisms like 'parents' prove to be too clumsy. Look at `test_argparse.py` for examples of utility code that streamlines parser definition. Each test case requires a new parser (or more). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 16:16:33 2016 From: report at bugs.python.org (Terry J. Reedy) Date: Thu, 24 Mar 2016 20:16:33 +0000 Subject: [issue23551] IDLE to provide menu link to PIP gui. In-Reply-To: <1425155752.55.0.0736033483828.issue23551@psf.upfronthosting.co.za> Message-ID: <1458850593.36.0.14864905156.issue23551@psf.upfronthosting.co.za> Terry J. Reedy added the comment: Answering Eric: 'change default repository' would set a value that pip_gui would pass to subsequent install requests with the --index-url option. On Windows, http://www.lfd.uci.edu/~gohlke/pythonlibs/ is essential and should be pre-listed as an option to select. 'search' (for package on pypi) is a pip command. Try "pip search xyz". On Windows, I would also want to be able to search the url above. In the email, I said pip-test.py 'after applications'. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 16:49:08 2016 From: report at bugs.python.org (STINNER Victor) Date: Thu, 24 Mar 2016 20:49:08 +0000 Subject: [issue26637] importlib: better error message when import fail during Python shutdown In-Reply-To: <1458831993.32.0.609008052486.issue26637@psf.upfronthosting.co.za> Message-ID: <1458852548.65.0.231303030909.issue26637@psf.upfronthosting.co.za> STINNER Victor added the comment: I will reply to my own question: in fact, ImportError is more convenient. The "try/except ImportError" pattern is common, in some cases, it's acceptable to skip a whole module. For a direct example on import during Python shutdown, see the issue #21925: "ResourceWarning sometimes doesn't display" which adds "try/except ImportError" to be able to log warnings. @Brett, Eric: So, do you like importlib_shutdown-2.patch? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 16:49:29 2016 From: report at bugs.python.org (STINNER Victor) Date: Thu, 24 Mar 2016 20:49:29 +0000 Subject: [issue26637] importlib: better error message when import fail during Python shutdown In-Reply-To: <1458831993.32.0.609008052486.issue26637@psf.upfronthosting.co.za> Message-ID: <1458852569.89.0.45094867332.issue26637@psf.upfronthosting.co.za> STINNER Victor added the comment: Oh. And is it ok to apply this change to Python 2.7 and 3.5? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 17:09:53 2016 From: report at bugs.python.org (Alexander Belopolsky) Date: Thu, 24 Mar 2016 21:09:53 +0000 Subject: [issue23551] IDLE to provide menu link to PIP gui. In-Reply-To: <1425155752.55.0.0736033483828.issue23551@psf.upfronthosting.co.za> Message-ID: <1458853793.37.0.769718915015.issue23551@psf.upfronthosting.co.za> Alexander Belopolsky added the comment: You may want to take a look a PyCharm's preferences dialog for inspiration. I am attaching a screenshot. I like the way they show installed and the latest available versions. ---------- nosy: +belopolsky Added file: http://bugs.python.org/file42280/PyCharm packages preferences.png _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 17:56:42 2016 From: report at bugs.python.org (Brett Cannon) Date: Thu, 24 Mar 2016 21:56:42 +0000 Subject: [issue26637] importlib: better error message when import fail during Python shutdown In-Reply-To: <1458831993.32.0.609008052486.issue26637@psf.upfronthosting.co.za> Message-ID: <1458856602.61.0.538556973151.issue26637@psf.upfronthosting.co.za> Brett Cannon added the comment: It's technically a change in semantics as it shifts what exception is raised, so I wouldn't backport it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 17:59:26 2016 From: report at bugs.python.org (STINNER Victor) Date: Thu, 24 Mar 2016 21:59:26 +0000 Subject: [issue26637] importlib: better error message when import fail during Python shutdown In-Reply-To: <1458831993.32.0.609008052486.issue26637@psf.upfronthosting.co.za> Message-ID: <1458856766.4.0.625213545942.issue26637@psf.upfronthosting.co.za> STINNER Victor added the comment: > It's technically a change in semantics as it shifts what exception is raised, so I wouldn't backport it. Ok, I'm fine with only changing Python 3.6. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 18:31:02 2016 From: report at bugs.python.org (Martin Panter) Date: Thu, 24 Mar 2016 22:31:02 +0000 Subject: [issue26632] __all__ decorator In-Reply-To: <1458786797.31.0.0749407715279.issue26632@psf.upfronthosting.co.za> Message-ID: <1458858662.74.0.965745902297.issue26632@psf.upfronthosting.co.za> Martin Panter added the comment: FWIW I already invented this :) as written in Issue 22247. Although I think I only used it once or twice in my own personal librarie(s). So it?s a nice sign that we came up with the same @public name and usage. I?m not a fan of hacks depending on the calling frame, and I prefer APIs that ?only do one thing?. So I am okay with accepting an object and work off its __name__ and __module__, but not okay with also accepting a string and guessing what module it was defined in. ---------- nosy: +martin.panter _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 18:32:05 2016 From: report at bugs.python.org (Jeremy Kloth) Date: Thu, 24 Mar 2016 22:32:05 +0000 Subject: [issue26624] Windows hangs in call to CRT setlocale() In-Reply-To: <1458747871.12.0.710719467032.issue26624@psf.upfronthosting.co.za> Message-ID: <1458858725.73.0.975852270116.issue26624@psf.upfronthosting.co.za> Jeremy Kloth added the comment: The lastest set of updates were installed on 1/28. Visual Studio does have Update 1. I'm doing another round of updates now, although nothing related to VC 2015 or Visual Studio, however. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 18:39:05 2016 From: report at bugs.python.org (Anthony Sottile) Date: Thu, 24 Mar 2016 22:39:05 +0000 Subject: [issue8557] subprocess PATH semantics and portability In-Reply-To: <1272451494.53.0.273790888777.issue8557@psf.upfronthosting.co.za> Message-ID: <1458859145.77.0.309110828854.issue8557@psf.upfronthosting.co.za> Anthony Sottile added the comment: Here's the workaround I'm opting for: if sys.platform =='win32': distutils.spawn.find_executable(cmd[0]) + cmd[1:] ---------- nosy: +Anthony Sottile _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 18:52:32 2016 From: report at bugs.python.org (Barry A. Warsaw) Date: Thu, 24 Mar 2016 22:52:32 +0000 Subject: [issue26632] __all__ decorator In-Reply-To: <1458858662.74.0.965745902297.issue26632@psf.upfronthosting.co.za> Message-ID: <20160324185228.1e949c63@subdivisions.wooz.org> Barry A. Warsaw added the comment: On Mar 24, 2016, at 10:31 PM, Martin Panter wrote: >FWIW I already invented this :) as written in Issue 22247. Although I think I >only used it once or twice in my own personal librarie(s). So it?s a nice >sign that we came up with the same @public name and usage. Cool! Consider that bikeshed painted then. :) >I?m not a fan of hacks depending on the calling frame, and I prefer APIs that >?only do one thing?. So I am okay with accepting an object and work off its >__name__ and __module__, but not okay with also accepting a string and >guessing what module it was defined in. Yes, but it makes it less convenient to add non-"APIs" to __all__, although I guess you can just append it at the point of use: __all__.append('CONST1') CONST1 = 3 Not as pretty, and now you have two ways of doing it. Here's another thought: What if we gave all modules an __all__ automatically, and that was an object that acted like a list but also had an @public decorator. import sys class All(list): def public(self, api): sys.modules[api.__module__].__all__.append(api.__name__) __all__ = All() @__all__.public def foo(): pass @__all__.public class Bar: pass __all__.append('CONST') CONST = 1 print(__all__) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 19:15:09 2016 From: report at bugs.python.org (STINNER Victor) Date: Thu, 24 Mar 2016 23:15:09 +0000 Subject: [issue21925] ResourceWarning sometimes doesn't display In-Reply-To: <1404614973.3.0.388136336832.issue21925@psf.upfronthosting.co.za> Message-ID: <1458861309.87.0.922704195885.issue21925@psf.upfronthosting.co.za> STINNER Victor added the comment: It looks like logging a warning at Python exit always works on Python 2.7: --- import _warnings class Bla: def __del__(self, w=_warnings): w.warn_explicit('message', DeprecationWarning, 'x.py', 5) bla = Bla() --- It looks like it uses the Python implementation and linecache.getline() always works. Maybe the warning is emitted earlier that the Python 3 code emitting ResourceWarning. I see that warnings.py of Python 2 imports linecache at top level, whereas the Python 3 code imports the module at the first use in showwarning(). I recall that imports at top level are avoided to get faster startup time. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 19:34:14 2016 From: report at bugs.python.org (Roundup Robot) Date: Thu, 24 Mar 2016 23:34:14 +0000 Subject: [issue21925] ResourceWarning sometimes doesn't display In-Reply-To: <1404614973.3.0.388136336832.issue21925@psf.upfronthosting.co.za> Message-ID: <20160324233407.75978.83236.5C40F400@psf.io> Roundup Robot added the comment: New changeset 1de90a7065ba by Victor Stinner in branch '3.5': warnings.formatwarning(): catch exceptions https://hg.python.org/cpython/rev/1de90a7065ba New changeset 36be356f6253 by Victor Stinner in branch 'default': Merge 3.5 https://hg.python.org/cpython/rev/36be356f6253 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 19:37:36 2016 From: report at bugs.python.org (STINNER Victor) Date: Thu, 24 Mar 2016 23:37:36 +0000 Subject: [issue21925] ResourceWarning sometimes doesn't display In-Reply-To: <1404614973.3.0.388136336832.issue21925@psf.upfronthosting.co.za> Message-ID: <1458862656.61.0.263711871648.issue21925@psf.upfronthosting.co.za> STINNER Victor added the comment: I fixed warnings.formatwarning(). I don't expect the code to be perfect (Python shutdown process is complex and fragile), but the fix is quite simple and it's enough to fix the bug described in the initial message. I even added an unit test for it. I didn't try to force when the __main__ module is unloaded, I didn't see any consensus around that. Thanks for the bug report, it's now fixed ;-) Sorry for the delay. We had to fix a million of other subtle issues to make the Python shutdown process and the stdlib stronger. ---------- resolution: -> fixed status: open -> closed versions: +Python 3.6 -Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 19:41:57 2016 From: report at bugs.python.org (Roundup Robot) Date: Thu, 24 Mar 2016 23:41:57 +0000 Subject: [issue26637] importlib: better error message when import fail during Python shutdown In-Reply-To: <1458831993.32.0.609008052486.issue26637@psf.upfronthosting.co.za> Message-ID: <20160324234154.21086.4972.F18BB4C7@psf.io> Roundup Robot added the comment: New changeset 14c56f697a85 by Victor Stinner in branch 'default': Fix bug in __import__ during Python shutdown https://hg.python.org/cpython/rev/14c56f697a85 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 19:42:05 2016 From: report at bugs.python.org (STINNER Victor) Date: Thu, 24 Mar 2016 23:42:05 +0000 Subject: [issue26637] importlib: better error message when import fail during Python shutdown In-Reply-To: <1458831993.32.0.609008052486.issue26637@psf.upfronthosting.co.za> Message-ID: <1458862925.59.0.927219784466.issue26637@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- resolution: -> fixed status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 20:04:13 2016 From: report at bugs.python.org (Martin Panter) Date: Fri, 25 Mar 2016 00:04:13 +0000 Subject: [issue25951] SSLSocket.sendall() does not return None on success like socket.sendall() In-Reply-To: <1451054715.95.0.578529633079.issue25951@psf.upfronthosting.co.za> Message-ID: <1458864253.61.0.238957542318.issue25951@psf.upfronthosting.co.za> Martin Panter added the comment: Agreed that the documentation and implementation should match. But this seems like a rather low-priority bug. What use case relies on the return value being None? If there is no immediate need for this change, it might be safer to just make it in 3.6, to minimize compatibility problems. But if it is fixed in 3.5 it should also be fixed in 2.7. I left some suggestions to simplify the code. ---------- nosy: +martin.panter stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 20:14:52 2016 From: report at bugs.python.org (Ethan Furman) Date: Fri, 25 Mar 2016 00:14:52 +0000 Subject: [issue26632] __all__ decorator In-Reply-To: <1458786797.31.0.0749407715279.issue26632@psf.upfronthosting.co.za> Message-ID: <1458864892.35.0.182710055779.issue26632@psf.upfronthosting.co.za> Ethan Furman added the comment: Not a fan. :/ How about getting your own copy of the public decorator initialized with the globals you pass in? class Public: def __init__(self, module): """ module should be the globals() dict from the calling module """ self.module = module self.module.setdefault('__all__', []) def __call__(self, thing, value=None): if isinstance(thing, str): self.module[thing] = value else: self.module[thing.__name__] = thing and in use: public = Public(globals()) @public def baz(a, b): #blah blah public('CONST1', 2) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 20:24:34 2016 From: report at bugs.python.org (Barry A. Warsaw) Date: Fri, 25 Mar 2016 00:24:34 +0000 Subject: [issue26632] __all__ decorator In-Reply-To: <1458864892.35.0.182710055779.issue26632@psf.upfronthosting.co.za> Message-ID: <20160324202430.750471d4@subdivisions.wooz.org> Barry A. Warsaw added the comment: On Mar 25, 2016, at 12:14 AM, Ethan Furman wrote: >public = Public(globals()) > >@public >def baz(a, b): > #blah blah > >public('CONST1', 2) I'm not crazy about that, plus I rather don't like the implicit binding of the name. I suppose we should just drop the idea of convenience for non-"API". Just use the defined @public for classes and functions, and an explicit __all__.append('CONST') for other names. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 20:27:48 2016 From: report at bugs.python.org (STINNER Victor) Date: Fri, 25 Mar 2016 00:27:48 +0000 Subject: [issue25654] test_multiprocessing_spawn ResourceWarning with -Werror In-Reply-To: <1447830828.22.0.981390741581.issue25654@psf.upfronthosting.co.za> Message-ID: <1458865668.81.0.976865593521.issue25654@psf.upfronthosting.co.za> STINNER Victor added the comment: Oh, with fixes for issues #21925 and #26637, test_multiprocessing_spawn started to fail: http://buildbot.python.org/all/builders/AMD64%20Debian%20root%203.5/builds/727/steps/test/logs/stdio ====================================================================== FAIL: test_sys_exit (test.test_multiprocessing_spawn.WithProcessesTestSubclassingProcess) ---------------------------------------------------------------------- Traceback (most recent call last): File "/root/buildarea/3.5.angelico-debian-amd64/build/Lib/test/_test_multiprocessing.py", line 483, in test_sys_exit self.assertEqual(f.read().rstrip(), str(reason)) AssertionError: "[1, 2, 3]\nsys:1: ResourceWarning: unclo[67 chars]-8'>" != '[1, 2, 3]' - [1, 2, 3] ? - + [1, 2, 3]- sys:1: ResourceWarning: unclosed file <_io.TextIOWrapper name='/dev/null' mode='r' encoding='UTF-8'> ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 20:37:12 2016 From: report at bugs.python.org (Martin Panter) Date: Fri, 25 Mar 2016 00:37:12 +0000 Subject: [issue26076] redundant checks in tok_get in Parser\tokenizer.c In-Reply-To: <1452452400.02.0.853203557937.issue26076@psf.upfronthosting.co.za> Message-ID: <1458866232.49.0.333239185957.issue26076@psf.upfronthosting.co.za> Martin Panter added the comment: The change looks pretty good to me. I guess some test cases could be added to Lib/test/test_grammar.py, unless there is somewhere else that already tests this sort of stuff. ---------- nosy: +martin.panter _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 20:42:08 2016 From: report at bugs.python.org (Martin Panter) Date: Fri, 25 Mar 2016 00:42:08 +0000 Subject: [issue26620] Fix ResourceWarning warnings in test_urllib2_localnet In-Reply-To: <1458730745.01.0.796601838932.issue26620@psf.upfronthosting.co.za> Message-ID: <1458866528.07.0.509854422086.issue26620@psf.upfronthosting.co.za> Martin Panter added the comment: This handling of KeyboardInterrupt seems like a bug with unittest IMO. But personally I don?t spend too much thought or code handling KeyboardInterrupt in tests, for similar reasons to not doing special handling of test failures in Issue 26612. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 20:52:34 2016 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 25 Mar 2016 00:52:34 +0000 Subject: [issue23551] IDLE to provide menu link to PIP gui. In-Reply-To: <1425155752.55.0.0736033483828.issue23551@psf.upfronthosting.co.za> Message-ID: <1458867154.61.0.357809509916.issue23551@psf.upfronthosting.co.za> Terry J. Reedy added the comment: Upendra and Eric: get_list_data() should first parse the string into a list of lines with .splitlines. At some point, I think the scrolled list should become a scrolled ttk.Treeview, which can have multiple columns. Then get_line_data should parse each line into name and version. Then a third column can be added to indicate that a newer version is available. I wish I had that right now. I have forgotten how to get the update-available info. Alexander, the screenshot could not be more timely. I was thinking of only putting something in the third column when an update is available, but that is a minor detail. In any case, the point is that the get_list_data should eventually prepare a package-list-specific list of triples that gets fed to show_list_data. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 21:13:24 2016 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 25 Mar 2016 01:13:24 +0000 Subject: [issue23551] IDLE to provide menu link to PIP gui. In-Reply-To: <1425155752.55.0.0736033483828.issue23551@psf.upfronthosting.co.za> Message-ID: <1458868404.17.0.259765595846.issue23551@psf.upfronthosting.co.za> Terry J. Reedy added the comment: As I said on core-mentorship list, I decided that we should use Raymond's initial list for the feature list. If anyone has any elaborations or additions, now is the time to post them. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 22:12:46 2016 From: report at bugs.python.org (Eryk Sun) Date: Fri, 25 Mar 2016 02:12:46 +0000 Subject: [issue26632] __all__ decorator In-Reply-To: <1458786797.31.0.0749407715279.issue26632@psf.upfronthosting.co.za> Message-ID: <1458871966.39.0.0608393740585.issue26632@psf.upfronthosting.co.za> Eryk Sun added the comment: > work off its __name__ and __module__ Why is __module__ required? It seems to me this should only operate on the current module. I added a prototype to Python/bltinmodule.c that gets or creates the __all__ list from the current globals (i.e. PyEval_GetGlobals). It accepts at most one positional argument and any number of keyword arguments. It adds the positional argument's __name__ to __all__, sets it in globals, and returns a reference for use as a decorator. The keyword argument dict is used to update globals and extend __all__. Python 3.6.0a0 (default:3eec7bcc14a4+, Mar 24 2016, 20:40:52) [GCC 4.8.4] on linux Type "help", "copyright", "credits" or "license" for more information. >>> @public ... def foo(): ... pass ... >>> def bar(): pass ... >>> public(bar, spam=1, eggs=2) >>> __all__ ['foo', 'spam', 'eggs', 'bar'] >>> foo, bar (, ) >>> spam, eggs (1, 2) Maybe it should be generalized to handle multiple positional arguments. Currently it's an error: >>> public(foo, bar) Traceback (most recent call last): File "", line 1, in TypeError: public expected at most 1 arguments, got 2 The positional argument must have a __name__ that's a string: >>> public('CONST') Traceback (most recent call last): File "", line 1, in AttributeError: 'str' object has no attribute '__name__' >>> class C: ... __name__ = 1 ... >>> public(C()) Traceback (most recent call last): File "", line 1, in TypeError: __name__ must be a string If it's used to decorate a method definition, it stores a reference to the function in the module's globals. That's not very useful, but at least it won't lead to an error with a star import. ---------- nosy: +eryksun _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 23:04:40 2016 From: report at bugs.python.org (Eryk Sun) Date: Fri, 25 Mar 2016 03:04:40 +0000 Subject: [issue26628] Undefined behavior calling C functions with ctypes.Union arguments In-Reply-To: <1458766336.13.0.0388960184699.issue26628@psf.upfronthosting.co.za> Message-ID: <1458875080.64.0.29309877588.issue26628@psf.upfronthosting.co.za> Eryk Sun added the comment: > I would strongly argue to generally prohibit this > with an exception I agree. A warning in the tutorial isn't sufficient. ctypes should raise an error when setting a union or bitfield struct type in argtypes or when passing one by value. Here's some background to flesh out this issue. Both struct and union types are defined as the libffi type FFI_TYPE_STRUCT (13), since FFI_TYPE_UNION doesn't exist. class MyUnion(ctypes.Union): _fields_ = [("x%s" % i, ctypes.c_double) for i in range(11)] >>> stgdict(MyUnion).length 11 >>> stgdict(MyUnion).ffi_type_pointer size: 8 alignment: 8 type: 13 elements: 17918992 >>> (ctypes.c_void_p * 12).from_address(17918992)[:] [140354450953784, 140354450953784, 140354450953784, 140354450953784, 140354450953784, 140354450953784, 140354450953784, 140354450953784, 140354450953784, 140354450953784, 140354450953784, None] >>> ffi_type.from_address(140354450953784) size: 8 alignment: 8 type: 3 elements: LP_LP_ffi_type() Type 3 is FFI_TYPE_DOUBLE. class MyStruct(ctypes.Structure): _fields_ = [("x%s" % i, ctypes.c_double) for i in range(11)] >>> stgdict(MyStruct).length 11 >>> stgdict(MyStruct).ffi_type_pointer size: 88 alignment: 8 type: 13 elements: 17868096 >>> (ctypes.c_void_p * 12).from_address(17868096)[:] [140354450953784, 140354450953784, 140354450953784, 140354450953784, 140354450953784, 140354450953784, 140354450953784, 140354450953784, 140354450953784, 140354450953784, 140354450953784, None] As shown above, FFI_TYPE_STRUCT uses the `elements` array in its ffi_type. Each element is a pointer to an ffi_type for the corresponding field in the struct or union. This array is terminated by a NULL pointer. The C data size of a MyUnion instance is 8 bytes. This is less than 32 bytes (i.e. four 8-byte words), so the code in classify_argument rightfully assumes the argument won't be passed on the stack. Thus it classifies the register type(s) to use, presuming it's dealing with a struct. But since it's a union the total size of the elements is unrelated to the union's size. libffi would need to implement an FFI_TYPE_UNION type to support this as a separate case. Otherwise ctypes needs to actively forbid passing a union by value. ---------- nosy: +eryksun versions: +Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 23:10:30 2016 From: report at bugs.python.org (Eryk Sun) Date: Fri, 25 Mar 2016 03:10:30 +0000 Subject: [issue26565] [ctypes] Add value attribute to non basic pointers. In-Reply-To: <1458007329.36.0.71536825947.issue26565@psf.upfronthosting.co.za> Message-ID: <1458875430.09.0.687837558495.issue26565@psf.upfronthosting.co.za> Eryk Sun added the comment: The `value` of a c_char_p or c_wchar_p pointer is a Python bytes or str object. Since `value` won't consistently be the address value, it may be better to introduce a read-only `as_void` attribute that can be implemented consistently for all pointer types (including function pointers). Its value would be the same as the `value` of a casted c_void_p (e.g. NULL is mapped to None). The new attribute would be added as a getset descriptor in Pointer_getsets and PyCFuncPtr_getsets. For simple pointer types, it would have to be added specially in PyCSimpleType_new. ---------- nosy: +eryksun versions: +Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 00:43:25 2016 From: report at bugs.python.org (Eryk Sun) Date: Fri, 25 Mar 2016 04:43:25 +0000 Subject: [issue8557] subprocess PATH semantics and portability In-Reply-To: <1272451494.53.0.273790888777.issue8557@psf.upfronthosting.co.za> Message-ID: <1458881005.98.0.961092238191.issue8557@psf.upfronthosting.co.za> Eryk Sun added the comment: As is documented for CreateProcess [1], the search path always includes the following directories: * The directory from which the application loaded. * The current directory for the parent process. * The Windows system directory. Use the GetSystemDirectory function to get the path of this directory. * The 16-bit Windows system directory. There is no function that obtains the path of this directory, but it is searched. The name of this directory is System. * The Windows directory. Use the GetWindowsDirectory function to get the path of this directory. * The directories that are listed in the PATH environment variable. The value of PATH comes from the calling process environment, not from the environment passed in the lpEnvironment parameter. If you need to search some other list of paths, you can use shutil.which to find the fully qualified path of the target executable. Note that in Vista+ you can remove the current directory from the search list by defining the environment variable "NoDefaultCurrentDirectoryInExePath" [2]. The following examples show the minimum search path that CreateProcess uses when PATH isn't defined. >>> 'PATH' in os.environ False >>> subprocess.call('python -Sc "import sys; print(sys.prefix)"') Breakpoint 0 hit KERNELBASE!SearchPathW: 00007ff9`cf4b5860 488bc4 mov rax,rsp 0:000> du @rcx 0000006c`a7074410 "C:\Program Files\Python35;.;C:\W" 0000006c`a7074450 "indows\SYSTEM32\;C:\Windows\syst" 0000006c`a7074490 "em;C:\Windows" 0:000> g C:\Program Files\Python35 0 >>> os.environ['NoDefaultCurrentDirectoryInExePath'] = '1' >>> subprocess.call('python -Sc "import sys; print(sys.prefix)"') Breakpoint 0 hit KERNELBASE!SearchPathW: 00007ff9`cf4b5860 488bc4 mov rax,rsp 0:000> du @rcx 0000006c`a6560710 "C:\Program Files\Python35;C:\Win" 0000006c`a6560750 "dows\SYSTEM32\;C:\Windows\system" 0000006c`a6560790 ";C:\Windows" 0:000> g C:\Program Files\Python35 0 Note that in the 2nd case the current directory ('.') is no longer present between the application directory ("C:\Program Files\Python35") and the system directory ("C:\Windows\SYSTEM32\"). CreateProcess executes PE executables and batch files (run via the %ComSpec% interpreter). It automatically appends the .exe extension when searching for an executable. It does this via the lpExtension parameter of SearchPath [3]. Some .com files are PE executables (e.g. chcp.com). Otherwise it's not really usefully to loop over the PATHEXT extensions unless you're using shell=True, since most are filetypes that CreateProcess doesn't support [4]. [1]: https://msdn.microsoft.com/en-us/library/ms682425 [2]: https://msdn.microsoft.com/en-us/library/ms684269 [3]: https://msdn.microsoft.com/en-us/library/aa365527 [4]: If Microsoft's Windows team cared at all about cross-platform idioms they'd add shebang support to CreateProcess, which would make all scripts, not just batch files, directly executable without requiring ShellExecuteEx and registered filetypes. ShellExecuteEx doesn't support a lot of useful creation flags that are only available by calling CreateProcess directly, and it also doesn't check ACLs to prevent executing a file. So scripts are second class citizens in Windows, which is why Python has to embed scripts in .exe wrappers. ---------- nosy: +eryksun _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 00:43:47 2016 From: report at bugs.python.org (Martin Panter) Date: Fri, 25 Mar 2016 04:43:47 +0000 Subject: [issue6953] readline documentation needs work In-Reply-To: <1253456012.32.0.661240289209.issue6953@psf.upfronthosting.co.za> Message-ID: <1458881027.23.0.0224628594752.issue6953@psf.upfronthosting.co.za> Martin Panter added the comment: Here is a modified patch. Does the new wording for clear_history() clarify things for you Berker? In theory that function could be included or omitted for both the Gnu Readline and Editline cases. ---------- Added file: http://bugs.python.org/file42281/readline-doc.v2.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 00:49:41 2016 From: report at bugs.python.org (Martin Panter) Date: Fri, 25 Mar 2016 04:49:41 +0000 Subject: [issue26638] Avoid warnings about missing CLI options when building documentation Message-ID: <1458881380.09.0.599104229044.issue26638@psf.upfronthosting.co.za> New submission from Martin Panter: Defeat many warnings and related fixes building documentation * Mask various CLI options with exclamation marks (!) * Correct link to CLI section in zipapp * Make CLI section label in timeit less ambiguous The following warnings from unittest remain. Ideally they should be linked to the Python CLI documentation, but this does not seem possible because the ?unittest? documentation defines its own CLI options. Doc/library/unittest.rst:1965: WARNING: unknown option: -Wd Doc/library/unittest.rst:1965: WARNING: unknown option: -Wa Doc/library/unittest.rst:2051: WARNING: unknown option: -W ---------- assignee: docs at python components: Documentation files: doc-warnings.patch keywords: patch messages: 262401 nosy: docs at python, martin.panter priority: normal severity: normal stage: patch review status: open title: Avoid warnings about missing CLI options when building documentation versions: Python 2.7, Python 3.5, Python 3.6 Added file: http://bugs.python.org/file42282/doc-warnings.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 01:43:58 2016 From: report at bugs.python.org (Roundup Robot) Date: Fri, 25 Mar 2016 05:43:58 +0000 Subject: [issue26076] redundant checks in tok_get in Parser\tokenizer.c In-Reply-To: <1452452400.02.0.853203557937.issue26076@psf.upfronthosting.co.za> Message-ID: <20160325054355.21068.85624.07880D86@psf.io> Roundup Robot added the comment: New changeset f0acce8022d1 by Benjamin Peterson in branch 'default': remove duplicated check for fractions and complex numbers (closes #26076) https://hg.python.org/cpython/rev/f0acce8022d1 ---------- nosy: +python-dev resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 02:32:28 2016 From: report at bugs.python.org (Eric Khoo Jiun Hooi) Date: Fri, 25 Mar 2016 06:32:28 +0000 Subject: [issue23551] IDLE to provide menu link to PIP gui. In-Reply-To: <1425155752.55.0.0736033483828.issue23551@psf.upfronthosting.co.za> Message-ID: <1458887548.04.0.967582771614.issue23551@psf.upfronthosting.co.za> Eric Khoo Jiun Hooi added the comment: Terry, now I have done two more mockup for the installed package tab which is referenced from ???your suggestion and belopolsky's suggestion. Which you do you prefer? About the http://www.lfd.uci.edu/~gohlke/pythonlibs/ repo that you suggested to be added inside, I have done some research about that and it seem like pip install --index-url can only search from something like this website https://pypi.python.org/simple/ format. So, I think maybe I have to parse the package from ttp://www.lfd.uci.edu/~gohlke/pythonlibs/, but without description. Is it ok? ---------- Added file: http://bugs.python.org/file42283/Design suggested by Terry.png _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 02:33:28 2016 From: report at bugs.python.org (Eric Khoo Jiun Hooi) Date: Fri, 25 Mar 2016 06:33:28 +0000 Subject: [issue23551] IDLE to provide menu link to PIP gui. In-Reply-To: <1425155752.55.0.0736033483828.issue23551@psf.upfronthosting.co.za> Message-ID: <1458887608.12.0.796798893122.issue23551@psf.upfronthosting.co.za> Eric Khoo Jiun Hooi added the comment: One more thing, window should be able to install package with pip. So, why the need of http://www.lfd.uci.edu/~gohlke/pythonlibs/ ? ---------- Added file: http://bugs.python.org/file42284/Design reference from pycharm.png _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 03:57:50 2016 From: report at bugs.python.org (Roundup Robot) Date: Fri, 25 Mar 2016 07:57:50 +0000 Subject: [issue26637] importlib: better error message when import fail during Python shutdown In-Reply-To: <1458831993.32.0.609008052486.issue26637@psf.upfronthosting.co.za> Message-ID: <20160325075747.130990.10640.09045A4B@psf.io> Roundup Robot added the comment: New changeset e2c482b60776 by Victor Stinner in branch 'default': Issue #26637: Fix test_io https://hg.python.org/cpython/rev/e2c482b60776 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 04:33:04 2016 From: report at bugs.python.org (Roundup Robot) Date: Fri, 25 Mar 2016 08:33:04 +0000 Subject: [issue25654] test_multiprocessing_spawn ResourceWarning with -Werror In-Reply-To: <1447830828.22.0.981390741581.issue25654@psf.upfronthosting.co.za> Message-ID: <20160325083301.12201.46905.07ED1614@psf.io> Roundup Robot added the comment: New changeset 9faa03e9cea8 by Victor Stinner in branch 'default': Issue #25654: https://hg.python.org/cpython/rev/9faa03e9cea8 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 04:41:25 2016 From: report at bugs.python.org (STINNER Victor) Date: Fri, 25 Mar 2016 08:41:25 +0000 Subject: [issue25654] test_multiprocessing_spawn ResourceWarning with -Werror In-Reply-To: <1447830828.22.0.981390741581.issue25654@psf.upfronthosting.co.za> Message-ID: <1458895285.96.0.569113227552.issue25654@psf.upfronthosting.co.za> STINNER Victor added the comment: I pushed a change based on multiprocessing_no_close_fd.patch. I changed multiprocessing.util._close_stdin() to try to replace sys.stdin with os.devnull even if stdin.close() raised an exception. Since stdin is read-only, I don't expect an exception on stdin.close(), but it's just in case :-) What do you think? Is it better to keep stdin if stdin.close() raises an exception? I hate having to push changes without careful review. I wanted to fix buildbots as soon as possible. I'm working hard since 1 week to fix all random bugs on buildbots, so it's annoying when *all* buildbots are red :-/ I will read again the change later, but IMHO the approach is the good one. Python initialization also creates files (stdin, stdout, stderr) with closefd=False. The change should be backported to Python 3.5. I'm waiting for buildbots and I have to read again the change later. Note: It looks like all ResourceWarning of unit tests are now fixed. The following change succeed: ./python -Werror -m test -j0 test_multiprocessing_fork.py test_multiprocessing_forkserver.py test_multiprocessing_spawn.py test_multiprocessing_main_handling.py ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 04:51:56 2016 From: report at bugs.python.org (Roundup Robot) Date: Fri, 25 Mar 2016 08:51:56 +0000 Subject: [issue21925] ResourceWarning sometimes doesn't display In-Reply-To: <1404614973.3.0.388136336832.issue21925@psf.upfronthosting.co.za> Message-ID: <20160325085152.14703.41891.C308464C@psf.io> Roundup Robot added the comment: New changeset 307ba4afd0a6 by Victor Stinner in branch 'default': Issue #21925: Fix test_warnings for release mode https://hg.python.org/cpython/rev/307ba4afd0a6 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 04:57:24 2016 From: report at bugs.python.org (Aviv Palivoda) Date: Fri, 25 Mar 2016 08:57:24 +0000 Subject: [issue25951] SSLSocket.sendall() does not return None on success like socket.sendall() In-Reply-To: <1451054715.95.0.578529633079.issue25951@psf.upfronthosting.co.za> Message-ID: <1458896244.37.0.817780224877.issue25951@psf.upfronthosting.co.za> Aviv Palivoda added the comment: Thanks for the review. I don't have any use cases for this change. I just saw this issue while looking for something else and thought I will give it a try. ---------- Added file: http://bugs.python.org/file42285/25951-2.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 05:11:25 2016 From: report at bugs.python.org (Roundup Robot) Date: Fri, 25 Mar 2016 09:11:25 +0000 Subject: [issue21925] ResourceWarning sometimes doesn't display In-Reply-To: <1404614973.3.0.388136336832.issue21925@psf.upfronthosting.co.za> Message-ID: <20160325091121.21092.70444.7426A964@psf.io> Roundup Robot added the comment: New changeset f474898ef6de by Victor Stinner in branch '3.5': Issue #21925: Fix test_warnings for release mode https://hg.python.org/cpython/rev/f474898ef6de ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 05:11:26 2016 From: report at bugs.python.org (Roundup Robot) Date: Fri, 25 Mar 2016 09:11:26 +0000 Subject: [issue25654] test_multiprocessing_spawn ResourceWarning with -Werror In-Reply-To: <1447830828.22.0.981390741581.issue25654@psf.upfronthosting.co.za> Message-ID: <20160325091121.21092.25874.4288FF46@psf.io> Roundup Robot added the comment: New changeset 357d1ed928fe by Victor Stinner in branch '3.5': Issue #25654: https://hg.python.org/cpython/rev/357d1ed928fe ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 05:11:26 2016 From: report at bugs.python.org (Roundup Robot) Date: Fri, 25 Mar 2016 09:11:26 +0000 Subject: [issue26161] Use Py_uintptr_t instead of void* for atomic pointers In-Reply-To: <1453287433.06.0.917991277181.issue26161@psf.upfronthosting.co.za> Message-ID: <20160325091121.21092.72215.B664638A@psf.io> Roundup Robot added the comment: New changeset b1666037c97e by Victor Stinner in branch '3.5': Use Py_uintptr_t for atomic pointers https://hg.python.org/cpython/rev/b1666037c97e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 05:13:20 2016 From: report at bugs.python.org (STINNER Victor) Date: Fri, 25 Mar 2016 09:13:20 +0000 Subject: [issue25654] test_multiprocessing_spawn ResourceWarning with -Werror In-Reply-To: <20160325091121.21092.25874.4288FF46@psf.io> Message-ID: STINNER Victor added the comment: > The change should be backported to Python 3.5. I'm waiting for buildbots and I have to read again the change later. Oh, I didn't notice that 3.5 buildbots were also all red. So I backported the fix immediatly. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 05:36:11 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 25 Mar 2016 09:36:11 +0000 Subject: [issue25654] test_multiprocessing_spawn ResourceWarning with -Werror In-Reply-To: <1447830828.22.0.981390741581.issue25654@psf.upfronthosting.co.za> Message-ID: <1458898571.42.0.342149480164.issue25654@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: > What do you think? Is it better to keep stdin if stdin.close() raises an exception? I don't know. I don't know why OSError and ValueError are caught at all. What are you think about deterministic closing standard streams in leanup_std_streams.patch? There is no haste to commit this. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 05:49:19 2016 From: report at bugs.python.org (STINNER Victor) Date: Fri, 25 Mar 2016 09:49:19 +0000 Subject: [issue25654] test_multiprocessing_spawn ResourceWarning with -Werror In-Reply-To: <1447830828.22.0.981390741581.issue25654@psf.upfronthosting.co.za> Message-ID: <1458899359.89.0.350228029075.issue25654@psf.upfronthosting.co.za> STINNER Victor added the comment: > I don't know. I don't know why OSError and ValueError are caught at all. Ha ha, me neither. Maybe it's time to remove them an wait for user feedback :-) > What are you think about deterministic closing standard streams in cleanup_std_streams.patch? There is no haste to commit this. This change has two parts. For the "stdout.flush() ... stdout.close() ... stdout = None" part: * It looks like a good idea to set stout (and stderr) to None, since I see many C code having an explicit "stream is None" check (handle correctly this case). * For the flush part: I would prefer to share code with pylifecycle.c, flush_std_files(). Maybe we can log flush error into the C stderr stream? (Maybe with a flag when we know that Python finalization has started, or check _Py_Finalizing?) * For the close part: I don't know. I like the idea of being able to use print until the last Python instruction. Instead of closing and setting stdout/stderr to None, what do you think of using something similar than Py_Initialize(): /* Set up a preliminary stderr printer until we have enough infrastructure for the io module in place. */ pstderr = PyFile_NewStdPrinter(fileno(stderr)); if (pstderr == NULL) Py_FatalError("Py_Initialize: can't set preliminary stderr"); _PySys_SetObjectId(&PyId_stderr, pstderr); PySys_SetObject("__stderr__", pstderr); Py_DECREF(pstderr); This printer has limitations, but it can help to get very late messages during Python finalization. If we use this printer, it reduces the pressure on the exact order of operations. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 05:56:30 2016 From: report at bugs.python.org (STINNER Victor) Date: Fri, 25 Mar 2016 09:56:30 +0000 Subject: [issue25654] test_multiprocessing_spawn ResourceWarning with -Werror In-Reply-To: <1458899359.89.0.350228029075.issue25654@psf.upfronthosting.co.za> Message-ID: STINNER Victor added the comment: By the way, I'm not sure that using UTF-8/backslashescape is the encoding :-/ It's common to use Latin1 on a terminal. UTF-8 is very rare on Windows for the console for example. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 05:56:45 2016 From: report at bugs.python.org (STINNER Victor) Date: Fri, 25 Mar 2016 09:56:45 +0000 Subject: [issue25654] test_multiprocessing_spawn ResourceWarning with -Werror In-Reply-To: Message-ID: STINNER Victor added the comment: ASCII/backslashescape is maybe a better encoding for this printer. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 06:09:48 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 25 Mar 2016 10:09:48 +0000 Subject: [issue25654] test_multiprocessing_spawn ResourceWarning with -Werror In-Reply-To: <1447830828.22.0.981390741581.issue25654@psf.upfronthosting.co.za> Message-ID: <1458900588.86.0.155082159371.issue25654@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Lets open new issue for this. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 06:16:31 2016 From: report at bugs.python.org (STINNER Victor) Date: Fri, 25 Mar 2016 10:16:31 +0000 Subject: [issue25654] test_multiprocessing_spawn ResourceWarning with -Werror In-Reply-To: <1447830828.22.0.981390741581.issue25654@psf.upfronthosting.co.za> Message-ID: <1458900990.99.0.70797495458.issue25654@psf.upfronthosting.co.za> STINNER Victor added the comment: Serhiy: > Lets open new issue for this. I agree with PyImport_Cleanup() deserves a dedicated issue. Myself: > This change has two parts. Oops, I forgot to discuss the second part :-) You also added "sys.__stderr__ = sys.stderr" in multiprocessing. I don't understand this change. Can you please explain why you want to do that? Above, you wrote "A workaround is to set sys.__stdin__ as well as sys.stdin." Is "sys.__stderr__ = sys.stderr" also a workaround? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 06:50:05 2016 From: report at bugs.python.org (STINNER Victor) Date: Fri, 25 Mar 2016 10:50:05 +0000 Subject: [issue26639] Tools/i18n/pygettext.py: replace deprecated imp module with importlib Message-ID: <1458903005.49.0.704638577802.issue26639@psf.upfronthosting.co.za> New submission from STINNER Victor: Attached patch replaces the imp module with importlib in Tools/i18n/pygettext.py. Please review carefully, it looks like the code getting the filename of a Python module is not tested by Lib/test/test_tools.py :-/ ---------- files: pygettext_imp.patch keywords: patch messages: 262420 nosy: brett.cannon, eric.snow, haypo, ncoghlan priority: normal severity: normal status: open title: Tools/i18n/pygettext.py: replace deprecated imp module with importlib versions: Python 3.6 Added file: http://bugs.python.org/file42286/pygettext_imp.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 07:07:50 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 25 Mar 2016 11:07:50 +0000 Subject: [issue25654] test_multiprocessing_spawn ResourceWarning with -Werror In-Reply-To: <1447830828.22.0.981390741581.issue25654@psf.upfronthosting.co.za> Message-ID: <1458904070.03.0.836055071169.issue25654@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: > Oops, I forgot to discuss the second part :-) You also added "sys.__stderr__ = sys.stderr" in multiprocessing. At the start of PyImport_Cleanup() sys.stdXXX is set to sys.__stdXXX__. If sys.stdXXX is not sys.__stdXXX__ and here is the last reference to the stream, this causes deallocating sys.stdXXX and emitting a resource warning. If set sys.__stdXXX__ to sys.stdXXX, deallocating the stream is deferred to the end of PyImport_Cleanup(). Other changes make PyImport_Cleanup() to close standard streams explicitly before deallocating, thus resource warning are not emitted. This workaround is not needed if deallocating sys.stdin doesn't emit a resource warning (since it is opened with closefd=False). But it still may be needed in tests if apply proposed changes to PyImport_Cleanup(), since sys.stderr is set to a file opened with closefd=True. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 07:32:10 2016 From: report at bugs.python.org (Roundup Robot) Date: Fri, 25 Mar 2016 11:32:10 +0000 Subject: [issue26610] test_venv.test_with_pip() fails when ctypes is missing In-Reply-To: <1458643946.17.0.878468383793.issue26610@psf.upfronthosting.co.za> Message-ID: <20160325113206.130988.70459.2DCFD91E@psf.io> Roundup Robot added the comment: New changeset cd7cb503ab67 by Victor Stinner in branch 'default': Skip test_venv.test_with_pip() if ctypes miss https://hg.python.org/cpython/rev/cd7cb503ab67 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 07:32:49 2016 From: report at bugs.python.org (STINNER Victor) Date: Fri, 25 Mar 2016 11:32:49 +0000 Subject: [issue26610] test_venv.test_with_pip() fails when ctypes is missing In-Reply-To: <1458643946.17.0.878468383793.issue26610@psf.upfronthosting.co.za> Message-ID: <1458905569.83.0.821479192426.issue26610@psf.upfronthosting.co.za> STINNER Victor added the comment: I pushed a workaround to limit the number of failures on the OpenIndiana buildbot. Feel free once pip runs without ctypes and pip is updated in CPython. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 07:42:26 2016 From: report at bugs.python.org (Upendra Kumar) Date: Fri, 25 Mar 2016 11:42:26 +0000 Subject: [issue23551] IDLE to provide menu link to PIP gui. In-Reply-To: <1425155752.55.0.0736033483828.issue23551@psf.upfronthosting.co.za> Message-ID: <1458906146.22.0.47935803896.issue23551@psf.upfronthosting.co.za> Upendra Kumar added the comment: @Terry, I have tried to implement the treeview (as suggested by Alexander) and separate out the functions for retrieving data and displaying data. But, I have doubt on how to separate out the functions for getting data and displaying data. Further, I have changed the definition of 'runpip' function. I have used the subprocess module. Because of that few bugs are removed, but the speed of getting results from the pip command is slightly reduced. Therefore, if you can get time to review my updated code, please tell me about possible improvements. ---------- Added file: http://bugs.python.org/file42287/tem_pip_v3.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 07:45:12 2016 From: report at bugs.python.org (Berker Peksag) Date: Fri, 25 Mar 2016 11:45:12 +0000 Subject: [issue20021] "modernize" makeopcodetargets.py In-Reply-To: <1387426285.76.0.769422966502.issue20021@psf.upfronthosting.co.za> Message-ID: <1458906312.78.0.49879419249.issue20021@psf.upfronthosting.co.za> Berker Peksag added the comment: Victor went with a different solution in f682b620c64d. ---------- nosy: +haypo resolution: -> out of date stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 07:50:58 2016 From: report at bugs.python.org (Upendra Kumar) Date: Fri, 25 Mar 2016 11:50:58 +0000 Subject: [issue23551] IDLE to provide menu link to PIP gui. In-Reply-To: <1425155752.55.0.0736033483828.issue23551@psf.upfronthosting.co.za> Message-ID: <1458906658.14.0.182093915167.issue23551@psf.upfronthosting.co.za> Upendra Kumar added the comment: I had just one more idea after carefully going through all the options provided by pip. Other than the features suggested by Raymond, we should also provide option for installing using proxy settings. Sometimes, configuring proxy can also be tricky while downloading. Can this be an additional feature? It can be easily implemented as pip provides --proxy option. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 07:52:02 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 25 Mar 2016 11:52:02 +0000 Subject: [issue20021] "modernize" makeopcodetargets.py In-Reply-To: <1387426285.76.0.769422966502.issue20021@psf.upfronthosting.co.za> Message-ID: <1458906722.85.0.311035104695.issue20021@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: f682b620c64d looks incorrect to me. It makes makeopcodetargets.py to use the opcode module of Python that executes the script. Instead the script should use the opcode module from the same source tree as the script. I think f682b620c64d should be reverted. ---------- priority: low -> high resolution: out of date -> stage: resolved -> status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 07:56:15 2016 From: report at bugs.python.org (ProgVal) Date: Fri, 25 Mar 2016 11:56:15 +0000 Subject: [issue26640] xmlrpc.server imports xmlrpc.client Message-ID: <1458906975.33.0.607385573018.issue26640@psf.upfronthosting.co.za> New submission from ProgVal: from xmlrpc.client import Fault, dumps, loads, gzip_encode, gzip_decode Shouldn't these class/functions be moved to a new module, with a name like xmlrpc.common? ---------- components: Library (Lib) messages: 262428 nosy: Valentin.Lorentz priority: normal severity: normal status: open title: xmlrpc.server imports xmlrpc.client type: enhancement versions: Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 08:00:35 2016 From: report at bugs.python.org (STINNER Victor) Date: Fri, 25 Mar 2016 12:00:35 +0000 Subject: [issue26641] doctest doesn't support packages Message-ID: <1458907235.84.0.937791906936.issue26641@psf.upfronthosting.co.za> New submission from STINNER Victor: The PEP 420 -- Implicit Namespace Packages introduces packages which have no __init__.py file and can be made of multiple packages. It looks like doctest doesn't support them. I would like to convert the Lib/test/ of the Python standard library into such package for the issue #26295. I propose to use an heuristic when the package is only made of one directory (when module.__path__ only contains one entry): use this directory to lookup for requested test files. Attached patch implements that. ---------- files: doctest_package.patch keywords: patch messages: 262429 nosy: brett.cannon, eric.snow, haypo, ncoghlan priority: normal severity: normal status: open title: doctest doesn't support packages type: enhancement versions: Python 3.6 Added file: http://bugs.python.org/file42288/doctest_package.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 08:00:46 2016 From: report at bugs.python.org (STINNER Victor) Date: Fri, 25 Mar 2016 12:00:46 +0000 Subject: [issue26641] doctest doesn't support packages In-Reply-To: <1458907235.84.0.937791906936.issue26641@psf.upfronthosting.co.za> Message-ID: <1458907246.4.0.0923383396097.issue26641@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- components: +Library (Lib) _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 08:01:10 2016 From: report at bugs.python.org (STINNER Victor) Date: Fri, 25 Mar 2016 12:01:10 +0000 Subject: [issue26295] Random failures when running test suite in parallel (-m test -j0) caused by test_regrtest In-Reply-To: <1454663707.24.0.201658170139.issue26295@psf.upfronthosting.co.za> Message-ID: <1458907270.26.0.465268117117.issue26295@psf.upfronthosting.co.za> STINNER Victor added the comment: I created the issue #26641 for doctest (test_doctest). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 08:07:25 2016 From: report at bugs.python.org (STINNER Victor) Date: Fri, 25 Mar 2016 12:07:25 +0000 Subject: [issue20021] "modernize" makeopcodetargets.py In-Reply-To: <1387426285.76.0.769422966502.issue20021@psf.upfronthosting.co.za> Message-ID: <1458907645.42.0.337473409266.issue20021@psf.upfronthosting.co.za> STINNER Victor added the comment: > Victor went with a different solution in f682b620c64d. Oh sorry, I wasn't aware of this old issue. My motivation was to get ride of the deprecated imp module, this script looks to be the latest part of the Python which uses the imp module (except of deliberate unit tests on the imp module). > f682b620c64d looks incorrect to me. It makes makeopcodetargets.py to use the opcode module of Python that executes the script. Instead the script should use the opcode module from the same source tree as the script. Ah, this was unclear to me. It looks overcomplicated code to just import a module. Can't we simply use import, but ensure that the running python executable belongs to the current source tree? Or does it matter to be able to use an external python program? > I think f682b620c64d should be reverted. Don't hesitate to rework the code to importlib if you want to ensure that Lib/opcode.py is imported. But please don't revert the whole change, I changed other things. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 08:08:51 2016 From: report at bugs.python.org (STINNER Victor) Date: Fri, 25 Mar 2016 12:08:51 +0000 Subject: [issue20021] "modernize" makeopcodetargets.py In-Reply-To: <1387426285.76.0.769422966502.issue20021@psf.upfronthosting.co.za> Message-ID: <1458907731.0.0.0140903823658.issue20021@psf.upfronthosting.co.za> STINNER Victor added the comment: issue20021_2.diff looks good to me. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 08:09:13 2016 From: report at bugs.python.org (SilentGhost) Date: Fri, 25 Mar 2016 12:09:13 +0000 Subject: [issue26640] xmlrpc.server imports xmlrpc.client In-Reply-To: <1458906975.33.0.607385573018.issue26640@psf.upfronthosting.co.za> Message-ID: <1458907753.87.0.218458823998.issue26640@psf.upfronthosting.co.za> Changes by SilentGhost : ---------- nosy: +loewis versions: +Python 3.6 -Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 08:15:40 2016 From: report at bugs.python.org (STINNER Victor) Date: Fri, 25 Mar 2016 12:15:40 +0000 Subject: [issue26588] _tracemalloc: add support for multiple address spaces (domains) In-Reply-To: <1458337167.06.0.908004959718.issue26588@psf.upfronthosting.co.za> Message-ID: <1458908140.35.0.789029524151.issue26588@psf.upfronthosting.co.za> STINNER Victor added the comment: Oooookay, it looks like all issues have been fixed. The optimization for compact keys has been implemented. I didn't see any crash on buildbots recently, test_tracemalloc pass on all platforms. Nathaniel asked how domains will be "allocated" or "registered", but I suggest to discuss that in the issue #26530. I close this issue that was much more difficult to implement than I expected... ---------- resolution: -> fixed status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 08:27:00 2016 From: report at bugs.python.org (STINNER Victor) Date: Fri, 25 Mar 2016 12:27:00 +0000 Subject: [issue26530] tracemalloc: add C API to manually track/untrack memory allocations In-Reply-To: <1457619430.68.0.0968942184372.issue26530@psf.upfronthosting.co.za> Message-ID: <1458908820.35.0.0237610930677.issue26530@psf.upfronthosting.co.za> STINNER Victor added the comment: tracemalloc_track_fd.py: Proof-of-concept to track file descriptors using monkey-patching on os.open() and os.close(). It's just to show to the API can be used in Python, I don't think that it's very useful to track where file descriptors are allocated. ---------- Added file: http://bugs.python.org/file42289/tracemalloc_track_fd.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 08:31:59 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 25 Mar 2016 12:31:59 +0000 Subject: [issue26640] xmlrpc.server imports xmlrpc.client In-Reply-To: <1458906975.33.0.607385573018.issue26640@psf.upfronthosting.co.za> Message-ID: <1458909119.57.0.111957840124.issue26640@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Moving public classes and functions to other module can break pickle compatibility. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 08:42:58 2016 From: report at bugs.python.org (Aivar Annamaa) Date: Fri, 25 Mar 2016 12:42:58 +0000 Subject: [issue23551] IDLE to provide menu link to PIP gui. In-Reply-To: <1425155752.55.0.0736033483828.issue23551@psf.upfronthosting.co.za> Message-ID: <1458909778.47.0.461549418664.issue23551@psf.upfronthosting.co.za> Changes by Aivar Annamaa : ---------- nosy: -Aivar.Annamaa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 09:13:17 2016 From: report at bugs.python.org (STINNER Victor) Date: Fri, 25 Mar 2016 13:13:17 +0000 Subject: [issue26642] Replace stdout and stderr with simple standard printers at Python exit Message-ID: <1458911597.09.0.705997743741.issue26642@psf.upfronthosting.co.za> New submission from STINNER Victor: The Python shutdown process is complex and fragile. It was discussed in the issue #25654 to replace stdout and stderr with simple "standard printers" (implemented in C, don't depend on other Python objects or modules). Attached patch implements this idea. The patch begins with closing standard stream objects (sys.stdin, sys.stdout, sys.stderr), and then replace stdout and stderr. ---------- files: replace_stdio.patch keywords: patch messages: 262436 nosy: haypo priority: normal severity: normal status: open title: Replace stdout and stderr with simple standard printers at Python exit versions: Python 3.6 Added file: http://bugs.python.org/file42290/replace_stdio.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 09:13:21 2016 From: report at bugs.python.org (STINNER Victor) Date: Fri, 25 Mar 2016 13:13:21 +0000 Subject: [issue26642] Replace stdout and stderr with simple standard printers at Python exit In-Reply-To: <1458911597.09.0.705997743741.issue26642@psf.upfronthosting.co.za> Message-ID: <1458911601.93.0.688816402659.issue26642@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 09:13:59 2016 From: report at bugs.python.org (STINNER Victor) Date: Fri, 25 Mar 2016 13:13:59 +0000 Subject: [issue25654] test_multiprocessing_spawn ResourceWarning with -Werror In-Reply-To: <1447830828.22.0.981390741581.issue25654@psf.upfronthosting.co.za> Message-ID: <1458911639.61.0.430940804719.issue25654@psf.upfronthosting.co.za> STINNER Victor added the comment: > Lets open new issue for this. I opened the issue #26642 "Replace stdout and stderr with simple standard printers at Python exit". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 09:22:05 2016 From: report at bugs.python.org (STINNER Victor) Date: Fri, 25 Mar 2016 13:22:05 +0000 Subject: [issue19829] _pyio.BufferedReader and _pyio.TextIOWrapper destructor don't emit ResourceWarning if the file is not closed In-Reply-To: <1385721421.95.0.384748799117.issue19829@psf.upfronthosting.co.za> Message-ID: <1458912125.11.0.211388011359.issue19829@psf.upfronthosting.co.za> STINNER Victor added the comment: > I think we should use one of Martin's option. If there are any issues with garbage collecting, we should fix the garbage collector. Ok, here is a new simpler proposition: remove all _dealloc_warn() method, and simply emit the ResourceWarning in IOBase finalizer. With this change, all objects which inherit from io.IOBase (or _pyio.IOBase) now emits a ResourceWarning if they are not closed explicitly. You have to override the __del__() method to prevent this warning. A lot of new objects start to log ResourceWarning: io.SocketIO, _pyio.TextIOWrapper, io.BytesIO, http.client.HTTPResponse, etc. For io.BytesIO, I fixed the code to inherit correctly IOBase finalizer. -- A lot of tests start to fail because they emit a lot of ResourceWarning warnings. I don't know yet if it's a feature or a bug :-) -- With the patch, Python starts to logs warnings like: sys:1: ResourceWarning: unclosed file <_io.TextIOWrapper name='' mode='w' encoding='UTF-8'> sys:1: ResourceWarning: unclosed file <_io.TextIOWrapper name='' mode='r' encoding='UTF-8'> You can use my patch of the issue #26642 to fix these warnings. ResourceWarning is emited even if FileIO.closefd is false. Note: It looks like the ResourceWarning is not always displayed. Yet another bug? ---------- Added file: http://bugs.python.org/file42291/iobase_finalizer.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 09:33:41 2016 From: report at bugs.python.org (STINNER Victor) Date: Fri, 25 Mar 2016 13:33:41 +0000 Subject: [issue19829] _pyio.BufferedReader and _pyio.TextIOWrapper destructor don't emit ResourceWarning if the file is not closed In-Reply-To: <1385721421.95.0.384748799117.issue19829@psf.upfronthosting.co.za> Message-ID: <1458912821.34.0.983904195985.issue19829@psf.upfronthosting.co.za> STINNER Victor added the comment: > For io.BytesIO, I fixed the code to inherit correctly IOBase finalizer. Oh, I forgot to include it in my patch. But it's maybe better to have it in a different patch: see attached bytesio_stringio.patch which changes also io.StringIO to inherit the IOBase finalizer. Emitting a ResourceWarning in io.BytesIO and io.StringIO adds a *lot* of warnings when running the Python test suite. Since these objects only contain memory, no very limited resource like file descriptors, it's probably better to *not* log ResourceWarning for them. ---------- Added file: http://bugs.python.org/file42292/bytesio_stringio.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 09:45:40 2016 From: report at bugs.python.org (STINNER Victor) Date: Fri, 25 Mar 2016 13:45:40 +0000 Subject: [issue19829] _pyio.BufferedReader and _pyio.TextIOWrapper destructor don't emit ResourceWarning if the file is not closed In-Reply-To: <1385721421.95.0.384748799117.issue19829@psf.upfronthosting.co.za> Message-ID: <1458913540.92.0.138284270703.issue19829@psf.upfronthosting.co.za> STINNER Victor added the comment: Ok, I now understand the problem better. They are two kinds of io objects: (1) object which directly or indirectly owns a limited resource like file descriptor => must emit a ResourceWarning (2) object which don't own a limited resource => no ResourceWarning must be logged Examples of (1): FileIO, BufferedReader(FileIO), TextIOWrapper(BufferedReader(FileIO)) Examples of (2): BytesIO, BuffereadReader(BytesIO), TextIOWrapper(BuffereadReader(BytesIO)) The tricky part is to decide if an object owns a limited resource or not. Currently, the io module uses the _dealloc_warn() trick. A close() method tries to call _dealloc_warn(), but it ignores any exception when calling _dealloc_warn(). BufferedReader calls raw._dealloc_warn(). TextIOWrapper calls buffer._dealloc_warn(). For case (1), BufferedReader(FileIO).close() calls FileIO._dealloc_warn() => ResourceWarning is logged For case (2), BufferedReader(BytesIO).close() calls BytesIO._dealloc_warn() raises an AttributeError => no warning is logged Well, we can call this a hack, but it works :-) pyio_res_warn-3.patch implements the same hack in _pyio. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 10:12:20 2016 From: report at bugs.python.org (Denis) Date: Fri, 25 Mar 2016 14:12:20 +0000 Subject: [issue26636] SystemError while running tests: extra exception raised In-Reply-To: <1458830124.86.0.833063009282.issue26636@psf.upfronthosting.co.za> Message-ID: <1458915140.18.0.550573188243.issue26636@psf.upfronthosting.co.za> Denis added the comment: Thank you! The error was that some calls in pycrypto code were aggregated and exceptions in those calls were ignored. Here is the patch for pycrypto that fixed the build. @@ -1427,7 +1429,9 @@ getStrongPrime (PyObject *self, PyObject *args, PyObject *kwargs) Py_BLOCK_THREADS; res = 1; res &= getRandomRange (X, lower_bound, upper_bound, randfunc); + if (res!=0) res &= getRandomNBitInteger (y[0], 101, randfunc); + if (res!=0) res &= getRandomNBitInteger (y[1], 101, randfunc); Py_UNBLOCK_THREADS; ---- So this code tried to aggregate exceptions before propagating them, that was the reason for exception. ---------- resolution: -> not a bug _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 10:15:10 2016 From: report at bugs.python.org (STINNER Victor) Date: Fri, 25 Mar 2016 14:15:10 +0000 Subject: [issue26636] SystemError while running tests: extra exception raised In-Reply-To: <1458830124.86.0.833063009282.issue26636@psf.upfronthosting.co.za> Message-ID: <1458915310.18.0.266787804134.issue26636@psf.upfronthosting.co.za> STINNER Victor added the comment: I hope that the exception will help you to write better software (don't loose exceptions) ;-) ---------- status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 10:27:47 2016 From: report at bugs.python.org (Maciej Szulik) Date: Fri, 25 Mar 2016 14:27:47 +0000 Subject: [issue26543] imaplib noop Debug In-Reply-To: <1457738623.54.0.0867122071018.issue26543@psf.upfronthosting.co.za> Message-ID: <1458916067.14.0.408355458133.issue26543@psf.upfronthosting.co.za> Changes by Maciej Szulik : ---------- nosy: +maciej.szulik _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 10:42:20 2016 From: report at bugs.python.org (ProgVal) Date: Fri, 25 Mar 2016 14:42:20 +0000 Subject: [issue26640] xmlrpc.server imports xmlrpc.client In-Reply-To: <1458906975.33.0.607385573018.issue26640@psf.upfronthosting.co.za> Message-ID: <1458916940.3.0.201025702959.issue26640@psf.upfronthosting.co.za> ProgVal added the comment: Even if xmlrpc.client imported them in its namespace? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 13:08:28 2016 From: report at bugs.python.org (Brett Cannon) Date: Fri, 25 Mar 2016 17:08:28 +0000 Subject: [issue26640] xmlrpc.server imports xmlrpc.client In-Reply-To: <1458906975.33.0.607385573018.issue26640@psf.upfronthosting.co.za> Message-ID: <1458925708.27.0.819149175647.issue26640@psf.upfronthosting.co.za> Brett Cannon added the comment: Yes because the location of the object is based on where it's defined, not where you got it from. While I get the motivation to be a little cleaner in the xmlrpc package, "practicality beats purity" here in that the reorg isn't worth it at this point in the face of potentially breaking code for little benefit. Closing as "wont fix"; sorry, Valentin. ---------- nosy: +brett.cannon resolution: -> wont fix status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 13:23:52 2016 From: report at bugs.python.org (Steve Dower) Date: Fri, 25 Mar 2016 17:23:52 +0000 Subject: [issue26631] Unable to install Python 3.5.1 on Windows 10 - Error 0x80070643: Failed to install MSI package. In-Reply-To: <1458771798.71.0.333968276616.issue26631@psf.upfronthosting.co.za> Message-ID: <1458926632.72.0.412563731431.issue26631@psf.upfronthosting.co.za> Steve Dower added the comment: Thanks for the report You should have another log file near the one you attached (in your %LocalAppData%\Temp directory) with "core_JustForMe" in the name. Could you put that one up as well? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 13:33:56 2016 From: report at bugs.python.org (Steve Dower) Date: Fri, 25 Mar 2016 17:33:56 +0000 Subject: [issue26629] Need an ability to build standard DLLs with distutils In-Reply-To: <1458766467.89.0.930968148514.issue26629@psf.upfronthosting.co.za> Message-ID: <1458927236.14.0.715075869102.issue26629@psf.upfronthosting.co.za> Steve Dower added the comment: (Obligatory recommendation that you use Cython rather than ctypes, especially if you're going to require your users to have a compiler handy - in general this isn't recommended on Windows at all; make sure you distribute wheels if you want to make your users' lives easiest.) I haven't tested this, but I believe you want to specify your libraries with the `libraries` parameter, not the `extensions` parameter: LIBRARIES = [ ('my_lib', {'sources': ['my_lib.c'], 'include_dirs': ['dirs', 'if', 'you', 'want'], 'macros': ['DEFINES', 'IF', 'YOU', 'WANT']}) ] setup( ... libraries=LIBRARIES, ... ) Then you need to ensure build_clib is run to produce it. I'd imagine that will just happen, but I could be wrong. Again, I haven't tried this myself, but it seems to be the right way to build a regular library. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 13:34:51 2016 From: report at bugs.python.org (Steve Dower) Date: Fri, 25 Mar 2016 17:34:51 +0000 Subject: [issue26629] Need an ability to build standard DLLs with distutils In-Reply-To: <1458766467.89.0.930968148514.issue26629@psf.upfronthosting.co.za> Message-ID: <1458927291.53.0.324595679141.issue26629@psf.upfronthosting.co.za> Steve Dower added the comment: Oh, and just saw that you're apparently asking about 2.7. I was referring to the 3.5 sources for distutils, so some things may be different in 2.7. But I doubt distutils has changed that much since then. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 14:14:08 2016 From: report at bugs.python.org (Alexander Belopolsky) Date: Fri, 25 Mar 2016 18:14:08 +0000 Subject: [issue26591] datetime datetime.time to datetime.time comparison does nothing In-Reply-To: <1458373720.99.0.780228236927.issue26591@psf.upfronthosting.co.za> Message-ID: <1458929648.72.0.391811455166.issue26591@psf.upfronthosting.co.za> Alexander Belopolsky added the comment: Python 3.6.0a0 (default:245a16f33c4b, Mar 25 2016, 14:11:43) [GCC 4.2.1 Compatible Apple LLVM 7.0.2 (clang-700.1.81)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import datetime >>> if datetime.time(22, 15) > datetime.time(16, 0): ... print('works for me') ... works for me ---------- resolution: -> works for me stage: test needed -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 14:20:25 2016 From: report at bugs.python.org (STINNER Victor) Date: Fri, 25 Mar 2016 18:20:25 +0000 Subject: [issue26643] regrtest: rework libregrtest.save_env submodule Message-ID: <1458930024.17.0.00462396415924.issue26643@psf.upfronthosting.co.za> New submission from STINNER Victor: (I pushed the change 245a16f33c4b, but Serhiy asked me to review it and discuss it. So I reverted my change and created this issue.) I noticed many times that buildbots log "test xxx changed yyy" but this line is not enough to debug the issue. I propose to always display the old and new value to easy debugging these issues. Sometimes, I try to reproduce the issue, but I fail to reproduce it locally. I may depend on the test execution order and the platform. Attached patch changes: * Replace get/restore methods with a Resource class and Resource subclasses * Create ModuleAttr, ModuleAttrList and ModuleAttrDict helper classes * Use __subclasses__() to get resource classes instead of using an hardcoded list (2 shutil resources were missinged in the list!) * Don't define MultiprocessingProcessDangling resource if the multiprocessing module is missing * Nicer diff for dictionaries. Useful for the big os.environ dict * Reorder code to group resources I chose to use classes to be able to easily customize how "Before/After" (value diff) is displayed: the new display_diff() method. I also wrote helper classes to factorize the code. Example: def get_sys_path(self): return id(sys.path), sys.path, sys.path[:] def restore_sys_path(self, saved_path): sys.path = saved_path[1] sys.path[:] = saved_path[2] becomes class SysPath(ModuleAttrList): name = 'sys.path' When sys.path is modified, currently Python displays the whole (id, object, object_copy) tuple which is not easily readable. With my change, it only displays object_copy (one list). I began to write a pretty diff for ModuleAttrList, but it looks non trivial, and I'm not sure that it's worth (since lists are quite short). ---------- components: Tests files: save_env.patch keywords: patch messages: 262449 nosy: haypo, serhiy.storchaka priority: normal severity: normal status: open title: regrtest: rework libregrtest.save_env submodule versions: Python 3.6 Added file: http://bugs.python.org/file42293/save_env.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 14:26:50 2016 From: report at bugs.python.org (Alexander Belopolsky) Date: Fri, 25 Mar 2016 18:26:50 +0000 Subject: [issue26616] A bug in datetime.astimezone() method In-Reply-To: <1458710706.19.0.994284495334.issue26616@psf.upfronthosting.co.za> Message-ID: <1458930410.56.0.294813013962.issue26616@psf.upfronthosting.co.za> Alexander Belopolsky added the comment: > When you made your first astimezone() call, (t = u.astimezone()), > it was made without a tzinfo parameter, and should result in t's > timezeone being EST by the documentation. No, u in my test case was selected to be right before the "fall-back" time. The clocks in New York are moved back at 2am local, or 6am UTC. You can verify that with zdump: $ zdump -v America/New_York | grep 2015 | grep Nov America/New_York Sun Nov 1 05:59:59 2015 UTC = Sun Nov 1 01:59:59 2015 EDT isdst=1 America/New_York Sun Nov 1 06:00:00 2015 UTC = Sun Nov 1 01:00:00 2015 EST isdst=0 so 5am UTC is 1 hour before the transition and is correctly translated to EDT by astimezone(). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 15:18:35 2016 From: report at bugs.python.org (Alexander Belopolsky) Date: Fri, 25 Mar 2016 19:18:35 +0000 Subject: [issue26616] A bug in datetime.astimezone() method In-Reply-To: <1458710706.19.0.994284495334.issue26616@psf.upfronthosting.co.za> Message-ID: <1458933515.56.0.764061724984.issue26616@psf.upfronthosting.co.za> Changes by Alexander Belopolsky : ---------- versions: -Python 3.3, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 15:18:44 2016 From: report at bugs.python.org (Alexander Belopolsky) Date: Fri, 25 Mar 2016 19:18:44 +0000 Subject: [issue26616] A bug in datetime.astimezone() method In-Reply-To: <1458710706.19.0.994284495334.issue26616@psf.upfronthosting.co.za> Message-ID: <1458933524.03.0.166321062614.issue26616@psf.upfronthosting.co.za> Changes by Alexander Belopolsky : ---------- stage: patch review -> commit review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 15:29:35 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 25 Mar 2016 19:29:35 +0000 Subject: [issue26643] regrtest: rework libregrtest.save_env submodule In-Reply-To: <1458930024.17.0.00462396415924.issue26643@psf.upfronthosting.co.za> Message-ID: <1458934175.87.0.783974144594.issue26643@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Old code looks much clearer to me. Consider your example with the 'sys.path' resource. With current code I need to understand only 3 simple lines of the code in two close methods. With the patch I need to research 4 classes with 16 complicated methods! This is awful! That was about first two items. Now about using __subclasses__(). Is it guarantied that the order of classes in __subclasses__() is the same as the order of declaration and always will be? The order of restoring resources matters. For now if there is needed to change the order of restoring resources (I'm sure there will be need to do this in future) you need to change only one or two lines. With your patch you need to reorder classes declarations. This not only makes the patch larger, but makes harder to review the diff and to track the history of the file. Nicer diff for dictionaries can be an enhancement, but it can be implemented without such large rewriting. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 15:47:39 2016 From: report at bugs.python.org (Roundup Robot) Date: Fri, 25 Mar 2016 19:47:39 +0000 Subject: [issue26616] A bug in datetime.astimezone() method In-Reply-To: <1458710706.19.0.994284495334.issue26616@psf.upfronthosting.co.za> Message-ID: <20160325194736.116210.83770.61EA7E45@psf.io> Roundup Robot added the comment: New changeset 361a92204d4a by Alexander Belopolsky in branch '3.5': Issue#26616:Fixed a bug in datetime.astimezone() method. https://hg.python.org/cpython/rev/361a92204d4a ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 15:48:53 2016 From: report at bugs.python.org (Alexander Belopolsky) Date: Fri, 25 Mar 2016 19:48:53 +0000 Subject: [issue26616] A bug in datetime.astimezone() method In-Reply-To: <1458710706.19.0.994284495334.issue26616@psf.upfronthosting.co.za> Message-ID: <1458935333.1.0.465601480187.issue26616@psf.upfronthosting.co.za> Changes by Alexander Belopolsky : ---------- resolution: -> fixed stage: commit review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 15:52:12 2016 From: report at bugs.python.org (Alexander Belopolsky) Date: Fri, 25 Mar 2016 19:52:12 +0000 Subject: [issue26616] A bug in datetime.astimezone() method In-Reply-To: <1458710706.19.0.994284495334.issue26616@psf.upfronthosting.co.za> Message-ID: <1458935532.19.0.838287139072.issue26616@psf.upfronthosting.co.za> Alexander Belopolsky added the comment: The fix was applied to default in c9bc6614a652 but I got the commit message wrong. I will not attempt to fix it (not sure it is even possible in hg.) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 16:42:29 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 25 Mar 2016 20:42:29 +0000 Subject: [issue19829] _pyio.BufferedReader and _pyio.TextIOWrapper destructor don't emit ResourceWarning if the file is not closed In-Reply-To: <1385721421.95.0.384748799117.issue19829@psf.upfronthosting.co.za> Message-ID: <1458938549.53.0.678466493393.issue19829@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: 1. What if only object which directly owns a limited resource will emit a ResourceWarning? This can break some tests, but may be these tests are too strong? Current GC may be better than when io classes were implemented. 2. An object which indirectly owns a limited resource don't know about this if use only public API. It can known about this only if the wrapped object provides _dealloc_warn(). Thus _dealloc_warn() extends the API. If allows an object which indirectly owns a limited resource emit a resource warning, it may be worth to expose _dealloc_warn() or something equivalent as public API. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 16:54:35 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 25 Mar 2016 20:54:35 +0000 Subject: [issue26642] Replace stdout and stderr with simple standard printers at Python exit In-Reply-To: <1458911597.09.0.705997743741.issue26642@psf.upfronthosting.co.za> Message-ID: <1458939275.12.0.657612765526.issue26642@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: There are some questions. 1. Is there a reason only name is closed, not dunder_name? (Josh's question, but I'm interesting too). 2. Is it worth to first replace standard streams with "standard printers", and then close original streams? This allows to log warnings from closing streams. 3. "standard printers" are used at startup and at shutdown. Can we reuse some code? Or save and reuse "standard printers"? 4. Daemons close standard streams and fileno(stdout) can return unrelevant value. Perhaps it is not good idea to recreate closed stdout. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 17:31:40 2016 From: report at bugs.python.org (STINNER Victor) Date: Fri, 25 Mar 2016 21:31:40 +0000 Subject: [issue26642] Replace stdout and stderr with simple standard printers at Python exit In-Reply-To: <1458939275.12.0.657612765526.issue26642@psf.upfronthosting.co.za> Message-ID: STINNER Victor added the comment: Serhiy Storchaka added the comment: > 1. Is there a reason only name is closed, not dunder_name? (Josh's question, but I'm interesting too). By default, sys.__stdout__ is sys.stdout. Is it ok to close the same file twice? > 2. Is it worth to first replace standard streams with "standard printers", and then close original streams? This allows to log warnings from closing streams. Yeah, I tried this locally after sending my patch. I think that we should keep a strong reference and only "decref" after the stream is replaced. > 3. "standard printers" are used at startup and at shutdown. Can we reuse some code? Or save and reuse "standard printers"? I will check, it's maybe possible to share some code inside pylifecycle.c. > 4. Daemons close standard streams and fileno(stdout) can return unrelevant value. Perhaps it is not good idea to recreate closed stdout. Ah yes, while playing with my patch, I noticed that I replaced stdout even if sys.stdout was NULL or None. Closed stdout is a different thing. I guess that we can try to call stdout.closed() and only replaced it with a standard printer it closed() returns True (don't do it on error nor if closed() returns false). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 18:24:37 2016 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 25 Mar 2016 22:24:37 +0000 Subject: [issue26627] IDLE incorrectly labeling error as internal In-Reply-To: <1458756045.86.0.656079576242.issue26627@psf.upfronthosting.co.za> Message-ID: <1458944677.85.0.63531210444.issue26627@psf.upfronthosting.co.za> Terry J. Reedy added the comment: The goal is to match the traceback that Python itself produces with the same code, but it is perhaps an impossible process. The current list goes back to 2003 without tracker issue numbers, so I don't know the reason for each. I worry a bit about the suppression of lines from threading and queue. I wondered why the idlelib.run lines were here until I read this (3.5.2, run.py, line 233-236. if len(tb) == 0: # exception was in IDLE internals, don't prune! tb[:] = orig_tb[:] print("** IDLE Internal Exception: ", file=sys.stderr) So both lines were deleted and then restored. Prepending idlelib as appropriate, seems like a good idea. exclude = ['bdb.py', 'queue.py', 'threading.py'] for name in ('RemoteDebugger.py', 'rpc.py', 'run.py'): exclude.append(os.path.join('idlelib', name)) ---------- stage: -> test needed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 19:02:53 2016 From: report at bugs.python.org (STINNER Victor) Date: Fri, 25 Mar 2016 23:02:53 +0000 Subject: [issue25654] test_multiprocessing_spawn ResourceWarning with -Werror In-Reply-To: <1447830828.22.0.981390741581.issue25654@psf.upfronthosting.co.za> Message-ID: <1458946973.13.0.725897424054.issue25654@psf.upfronthosting.co.za> STINNER Victor added the comment: I'm not sure why Python 2.7 was in the Versions. I just ran "python2.7 -Werror -m test.regrtest -v test_multiprocessing" => no error. ResourceWarning doesn't exist in Python 2. Is it still something to do on multiprocessing about ResourceWarning? I didn't understand if you (Martin and Serhiy) are ok with my change (based on Serhiy's change). ---------- versions: -Python 2.7, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 19:11:45 2016 From: report at bugs.python.org (STINNER Victor) Date: Fri, 25 Mar 2016 23:11:45 +0000 Subject: [issue26612] test_ssl: use context manager (with) to fix ResourceWarning In-Reply-To: <1458694066.07.0.537208093993.issue26612@psf.upfronthosting.co.za> Message-ID: <1458947505.8.0.0973889661243.issue26612@psf.upfronthosting.co.za> STINNER Victor added the comment: "try: ... finally: s.close()" are "with s: ..." do the same thing, but I prefer "with" (context-manager). IMO it's more "pythonic". I prefer to see the "cleanup block" at the beginning, rather than at the end. > My point about Python 2 was that this might add an annoying difference between the two branches. Even if you don?t apply this to Py 2, the next person adding or updating a test might be inclined to do it. Well, there are 3 choices: (1) Do nothing. The code rotten slowly (technical debt) (2) Modify all actively development branches (2.7, 3.5, default) (3) Only modify Python 3.6 Mofiying all branches means taking the (low) risk of introducing regressions. IMHO regressions occur, all the time. I prefer the option (3) because it allows to enhance the code without taking any risk on regression. Yeah, the code diverge, it's a natural fact. Then you write that my changes replacing try/finally with "with" are not worth. Well, maybe you are true. Since 5 years, I convert all the code to "with" because I really like context managers. IMHO they make the code stronger and easier to read. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 19:23:52 2016 From: report at bugs.python.org (STINNER Victor) Date: Fri, 25 Mar 2016 23:23:52 +0000 Subject: [issue26643] regrtest: rework libregrtest.save_env submodule In-Reply-To: <1458930024.17.0.00462396415924.issue26643@psf.upfronthosting.co.za> Message-ID: <1458948232.63.0.379832535947.issue26643@psf.upfronthosting.co.za> STINNER Victor added the comment: > Consider your example with the 'sys.path' resource. With current code I need to understand only 3 simple lines of the code in two close methods. With the patch I need to research 4 classes with 16 complicated methods! This is awful! I replaced get_sys_path()/restore_sys_path() (2 methods) with ModuleAttr.get()+ModuleAttrList.encode_value() / ModuleAttr.restore()+ModuleAttrList.restore_attr() (4 methods). I want to factorize the code to limit duplicated code. My use case is that I want to see what changed when I get the "test xxx changed yyy" error. For sys.path, ModuleAttrList.decode_value() helps to get a nicer output since you only display 1 list instead of the (id, list, list_copy) tuple. How do you suggest to enhance the existing code to get such nicer output? > Now about using __subclasses__(). Is it guarantied that the order of classes in __subclasses__() is the same as the order of declaration and always will be? No, it looks random. > The order of restoring resources matters. I'm not sure that it's a good thing to have dependencies between "resources". I see that Files depends on Cwd, but maybe the Files check can be integrated into Cwd? Ok so the order matters, in this case, I can use a metaclass to use the order of class definition. It will make get_resources() simpler, it will be build directly in the metaclass. > For now if there is needed to change the order of restoring resources (I'm sure there will be need to do this in future) you need to change only one or two lines. With your patch you need to reorder classes declarations. Yes. Is it really an issue? I only see two resources that have a dependency (Files and Cwd). It's not like this file is modified regulary. > Nicer diff for dictionaries can be an enhancement, but it can be implemented without such large rewriting. How do you want to implement that? Currently, a resource has a "get" method which returns a blackbox. It's not easy to display it. There is not standard format. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 19:28:43 2016 From: report at bugs.python.org (STINNER Victor) Date: Fri, 25 Mar 2016 23:28:43 +0000 Subject: [issue25289] test_strptime hangs sometimes on AMD64 Windows7 SP1 3.x buildbot In-Reply-To: <1443704109.85.0.472487491984.issue25289@psf.upfronthosting.co.za> Message-ID: <1458948523.14.0.61309842602.issue25289@psf.upfronthosting.co.za> STINNER Victor added the comment: It looks like the issue was a bug in setlocale() and that it was fixed in Windows! See the issue #26624. ---------- resolution: -> duplicate status: open -> closed superseder: -> Windows hangs in call to CRT setlocale() _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 19:28:59 2016 From: report at bugs.python.org (STINNER Victor) Date: Fri, 25 Mar 2016 23:28:59 +0000 Subject: [issue26624] Windows hangs in call to CRT setlocale() In-Reply-To: <1458747871.12.0.710719467032.issue26624@psf.upfronthosting.co.za> Message-ID: <1458948539.66.0.954937956606.issue26624@psf.upfronthosting.co.za> STINNER Victor added the comment: The issue #25289 has marked as a duplicate of this issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 19:29:43 2016 From: report at bugs.python.org (STINNER Victor) Date: Fri, 25 Mar 2016 23:29:43 +0000 Subject: [issue26624] Windows hangs in call to CRT setlocale() In-Reply-To: <1458747871.12.0.710719467032.issue26624@psf.upfronthosting.co.za> Message-ID: <1458948583.43.0.304237173187.issue26624@psf.upfronthosting.co.za> STINNER Victor added the comment: > It's been fixed, just figuring out when the update will be available, or how to get it if it already is. Can you elaborate? What was the bug? How was it fixed? Is it a bug in Windows, in Visual Studio or in the C library? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 19:31:57 2016 From: report at bugs.python.org (STINNER Victor) Date: Fri, 25 Mar 2016 23:31:57 +0000 Subject: [issue25276] Intermittent segfaults on PPC64 AIX 3.x In-Reply-To: <1443605165.97.0.433720501229.issue25276@psf.upfronthosting.co.za> Message-ID: <1458948717.65.0.828026447456.issue25276@psf.upfronthosting.co.za> STINNER Victor added the comment: The origin of the crash is unknown. Since I didn't see the crash recently, I close the issue. ---------- resolution: -> out of date status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 19:33:09 2016 From: report at bugs.python.org (STINNER Victor) Date: Fri, 25 Mar 2016 23:33:09 +0000 Subject: [issue25256] Add sys.debug_build public variable to check if Python was compiled in debug mode In-Reply-To: <1443446100.69.0.307482207939.issue25256@psf.upfronthosting.co.za> Message-ID: <1458948789.32.0.186456501855.issue25256@psf.upfronthosting.co.za> STINNER Victor added the comment: I lost interest in this issue. It really looks like a corner case, so I prefer to keep the current code. I'm not interested to work on the abiflags on Windows. ---------- resolution: -> out of date status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 19:34:52 2016 From: report at bugs.python.org (J Osell) Date: Fri, 25 Mar 2016 23:34:52 +0000 Subject: [issue26631] Unable to install Python 3.5.1 on Windows 10 - Error 0x80070643: Failed to install MSI package. In-Reply-To: <1458771798.71.0.333968276616.issue26631@psf.upfronthosting.co.za> Message-ID: <1458948892.23.0.799849761426.issue26631@psf.upfronthosting.co.za> Changes by J Osell : Added file: http://bugs.python.org/file42294/Python 3.5.1 (64-bit)_20160323181333_000_core_JustForMe.log _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 19:35:34 2016 From: report at bugs.python.org (J Osell) Date: Fri, 25 Mar 2016 23:35:34 +0000 Subject: [issue26631] Unable to install Python 3.5.1 on Windows 10 - Error 0x80070643: Failed to install MSI package. In-Reply-To: <1458926632.72.0.412563731431.issue26631@psf.upfronthosting.co.za> Message-ID: <0ea001d186ef$023134e0$06939ea0$@com> J Osell added the comment: Done ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 19:36:34 2016 From: report at bugs.python.org (STINNER Victor) Date: Fri, 25 Mar 2016 23:36:34 +0000 Subject: [issue25160] Stop using deprecated imp module; imp should now emit a real DeprecationWarning In-Reply-To: <1442559979.71.0.954965412351.issue25160@psf.upfronthosting.co.za> Message-ID: <1458948993.99.0.0389117070856.issue25160@psf.upfronthosting.co.za> STINNER Victor added the comment: > Tools/i18n/pygettext.py:159:import imp I opened the issue #26639 for it. >> Python/makeopcodetargets.py:9:import imp > See issue 20021. I pushed the change f682b620c64d but I forgot about the issue #20021. Let's discuss there about this script. > Tools/importbench/importbench.py:10:import imp I think that it's fine to keep imp there. > Lib/modulefinder.py:14: import imp This one requires more work than the other. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 19:36:50 2016 From: report at bugs.python.org (STINNER Victor) Date: Fri, 25 Mar 2016 23:36:50 +0000 Subject: [issue25160] Stop using deprecated imp module; imp should now emit a real DeprecationWarning In-Reply-To: <1442559979.71.0.954965412351.issue25160@psf.upfronthosting.co.za> Message-ID: <1458949010.7.0.370079023682.issue25160@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- nosy: +eric.snow _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 19:42:06 2016 From: report at bugs.python.org (STINNER Victor) Date: Fri, 25 Mar 2016 23:42:06 +0000 Subject: [issue22218] Fix more compiler warnings "comparison between signed and unsigned integers" In-Reply-To: <1408296679.77.0.83853794909.issue22218@psf.upfronthosting.co.za> Message-ID: <1458949326.27.0.413003414862.issue22218@psf.upfronthosting.co.za> STINNER Victor added the comment: fix_warning_unicodeobject.diff and issue22218-2.patch don't seem to be needed anymore. The code is now: if (PY_SSIZE_T_MAX / (Py_ssize_t)sizeof(wchar_t) < (size + 1)) return NULL; I close the issue. More specific issues must be opened if you still want to fix similar issues. ---------- resolution: -> fixed status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 19:51:05 2016 From: report at bugs.python.org (STINNER Victor) Date: Fri, 25 Mar 2016 23:51:05 +0000 Subject: [issue26391] typing: Specialized sub-classes of Generic never call __init__ In-Reply-To: <1455882742.53.0.118642694532.issue26391@psf.upfronthosting.co.za> Message-ID: <1458949865.93.0.315101301589.issue26391@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- title: Specialized sub-classes of Generic never call __init__ -> typing: Specialized sub-classes of Generic never call __init__ _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 19:52:52 2016 From: report at bugs.python.org (STINNER Victor) Date: Fri, 25 Mar 2016 23:52:52 +0000 Subject: [issue23886] faulthandler_user should use _PyThreadState_Current In-Reply-To: <1428480184.73.0.0889790949933.issue23886@psf.upfronthosting.co.za> Message-ID: <1458949972.95.0.357618776235.issue23886@psf.upfronthosting.co.za> STINNER Victor added the comment: > I want that it marks the current Python thread correctly, and not the current sighandler thread. Oooooook, I finally understood your use case. You want to know which threads hold the GIL. You don't care which thread got the signal. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 19:54:06 2016 From: report at bugs.python.org (Martin Panter) Date: Fri, 25 Mar 2016 23:54:06 +0000 Subject: [issue19829] _pyio.BufferedReader and _pyio.TextIOWrapper destructor don't emit ResourceWarning if the file is not closed In-Reply-To: <1385721421.95.0.384748799117.issue19829@psf.upfronthosting.co.za> Message-ID: <1458950046.18.0.97162525563.issue19829@psf.upfronthosting.co.za> Martin Panter added the comment: In the long term, I prefer not calling close() in __del__(), like del-flush.patch, although I admit it is an API change and should probably be limited to 3.6+. If people want to improve things in 3.5, privately implementing _dealloc_warn() like Victor?s pyio_res_warn-3.patch seems the best option. Serhiy: why did you add 2.7 to this bug? For 2.7, I don?t think anything should be done. There is no ResourceWarning in 2.7. In 3.5, _dealloc_warn() could also be implemented in SocketIO (possibly also HTTPResponse, GzipFile, etc). But it should not become a public API, and I don?t think it is important to make this sort of change to 3.5 anyway. In 3.6, if we stopped __del__() from calling close() like del-flush.patch, we would be changing the documented behaviour: says ?IOBase . . . calls the instance?s close() method.? But the end result seems cleaner to me. I think changing or adding an API (__del__, _dealloc_warn, etc) is necessary for a general solution to the problem. The effect of del-flush.patch will be that a wrapped FileIO or similar object will not be closed until all references are deleted. >>> file = open(os.devnull, "wb", 0) >>> print(file) <_io.FileIO name='/dev/null' mode='wb' closefd=True> >>> wrapper = BufferedWriter(file) In 3.5, deleting the wrapper produces a warning and closes the underlying file: >>> del wrapper __main__:1: ResourceWarning: unclosed file <_io.BufferedWriter name='/dev/null'> >>> print(file) <_io.FileIO [closed]> >>> file.write(b"more data") Traceback (most recent call last): File "", line 1, in ValueError: I/O operation on closed file I propose that in 3.6, deleting a wrapper should not automatically close or warn about the wrapped object until all references are deleted: >>> del wrapper # No problem; we still have a reference to "file" >>> file.write(b"more data") # File is still open 9 >>> del file # Finally closes the file and triggers the warning ResourceWarning: unclosed file ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 20:05:08 2016 From: report at bugs.python.org (Roundup Robot) Date: Sat, 26 Mar 2016 00:05:08 +0000 Subject: [issue20021] "modernize" makeopcodetargets.py In-Reply-To: <1387426285.76.0.769422966502.issue20021@psf.upfronthosting.co.za> Message-ID: <20160326000505.34042.62487.CADFDB81@psf.io> Roundup Robot added the comment: New changeset 6ceceb052394 by Victor Stinner in branch 'default': makeopcodetargets.py: we need to import Lib/opcode.py https://hg.python.org/cpython/rev/6ceceb052394 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 20:06:24 2016 From: report at bugs.python.org (STINNER Victor) Date: Sat, 26 Mar 2016 00:06:24 +0000 Subject: [issue20021] "modernize" makeopcodetargets.py In-Reply-To: <1387426285.76.0.769422966502.issue20021@psf.upfronthosting.co.za> Message-ID: <1458950784.8.0.693905890727.issue20021@psf.upfronthosting.co.za> STINNER Victor added the comment: > Or does it matter to be able to use an external python program? Oh wait, I misunderstood how the script is used. I understood that the script must be run manually only when a new opcode is added and so is rarely used and only used with the built Python program. In fact, the script is part of the build process! I completely missed that, sorry. I searched how it was used but I missed the build process. So yes, it matters to support Python 2 and Python 3 in Python/makeopcodetargets.py. I pushed Serhiy's patch issue20021_2.diff. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 20:10:45 2016 From: report at bugs.python.org (STINNER Victor) Date: Sat, 26 Mar 2016 00:10:45 +0000 Subject: [issue22898] segfault during shutdown attempting to log ResourceWarning In-Reply-To: <1416345976.57.0.643107529371.issue22898@psf.upfronthosting.co.za> Message-ID: <1458951045.55.0.768901770093.issue22898@psf.upfronthosting.co.za> STINNER Victor added the comment: warn_5.patch: The patch cannot be reviewed on Rietveld :-( You must not use the git format for diff. warn_5.patch: "if (globals == NULL) { (...) return 0; }" It looks like filename is not initialized. I suggest to use: *filename = f->f_code->co_filename; It looks like you have to add: if (PyUnicode_Check(*filename)) *filename = NULL; To mimick the code below. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 20:12:48 2016 From: report at bugs.python.org (STINNER Victor) Date: Sat, 26 Mar 2016 00:12:48 +0000 Subject: [issue25911] Regression: os.walk now using os.scandir() breaks bytes filenames on windows In-Reply-To: <1450539578.39.0.976654454489.issue25911@psf.upfronthosting.co.za> Message-ID: <1458951168.09.0.876910006738.issue25911@psf.upfronthosting.co.za> STINNER Victor added the comment: Update: test_os pass on all Windows buildbots except one! I don't understand why the test fails on this buildbot. http://buildbot.python.org/all/builders/AMD64%20Windows8%203.x/builds/1906/steps/test/logs/stdio ====================================================================== FAIL: test_walk_bottom_up (test.test_os.BytesWalkTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "D:\buildarea\3.x.bolen-windows8\build\lib\test\test_os.py", line 895, in test_walk_bottom_up self.assertEqual(len(all), 4) AssertionError: 5 != 4 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 20:13:02 2016 From: report at bugs.python.org (Roundup Robot) Date: Sat, 26 Mar 2016 00:13:02 +0000 Subject: [issue25911] Regression: os.walk now using os.scandir() breaks bytes filenames on windows In-Reply-To: <1450539578.39.0.976654454489.issue25911@psf.upfronthosting.co.za> Message-ID: <20160326001253.12230.589.DA732CF2@psf.io> Roundup Robot added the comment: New changeset 82da02b5bf22 by Victor Stinner in branch 'default': Issue #25911: more info on test_os failure https://hg.python.org/cpython/rev/82da02b5bf22 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 20:13:55 2016 From: report at bugs.python.org (Albert Zeyer) Date: Sat, 26 Mar 2016 00:13:55 +0000 Subject: [issue23886] faulthandler_user should use _PyThreadState_Current In-Reply-To: <1428480184.73.0.0889790949933.issue23886@psf.upfronthosting.co.za> Message-ID: <1458951235.27.0.732627449305.issue23886@psf.upfronthosting.co.za> Albert Zeyer added the comment: Yes exactly. Sorry if I was unclear before. :) I mentioned SIGUSR1/2 because for a segfault, the signal handler will usually be executed in the same thread (although I'm not sure if that is guaranteed), so that was usually not a problem. But I used SIGUSR1 when my Python application is hanging and esp in that case I would like to know the current Python active thread. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 20:27:53 2016 From: report at bugs.python.org (Guido van Rossum) Date: Sat, 26 Mar 2016 00:27:53 +0000 Subject: [issue26391] typing: Specialized sub-classes of Generic never call __init__ In-Reply-To: <1455882742.53.0.118642694532.issue26391@psf.upfronthosting.co.za> Message-ID: <1458952073.92.7.31417212008e-06.issue26391@psf.upfronthosting.co.za> Guido van Rossum added the comment: Actually, I just realized why this is. Generic.__new__() calls next_in_mro.__new__(_gorg(cls)). Here next_in_mro is just object, but _gorg(cls) is Foo, in the case where cls is Bar (i.e. Foo[str]). The _gorg() call strips the [str] part of the type. So far so good. Where it gets interesting is that, in general in Python, whenever __new__(cls, ...) returns an object whose class is not cls, it is presumed to be an already properly initialized object! I think I can fix this by calling __init__() explicitly in the case where _gorg(cls) is not cls. The reason, BTW, why it strips the [str] part of the class is because that's what PEP 484 says, in the same section where it says that Node[T]() and Node[int]() are allowed: > At runtime the type is not preserved, and the class of ``x`` is just > ``Node`` in all cases. So this bit of code is trying to do the right thing but obviously hasn't been tested much, because mypy disallows that syntax. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 20:51:24 2016 From: report at bugs.python.org (Martin Panter) Date: Sat, 26 Mar 2016 00:51:24 +0000 Subject: [issue26612] test_ssl: use context manager (with) to fix ResourceWarning In-Reply-To: <1458694066.07.0.537208093993.issue26612@psf.upfronthosting.co.za> Message-ID: <1458953484.6.0.717888282467.issue26612@psf.upfronthosting.co.za> Martin Panter added the comment: In many cases I prefer ?with? over ?try / finally?. But Python 2?s sockets do not support ?with? statements, so choice (2) is not possible for 2.7. I found one potential technical problem, and maybe some redundant close() calls in the review. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 21:02:51 2016 From: report at bugs.python.org (Martin Panter) Date: Sat, 26 Mar 2016 01:02:51 +0000 Subject: [issue25951] SSLSocket.sendall() does not return None on success like socket.sendall() In-Reply-To: <1451054715.95.0.578529633079.issue25951@psf.upfronthosting.co.za> Message-ID: <1458954171.52.0.161221213579.issue25951@psf.upfronthosting.co.za> Martin Panter added the comment: Thanks for your work Aviv. This version looks good to me. ---------- versions: -Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 21:31:45 2016 From: report at bugs.python.org (Martin Panter) Date: Sat, 26 Mar 2016 01:31:45 +0000 Subject: [issue25654] test_multiprocessing_spawn ResourceWarning with -Werror In-Reply-To: <1447830828.22.0.981390741581.issue25654@psf.upfronthosting.co.za> Message-ID: <1458955905.02.0.273651569612.issue25654@psf.upfronthosting.co.za> Martin Panter added the comment: Sorry, but I don?t think I have the time/motivation/expertise to look into the fix in detail. But there are no warnings or failures anymore when I use -Werror, so I am happy! BTW the spurious background processes are still there (visible if you run ?ps? or ?pstree? immediately after the test finishes), but they no longer print errors. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 21:38:47 2016 From: report at bugs.python.org (Guido van Rossum) Date: Sat, 26 Mar 2016 01:38:47 +0000 Subject: [issue25987] collections.abc.Reversible In-Reply-To: <1451685633.1.0.273350637631.issue25987@psf.upfronthosting.co.za> Message-ID: <1458956327.64.0.705834332039.issue25987@psf.upfronthosting.co.za> Guido van Rossum added the comment: Andrew, did you lose interest in this? We now have a PR for typing.py that expects this to be resolved: https://github.com/python/typing/pull/194 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 23:34:54 2016 From: report at bugs.python.org (Martin Panter) Date: Sat, 26 Mar 2016 03:34:54 +0000 Subject: [issue23735] Readline not adjusting width after resize with 6.3 In-Reply-To: <1426984974.32.0.405944458303.issue23735@psf.upfronthosting.co.za> Message-ID: <1458963294.26.0.880964449729.issue23735@psf.upfronthosting.co.za> Martin Panter added the comment: Unfortunately, yes I think another test might be needed in configure.ac, unless you can piggy-back on one of the existing flags. One more thing that I thought of: Looking at the main Python signal handler, it reinstalls itself, see . This is apparently because handlers installed by Posix signal() might be only called once. But if the handler was installed by sigaction(), it should not be reinstalled. Should our SIGWINCH handler do something similar? ---------- versions: +Python 3.6 -Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 26 01:18:26 2016 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 26 Mar 2016 05:18:26 +0000 Subject: [issue23551] IDLE to provide menu link to PIP gui. In-Reply-To: <1425155752.55.0.0736033483828.issue23551@psf.upfronthosting.co.za> Message-ID: <1458969506.23.0.283639702466.issue23551@psf.upfronthosting.co.za> Terry J. Reedy added the comment: gohlke/pythonlibs/: Search will have to use a custom function. If direct download from url by pip does not work, then we write a custom function to download to a temp file and pip install from local file. (This is suggestion on site.) runpip: It would be nice if import and main(...) could be made to work by reloading the module (to refresh the cache), but if not, subprocess should work as a backup. Having 'run pip command' encapsulated makes it easy to switch without affecting the rest of the code. Additional features: Raymond's list is not a firm cutoff. I an not sure what a 'proxy' is in this context and have no sense of what will be useful, especially to beginners, rather than clutter. But I am willing to be educated and persuaded. And there are other people, including a second mentor for this project, who can give opinions. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 26 01:24:42 2016 From: report at bugs.python.org (Steve Dower) Date: Sat, 26 Mar 2016 05:24:42 +0000 Subject: [issue26624] Windows hangs in call to CRT setlocale() In-Reply-To: <1458747871.12.0.710719467032.issue26624@psf.upfronthosting.co.za> Message-ID: <1458969882.31.0.951673599139.issue26624@psf.upfronthosting.co.za> Steve Dower added the comment: Locking inversion I think, I don't have the bug details handy. The fix went out over Windows Update recently, but that's only for the release version of the runtime. The fixed debug version should have been installed with VS 2015 Update 1. However, since it's still occurring on Jeremy's machine, it may not actually be the same bug. Checking the file version of ucrtbased.dll will help, but I can't verify the exact certain until Monday. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 26 02:14:05 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 26 Mar 2016 06:14:05 +0000 Subject: [issue25911] Regression: os.walk now using os.scandir() breaks bytes filenames on windows In-Reply-To: <1450539578.39.0.976654454489.issue25911@psf.upfronthosting.co.za> Message-ID: <1458972845.79.0.338969984968.issue25911@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Some tests were failed on Windows 8 even in 3.4 (issue23808). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 26 02:30:27 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 26 Mar 2016 06:30:27 +0000 Subject: [issue20021] "modernize" makeopcodetargets.py In-Reply-To: <1387426285.76.0.769422966502.issue20021@psf.upfronthosting.co.za> Message-ID: <1458973827.53.0.277443343307.issue20021@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Thank you Victor. ---------- resolution: -> fixed stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 26 02:59:44 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 26 Mar 2016 06:59:44 +0000 Subject: [issue19829] _pyio.BufferedReader and _pyio.TextIOWrapper destructor don't emit ResourceWarning if the file is not closed In-Reply-To: <1385721421.95.0.384748799117.issue19829@psf.upfronthosting.co.za> Message-ID: <1458975584.35.0.496380367141.issue19829@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: > Serhiy: why did you add 2.7 to this bug? For 2.7, I don?t think anything should be done. There is no ResourceWarning in 2.7. Just for the case. Not calling close() in __del__() is one option, and it looks attractive. But there are possible hidden catches. There is no guarantee that flush() writes all buffered data, some stateful encoder or compressor can left some data in the buffer unless explicitly closed. close() can write required footer or close connection. If not call close() in __del__(), GzipFile will produce incorrect file. May be this is appropriate. This is why explicit close() should be called or context manager should be used. Other option is to use some API through all closable objects. _dealloc_warn() is not the only option. 1. Add an optional parameter to close() methods to denote that it is called from __del__. This is backward incompatible option, it is too late to do this. 2. __del__() calls special method instead of close() if exists. 3. The _dealloc_warn() option (the name should be changed). The wrapper delegates emitting a warning to wrapped object by calling the _dealloc_warn() method if exists. Unlike to previous option this method is called in addition to close(), not instead. 4. The wrapper checks special attribute (or calls a method) of wrapped object. If it exists and is true, the wrapper emits a warning. ---------- nosy: +benjamin.peterson, stutzbach versions: -Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 26 03:28:02 2016 From: report at bugs.python.org (Martin Panter) Date: Sat, 26 Mar 2016 07:28:02 +0000 Subject: [issue26644] SSLSocket.recv(-1) triggers SystemError Message-ID: <1458977282.91.0.0462711735469.issue26644@psf.upfronthosting.co.za> New submission from Martin Panter: SystemError indicates an internal error that is not supposed to be triggerable from Python code. We should probably raise ValueError like plain sockets instead. >>> s = create_connection(("python.org", 443)) >>> s.recv(-1) Traceback (most recent call last): File "", line 1, in ValueError: negative buffersize in recv >>> ss = ssl.wrap_socket(s) >>> ss.recv(-1) Traceback (most recent call last): File "", line 1, in File "/home/proj/python/cpython/Lib/ssl.py", line 910, in recv return self.read(buflen) File "/home/proj/python/cpython/Lib/ssl.py", line 787, in read return self._sslobj.read(len, buffer) File "/home/proj/python/cpython/Lib/ssl.py", line 573, in read v = self._sslobj.read(len or 1024) SystemError: Negative size passed to PyBytes_FromStringAndSize ---------- components: Extension Modules messages: 262488 nosy: martin.panter priority: normal severity: normal status: open title: SSLSocket.recv(-1) triggers SystemError type: behavior versions: Python 2.7, Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 26 04:03:15 2016 From: report at bugs.python.org (Martin Panter) Date: Sat, 26 Mar 2016 08:03:15 +0000 Subject: [issue26644] SSLSocket.recv(-1) triggers SystemError In-Reply-To: <1458977282.91.0.0462711735469.issue26644@psf.upfronthosting.co.za> Message-ID: <1458979395.23.0.768768411651.issue26644@psf.upfronthosting.co.za> Martin Panter added the comment: Proposed patch ---------- keywords: +patch stage: -> patch review Added file: http://bugs.python.org/file42295/ssl-negative.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 26 04:58:52 2016 From: report at bugs.python.org (Ivan Levkivskyi) Date: Sat, 26 Mar 2016 08:58:52 +0000 Subject: [issue25987] collections.abc.Reversible In-Reply-To: <1451685633.1.0.273350637631.issue25987@psf.upfronthosting.co.za> Message-ID: <1458982732.3.0.813585281653.issue25987@psf.upfronthosting.co.za> Changes by Ivan Levkivskyi : ---------- nosy: +levkivskyi _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 26 04:59:27 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 26 Mar 2016 08:59:27 +0000 Subject: [issue26643] regrtest: rework libregrtest.save_env submodule In-Reply-To: <1458930024.17.0.00462396415924.issue26643@psf.upfronthosting.co.za> Message-ID: <1458982767.13.0.310761498428.issue26643@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: > I replaced get_sys_path()/restore_sys_path() (2 methods) with ModuleAttr.get()+ModuleAttrList.encode_value() / ModuleAttr.restore()+ModuleAttrList.restore_attr() (4 methods). I need to examine all other methods scattered around just to conclude that they are overloaded and aren't used indirectly. Imagine that you are reading the code first time and need to know only about one resource. Three lines in two methods are much simpler then hundreds lines scattered in tens of methods. > I'm not sure that it's a good thing to have dependencies between "resources". I see that Files depends on Cwd, but maybe the Files check can be integrated into Cwd? I'm not sure that there are only two depended resources. In any case deterministic behavior is better. It is very unhappy to to research random test failures. > Ok so the order matters, in this case, I can use a metaclass to use the order of class definition. It will make get_resources() simpler, it will be build directly in the metaclass. No-no-no. Please don't complicate the code just because you can. This will make reading and modifying the code yet harder. > How do you want to implement that? Currently, a resource has a "get" method which returns a blackbox. It's not easy to display it. There is not standard format. There is a number of ways. 1. Just write smart general diff reporter as in unittest. It's Python, use force^W data reflection! 2. Add third method for resources that need special diff reporting. Use simple general diff reporter by default. 3. Split the "sys.path" resource on two simple resources: one test that sys.path identity is not changed, other tests it's content. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 26 05:19:02 2016 From: report at bugs.python.org (Rob la Lau) Date: Sat, 26 Mar 2016 09:19:02 +0000 Subject: [issue11245] Implementation of IMAP IDLE in imaplib? In-Reply-To: <1298061371.03.0.0638918089315.issue11245@psf.upfronthosting.co.za> Message-ID: <1458983942.81.0.148955845666.issue11245@psf.upfronthosting.co.za> Changes by Rob la Lau : ---------- nosy: +ohreally _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 26 08:05:01 2016 From: report at bugs.python.org (Alexey Muranov) Date: Sat, 26 Mar 2016 12:05:01 +0000 Subject: [issue26645] argparse prints help messages to stdout instead of stderr by default Message-ID: <1458993901.75.0.219308453251.issue26645@psf.upfronthosting.co.za> New submission from Alexey Muranov: I believe that printing help and usage messages to stdout is a design error. In stdout i expect to find the output of my program, not help or diagnostic messages. It is strange to see nothing printed on the screen (where stderr usually goes), and then to find help, usage, or *error* messages in the file where stdout was sent. (Yes, argparse prints even error messages to stdout by default). This issue has been discussed before because the implementation did not agree with the documentation: http://bugs.python.org/issue10728 I believe that the conclusion to adjust the documentation to the implementation was a mistake. P.S. Compare with the direction of the output of `grep -h` or `git -h`. ---------- components: Library (Lib) messages: 262491 nosy: Alexey Muranov priority: normal severity: normal status: open title: argparse prints help messages to stdout instead of stderr by default type: behavior versions: Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 26 08:14:21 2016 From: report at bugs.python.org (SilentGhost) Date: Sat, 26 Mar 2016 12:14:21 +0000 Subject: [issue26645] argparse prints help messages to stdout instead of stderr by default In-Reply-To: <1458993901.75.0.219308453251.issue26645@psf.upfronthosting.co.za> Message-ID: <1458994461.45.0.841171231938.issue26645@psf.upfronthosting.co.za> Changes by SilentGhost : ---------- nosy: +bethard versions: +Python 3.6 -Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 26 12:20:04 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 26 Mar 2016 16:20:04 +0000 Subject: [issue26645] argparse prints help messages to stdout instead of stderr by default In-Reply-To: <1458993901.75.0.219308453251.issue26645@psf.upfronthosting.co.za> Message-ID: <1459009204.26.0.427356272966.issue26645@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: `grep --help` outputs to stdout. `grep -h` outputs to stderr, because this is error, there is no the `-h` flag. The same for git and most other command line tools. argparse follows this behavior. There is no bug. ---------- nosy: +serhiy.storchaka resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 26 13:33:45 2016 From: report at bugs.python.org (Wolfgang Langner) Date: Sat, 26 Mar 2016 17:33:45 +0000 Subject: [issue26587] Possible duplicate entries in sys.path if .pth files are used with zip's In-Reply-To: <1458296580.88.0.236395091392.issue26587@psf.upfronthosting.co.za> Message-ID: <1459013625.52.0.419291684069.issue26587@psf.upfronthosting.co.za> Wolfgang Langner added the comment: Ok, I implemented point 3. Check if it is a dir or file and makepath only in this case. All other entries are added unmodified to the set. Added a test case also for an URL path. I think duplicate detection is now improved and it should break nothing. ---------- Added file: http://bugs.python.org/file42296/site2.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 26 13:57:38 2016 From: report at bugs.python.org (Xavier de Gaye) Date: Sat, 26 Mar 2016 17:57:38 +0000 Subject: [issue22898] segfault during shutdown attempting to log ResourceWarning In-Reply-To: <1416345976.57.0.643107529371.issue22898@psf.upfronthosting.co.za> Message-ID: <1459015058.75.0.118909301949.issue22898@psf.upfronthosting.co.za> Xavier de Gaye added the comment: Victor, With warn_5.patch *filename is not set when globals is NULL: setup_context() returns 0, and so do_warn() returns NULL without calling warn_explicit(). This is different from your initial warn.patch where setup_context() returns 1 in that case and an attempt is made to issue the warning. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 26 14:26:11 2016 From: report at bugs.python.org (Brett Cannon) Date: Sat, 26 Mar 2016 18:26:11 +0000 Subject: [issue26587] Possible duplicate entries in sys.path if .pth files are used with zip's In-Reply-To: <1458296580.88.0.236395091392.issue26587@psf.upfronthosting.co.za> Message-ID: <1459016771.85.0.231009136357.issue26587@psf.upfronthosting.co.za> Changes by Brett Cannon : ---------- assignee: -> brett.cannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 26 16:20:28 2016 From: report at bugs.python.org (Daniel Shaulov) Date: Sat, 26 Mar 2016 20:20:28 +0000 Subject: [issue26646] Allow built-in module in package Message-ID: <1459023628.39.0.77878937212.issue26646@psf.upfronthosting.co.za> New submission from Daniel Shaulov: Hi, I was trying to build a python interpreter that has the cpp part of msgpack as a built-in module. I thought that I could just copy the msgpack folder to the Modules folder and add this 2 lines to Modules/Setup.local: msgpack._packer msgpack/_packer.cpp msgpack._unpacker msgpack/_unpacker.cpp I had a few obstacles, the attached patch fixes them all. The first - makesetup has a list of regexes to match and it has *.* after going through all known extensions to throw a "bad word" error. I removed the check. All those things will now be assumed to be a module with a package. Now the actual init function name is PyInit__packer and doesn't have msgpack in it, so I also added code in makesetup to use the full name as the name and only the module name for the PyInit function. The second is that in Lib/importlib/_bootsrap.py in BuiltinImporter.find_spec there is a specific case to ignore modules that are part of a package. Is there a reason to forbid it? I removed that check. There were also unit tests that checked this behavior which I deleted. I added tests that check module in package instead of them. Changing _bootsrap.py also changes Python/importlib.h (it is the frozen importlib), I added a separate patch with that change, to not clutter the main patch. The third - the __name__ didn't have the package prefix. Digging around I found a comment in PyModule_Create2 that says that the shared library loader stores the full name _Py_PackageContext before loading the module, so I did the same in _imp_create_builtin that is done in _PyImport_LoadDynamicModuleWithSpec to set _Py_PackageContext and the __name__ was fixed too. (If anyone tries to do this with msgpack and wants to see that it works - you also need to copy the msgpack directory to the Lib directory, and in __init__.py, where it catches the import error and goes to the fallback, just reraise the exception instead of letting it go to the fallback) Do note that this does not allow for built-in packages, only build-it module in package. If we want to allow built-in packages, we will need to decide on some syntax to distinguish it in the Setup files and some way to distinguish them in PyImport_Inittab (for example - an asterix before the name of the package?) Thanks, Daniel. ---------- components: Build, Interpreter Core files: builtin_package.patch keywords: patch messages: 262495 nosy: Daniel Shaulov, brett.cannon, eric.snow, ncoghlan priority: normal severity: normal status: open title: Allow built-in module in package type: enhancement versions: Python 3.6 Added file: http://bugs.python.org/file42297/builtin_package.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 26 16:26:37 2016 From: report at bugs.python.org (Daniel Shaulov) Date: Sat, 26 Mar 2016 20:26:37 +0000 Subject: [issue26646] Allow built-in module in package In-Reply-To: <1459023628.39.0.77878937212.issue26646@psf.upfronthosting.co.za> Message-ID: <1459023997.78.0.756358664709.issue26646@psf.upfronthosting.co.za> Changes by Daniel Shaulov : Added file: http://bugs.python.org/file42298/importlib_h.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 26 16:32:13 2016 From: report at bugs.python.org (Alexey Muranov) Date: Sat, 26 Mar 2016 20:32:13 +0000 Subject: [issue26645] argparse prints help messages to stdout instead of stderr by default In-Reply-To: <1458993901.75.0.219308453251.issue26645@psf.upfronthosting.co.za> Message-ID: <1459024333.81.0.114688995984.issue26645@psf.upfronthosting.co.za> Alexey Muranov added the comment: Thanks for the explanation, this makes sense. I did not notice that argparse outputs to stderr if command line arguments are wrong, i was probably wrong when said it prints error messages to stdout. I did not notice indeed that there were no `-h` option in git. However, my grep version 2.5.1-FreeBSD outputs help to stderr even with `--help` option. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 26 16:47:05 2016 From: report at bugs.python.org (Benjamin Peterson) Date: Sat, 26 Mar 2016 20:47:05 +0000 Subject: [issue26644] SSLSocket.recv(-1) triggers SystemError In-Reply-To: <1458977282.91.0.0462711735469.issue26644@psf.upfronthosting.co.za> Message-ID: <1459025225.61.0.309274900405.issue26644@psf.upfronthosting.co.za> Benjamin Peterson added the comment: Is this what other file-like objects do with negatives sizes? ---------- nosy: +benjamin.peterson _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 26 18:01:55 2016 From: report at bugs.python.org (Martin Panter) Date: Sat, 26 Mar 2016 22:01:55 +0000 Subject: [issue26644] SSLSocket.recv(-1) triggers SystemError In-Reply-To: <1458977282.91.0.0462711735469.issue26644@psf.upfronthosting.co.za> Message-ID: <1459029715.15.0.328006323459.issue26644@psf.upfronthosting.co.za> Martin Panter added the comment: Socket objects aren?t exactly file-like. Plain non-SSL sockets don?t even have read() methods. I think giving a meaning to recv(-1) would be an (unwanted) new feature, rather than a bug fix. If you want a file-like object linked to a socket, I would suggest using something like the makefile() method instead of adding to the low-level socket object API. But to answer your question: no, most file methods treat a negative size as a special request to read until EOF, e.g. read(-1), readline(-1) and readlines(-1) of RawIOBase, BufferedIOBase and TextIOBase. On the other hand, BufferedIOBase.read1(-1) is poorly defined and supported (Issue 23214), but may end up meaning something like ?read an arbitrary non-zero chunk with a minimum amount of low-level calls and processing?. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 26 18:05:41 2016 From: report at bugs.python.org (Benjamin Peterson) Date: Sat, 26 Mar 2016 22:05:41 +0000 Subject: [issue26644] SSLSocket.recv(-1) triggers SystemError In-Reply-To: <1459029715.15.0.328006323459.issue26644@psf.upfronthosting.co.za> Message-ID: <1459029938.416026.560483666.370A307E@webmail.messagingengine.com> Benjamin Peterson added the comment: Thanks for the explanation. Your patch lgtm. On Sat, Mar 26, 2016, at 15:01, Martin Panter wrote: > > Martin Panter added the comment: > > Socket objects aren?t exactly file-like. Plain non-SSL sockets don?t even > have read() methods. > > I think giving a meaning to recv(-1) would be an (unwanted) new feature, > rather than a bug fix. If you want a file-like object linked to a socket, > I would suggest using something like the makefile() method instead of > adding to the low-level socket object API. > > But to answer your question: no, most file methods treat a negative size > as a special request to read until EOF, e.g. read(-1), readline(-1) and > readlines(-1) of RawIOBase, BufferedIOBase and TextIOBase. On the other > hand, BufferedIOBase.read1(-1) is poorly defined and supported (Issue > 23214), but may end up meaning something like ?read an arbitrary non-zero > chunk with a minimum amount of low-level calls and processing?. > > ---------- > > _______________________________________ > Python tracker > > _______________________________________ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 26 19:07:14 2016 From: report at bugs.python.org (Martin Panter) Date: Sat, 26 Mar 2016 23:07:14 +0000 Subject: [issue26644] SSLSocket.recv(-1) triggers SystemError In-Reply-To: <1458977282.91.0.0462711735469.issue26644@psf.upfronthosting.co.za> Message-ID: <1459033634.0.0.220042512822.issue26644@psf.upfronthosting.co.za> Martin Panter added the comment: Thanks for the reviews. Here is a patch that avoids breaking read(-1, buffer). ---------- Added file: http://bugs.python.org/file42299/ssl-negative.v2.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 26 19:27:54 2016 From: report at bugs.python.org (Demur Rumed) Date: Sat, 26 Mar 2016 23:27:54 +0000 Subject: [issue26647] Wordcode Message-ID: <1459034868.93.0.159802163565.issue26647@psf.upfronthosting.co.za> New submission from Demur Rumed: Originally started @ https://github.com/abarnert/cpython/tree/wpy This patch is based off of https://github.com/serprex/cpython/tree/wpy It omits importlib.h & importlib_external.h as those are generated It omits https://github.com/serprex/cpython/blob/wpy/Python/wordcode.md I got around to benchmarking against building on master rather than using my repo's packaged version, it's currently a 1% speed improvement (every bit counts). I'm testing on an Intel Atom 330 with Linux. Besides the minor perf increase, it generates smaller bytecode & is simpler (peephole now handles EXTENDED_ARG since it isn't too hard to track & while loops become for loops in dis) Previous discussion: https://mail.python.org/pipermail/python-dev/2016-February/143357.html pdb works without changes. coverage.py doesn't seem to rely on anything this changes I modified byteplay to target this change mostly over the course of half an hour before work: https://github.com/serprex/byteplay/blob/master/wbyteplay.py I'd be interested to hear if this encoding simplifies things for FAT python & the recent work to cache attribute/global lookup Remaining code issues: peepholer could allocate half the space as it does now for basic block tracking, compile.c & peephole.c repeat themselves on computing instruction size given an argument & how to spit out an instruction given an argument Breaking change in dis: I've removed HAVE_ARGUMENT. This is to help code fail fast. It could be replaced with IGNORES_ARGUMENT or, as abarnert suggested, a range(90,256) named after the other hasXXXs 'hasarg' ---------- components: Interpreter Core files: wpy.patch keywords: patch messages: 262501 nosy: Demur Rumed priority: normal severity: normal status: open title: Wordcode type: performance versions: Python 3.6 Added file: http://bugs.python.org/file42300/wpy.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 26 20:45:05 2016 From: report at bugs.python.org (Philip Martin) Date: Sun, 27 Mar 2016 00:45:05 +0000 Subject: [issue26648] csv.reader Error message indicates to use deprecated Message-ID: <1459039505.55.0.691901894808.issue26648@psf.upfronthosting.co.za> New submission from Philip Martin: Currently, the error message: _csv.Error: new-line character seen in unquoted field - do you need to open the file in universal-newline mode? is cryptic in that universal line mode has been deprecated, and will not run in Python 3.5., i.e.: open(escape_path, "rU", encoding=ENCODING) >>> DeprecationWarning: 'U' mode is deprecated I think a message indicating a suggestion to open the file with newline='' to enable universal line mode is more insightful. ---------- messages: 262502 nosy: Philip Martin priority: normal severity: normal status: open title: csv.reader Error message indicates to use deprecated type: enhancement versions: Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 26 21:26:49 2016 From: report at bugs.python.org (Martin Panter) Date: Sun, 27 Mar 2016 01:26:49 +0000 Subject: [issue22854] Documentation/implementation out of sync for IO In-Reply-To: <1415804787.06.0.347049835041.issue22854@psf.upfronthosting.co.za> Message-ID: <1459042009.19.0.725907119731.issue22854@psf.upfronthosting.co.za> Martin Panter added the comment: Okay let?s document fileno(), read, write and seek operations in the base classes as raising OSError then. This effectively rejects the OP (Stanislaw?s) view that the exception should be more specific. In patch v3, I changed everything over to say OSError is raised. I also added a background thread to drain the pipe writer. And I removed a test_no_fileno() method which was having an ?existential crisis?. :) ---------- Added file: http://bugs.python.org/file42301/UnsupportedOperation.v3.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 26 22:17:51 2016 From: report at bugs.python.org (Roundup Robot) Date: Sun, 27 Mar 2016 02:17:51 +0000 Subject: [issue25940] SSL tests failed due to expired svn.python.org SSL certificate In-Reply-To: <1450990066.48.0.77725045299.issue25940@psf.upfronthosting.co.za> Message-ID: <20160327021748.39524.8826.2A1A067C@psf.io> Roundup Robot added the comment: New changeset 3da812602881 by Martin Panter in branch 'default': Issue #25940: Use internal local server more in test_ssl https://hg.python.org/cpython/rev/3da812602881 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 27 00:04:30 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 27 Mar 2016 04:04:30 +0000 Subject: [issue26644] SSLSocket.recv(-1) triggers SystemError In-Reply-To: <1458977282.91.0.0462711735469.issue26644@psf.upfronthosting.co.za> Message-ID: <1459051470.57.0.0354838696834.issue26644@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: LGTM. ---------- assignee: -> martin.panter nosy: +serhiy.storchaka stage: patch review -> commit review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 27 00:13:58 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 27 Mar 2016 04:13:58 +0000 Subject: [issue22854] Documentation/implementation out of sync for IO In-Reply-To: <1415804787.06.0.347049835041.issue22854@psf.upfronthosting.co.za> Message-ID: <1459052038.29.0.975409524064.issue22854@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: LGTM. ---------- assignee: -> martin.panter stage: patch review -> commit review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 27 00:22:18 2016 From: report at bugs.python.org (Martin Panter) Date: Sun, 27 Mar 2016 04:22:18 +0000 Subject: [issue25940] SSL tests failed due to expired svn.python.org SSL certificate In-Reply-To: <1450990066.48.0.77725045299.issue25940@psf.upfronthosting.co.za> Message-ID: <1459052538.26.0.737260669769.issue25940@psf.upfronthosting.co.za> Martin Panter added the comment: Okay so for the record, the maintainence branches were changed over from svn.python.org to self-signed.pythontest.net, and just now I changed the 3.6 branch to use a local server for most tests. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 27 00:40:59 2016 From: report at bugs.python.org (Eric Price) Date: Sun, 27 Mar 2016 04:40:59 +0000 Subject: [issue23735] Readline not adjusting width after resize with 6.3 In-Reply-To: <1426984974.32.0.405944458303.issue23735@psf.upfronthosting.co.za> Message-ID: <1459053659.16.0.396678030631.issue23735@psf.upfronthosting.co.za> Eric Price added the comment: Well, I could piggyback on the existing flags if I just wanted to support readline -- there are already two flags for readline 4.0 -- but if our real goal is to be compatible with editline, we probably need another flag. I think you're right that it should reinstall itself, in case it's installed using signal(). I've made a new patch that includes a config flag and puts everything inside the ifdefs. ---------- Added file: http://bugs.python.org/file42302/rl_sigwinch_version_3.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 27 01:25:45 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 27 Mar 2016 05:25:45 +0000 Subject: [issue26645] argparse prints help messages to stdout instead of stderr by default In-Reply-To: <1458993901.75.0.219308453251.issue26645@psf.upfronthosting.co.za> Message-ID: <1459056345.21.0.643783869704.issue26645@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Does FreeBSD grep support the `--help` option? Long options is GNU extension, classical UNIX commands supported only short options. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 27 01:54:40 2016 From: report at bugs.python.org (q20611152@163.com) Date: Sun, 27 Mar 2016 05:54:40 +0000 Subject: [issue26649] Fail update installation: 'utf-8' codec can't decode Message-ID: <1459058080.48.0.96946977004.issue26649@psf.upfronthosting.co.za> New submission from q20611152 at 163.com: This error occureed on the gns3 ; give you the errorlog files . ---------- files: gns3-errorlog messages: 262510 nosy: shanzhengcheng priority: normal severity: normal status: open title: Fail update installation: 'utf-8' codec can't decode versions: Python 3.5 Added file: http://bugs.python.org/file42303/gns3-errorlog _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 27 03:08:25 2016 From: report at bugs.python.org (SilentGhost) Date: Sun, 27 Mar 2016 07:08:25 +0000 Subject: [issue26647] Wordcode In-Reply-To: <1459034868.93.0.159802163565.issue26647@psf.upfronthosting.co.za> Message-ID: <1459062505.48.0.209383127187.issue26647@psf.upfronthosting.co.za> Changes by SilentGhost : ---------- nosy: +benjamin.peterson, brett.cannon, georg.brandl, ncoghlan, yselivanov _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 27 04:13:47 2016 From: report at bugs.python.org (SilentGhost) Date: Sun, 27 Mar 2016 08:13:47 +0000 Subject: [issue26648] csv.reader Error message indicates to use deprecated In-Reply-To: <1459039505.55.0.691901894808.issue26648@psf.upfronthosting.co.za> Message-ID: <1459066427.15.0.492286615316.issue26648@psf.upfronthosting.co.za> SilentGhost added the comment: While the 'U' mode has been deprecated it doesn't mean that your example doesn't run in 3.5 - it runs just fine and will keep doing so until 4.0 I'm attaching patch that suggests using newline=None (even though it's a default value for open), as that what seems to better correspond to the old 'U' mode. ---------- components: +Extension Modules keywords: +patch nosy: +SilentGhost, serhiy.storchaka stage: -> patch review type: enhancement -> behavior versions: +Python 3.6 -Python 3.5 Added file: http://bugs.python.org/file42304/issue26648.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 27 04:14:39 2016 From: report at bugs.python.org (SilentGhost) Date: Sun, 27 Mar 2016 08:14:39 +0000 Subject: [issue26649] Fail update installation: 'utf-8' codec can't decode In-Reply-To: <1459058080.48.0.96946977004.issue26649@psf.upfronthosting.co.za> Message-ID: <1459066479.73.0.898011228262.issue26649@psf.upfronthosting.co.za> Changes by SilentGhost : ---------- components: +Unicode nosy: +ezio.melotti, haypo type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 27 04:33:18 2016 From: report at bugs.python.org (Alexey Muranov) Date: Sun, 27 Mar 2016 08:33:18 +0000 Subject: [issue26645] argparse prints help messages to stdout instead of stderr by default In-Reply-To: <1458993901.75.0.219308453251.issue26645@psf.upfronthosting.co.za> Message-ID: <1459067598.26.0.186373217144.issue26645@psf.upfronthosting.co.za> Alexey Muranov added the comment: My grep man page says --help Print a brief help message. but indeed there is no `--help` in usage message. Maybe this is a bug of the man page. Thanks for the explanation. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 27 04:58:35 2016 From: report at bugs.python.org (STINNER Victor) Date: Sun, 27 Mar 2016 08:58:35 +0000 Subject: [issue26649] Fail update installation: 'utf-8' codec can't decode In-Reply-To: <1459066479.75.0.773526148491.issue26649@psf.upfronthosting.co.za> Message-ID: STINNER Victor added the comment: I din't know gns3 but it looks like a bug in gns3. You should report the bug there. You can use faulthandler to get the Python traceback. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 27 05:38:56 2016 From: report at bugs.python.org (Martijn Pieters) Date: Sun, 27 Mar 2016 09:38:56 +0000 Subject: [issue26650] calendar: OverflowErrors for year == 1 and firstweekday > 0 Message-ID: <1459071536.92.0.968744515291.issue26650@psf.upfronthosting.co.za> New submission from Martijn Pieters: For anything other than calendar.Calendar(0), many methods lead to OverflowError exceptions: >>> import calendar >>> c = calendar.Calendar(0) >>> list(c.itermonthdays(1, 1)) [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 0, 0, 0, 0] >>> c = calendar.Calendar(1) >>> list(c.itermonthdays(1, 1)) Traceback (most recent call last): File "", line 1, in File "/Users/mjpieters/Development/Library/buildout.python/parts/opt/lib/python2.7/calendar.py", line 188, in itermonthdays for date in self.itermonthdates(year, month): File "/Users/mjpieters/Development/Library/buildout.python/parts/opt/lib/python2.7/calendar.py", line 160, in itermonthdates date -= datetime.timedelta(days=days) OverflowError: date value out of range This echoes a similar problem with year = 9999, see issue #15421 ---------- components: Library (Lib) messages: 262514 nosy: mjpieters priority: normal severity: normal status: open title: calendar: OverflowErrors for year == 1 and firstweekday > 0 type: crash versions: Python 2.7, Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 27 06:38:02 2016 From: report at bugs.python.org (SilentGhost) Date: Sun, 27 Mar 2016 10:38:02 +0000 Subject: [issue26650] calendar: OverflowErrors for year == 1 and firstweekday > 0 In-Reply-To: <1459071536.92.0.968744515291.issue26650@psf.upfronthosting.co.za> Message-ID: <1459075082.34.0.58817530891.issue26650@psf.upfronthosting.co.za> SilentGhost added the comment: Here is the patch. Both this patch and the fix for #15421 might violate the documented behaviour of getting the full week's worth of dates. I wonder if that should also be documented. ---------- keywords: +patch nosy: +SilentGhost, rhettinger stage: -> patch review type: crash -> behavior versions: +Python 3.6 Added file: http://bugs.python.org/file42305/issue26650.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 27 06:41:34 2016 From: report at bugs.python.org (Roundup Robot) Date: Sun, 27 Mar 2016 10:41:34 +0000 Subject: [issue26644] SSLSocket.recv(-1) triggers SystemError In-Reply-To: <1458977282.91.0.0462711735469.issue26644@psf.upfronthosting.co.za> Message-ID: <20160327104131.12205.43218.9A2CFB08@psf.io> Roundup Robot added the comment: New changeset af92651c22e9 by Martin Panter in branch '3.5': Issue #26644: Raise ValueError for negative SSLSocket.recv() and read() https://hg.python.org/cpython/rev/af92651c22e9 New changeset b84d136e0028 by Martin Panter in branch '2.7': Issue #26644: Raise ValueError for negative SSLSocket.recv() and read() https://hg.python.org/cpython/rev/b84d136e0028 New changeset 80934ad2356d by Martin Panter in branch 'default': Issue #26644: Merge SSL negative read fix from 3.5 https://hg.python.org/cpython/rev/80934ad2356d ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 27 07:10:30 2016 From: report at bugs.python.org (Martin Panter) Date: Sun, 27 Mar 2016 11:10:30 +0000 Subject: [issue26648] csv.reader Error message indicates to use deprecated In-Reply-To: <1459039505.55.0.691901894808.issue26648@psf.upfronthosting.co.za> Message-ID: <1459077030.1.0.949597432074.issue26648@psf.upfronthosting.co.za> Martin Panter added the comment: Isn?t using newline=None a way to produce the error in the first place? Silent Ghost: see the footnote . Reading with newline=None translates newlines. Writing with newline=None produces CRLFs on Windows. I understand the CSV module wants neither of these translations, so it has full control of the code points. ---------- nosy: +martin.panter _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 27 07:25:15 2016 From: report at bugs.python.org (Martin Panter) Date: Sun, 27 Mar 2016 11:25:15 +0000 Subject: [issue23735] Readline not adjusting width after resize with 6.3 In-Reply-To: <1426984974.32.0.405944458303.issue23735@psf.upfronthosting.co.za> Message-ID: <1459077915.15.0.822288317304.issue23735@psf.upfronthosting.co.za> Martin Panter added the comment: I think this version is pretty good. I would move the signal restoring bit to the end of the handler (see review), and there is some funny indentation, but I can fix that up when I commit it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 27 07:29:15 2016 From: report at bugs.python.org (SilentGhost) Date: Sun, 27 Mar 2016 11:29:15 +0000 Subject: [issue26648] csv.reader Error message indicates to use deprecated In-Reply-To: <1459039505.55.0.691901894808.issue26648@psf.upfronthosting.co.za> Message-ID: <1459078155.34.0.0488666241324.issue26648@psf.upfronthosting.co.za> SilentGhost added the comment: Ah, the bit about csv module doing it's own newline handling is what I missed. Here is the updated patch. ---------- Added file: http://bugs.python.org/file42306/issue26648_2.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 27 07:34:39 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 27 Mar 2016 11:34:39 +0000 Subject: [issue26648] csv.reader Error message indicates to use deprecated In-Reply-To: <1459039505.55.0.691901894808.issue26648@psf.upfronthosting.co.za> Message-ID: <1459078479.4.0.32687546279.issue26648@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: When this error is triggered at all? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 27 09:09:12 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 27 Mar 2016 13:09:12 +0000 Subject: [issue25783] test_traceback.test_walk_stack() fails when run directly (without regrtest) In-Reply-To: <1449078273.26.0.535537969115.issue25783@psf.upfronthosting.co.za> Message-ID: <1459084152.91.0.0880389923238.issue25783@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Sorry, I meant different from current test and from previous patch. But it looks like what you were proposed. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 27 09:43:28 2016 From: report at bugs.python.org (Eric Price) Date: Sun, 27 Mar 2016 13:43:28 +0000 Subject: [issue23735] Readline not adjusting width after resize with 6.3 In-Reply-To: <1426984974.32.0.405944458303.issue23735@psf.upfronthosting.co.za> Message-ID: <1459086208.02.0.535139959389.issue23735@psf.upfronthosting.co.za> Eric Price added the comment: Hmm, I'm not seeing comments in the review? You're right about the order. When we don't have sigaction, python's signal handler will reinstall itself, so we need to reinstall this one after calling the old handler. ---------- Added file: http://bugs.python.org/file42307/rl_sigwinch_version_4.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 27 10:11:36 2016 From: report at bugs.python.org (Berker Peksag) Date: Sun, 27 Mar 2016 14:11:36 +0000 Subject: [issue24887] Sqlite3 has no option to provide open flags In-Reply-To: <1439898126.92.0.460778309784.issue24887@psf.upfronthosting.co.za> Message-ID: <1459087896.46.0.805869748866.issue24887@psf.upfronthosting.co.za> Berker Peksag added the comment: URI filename support has been added in f13bb1e40fbc (Python 3.4+). db = sqlite3.connect('file:path/to/database?mode=ro', uri=True) Here is a patch that adds a new flags parameter to sqlite3.connect(). ---------- dependencies: -Migrate sqlite3 module to _v2 API to enhance performance nosy: +berker.peksag stage: needs patch -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 27 10:13:53 2016 From: report at bugs.python.org (Berker Peksag) Date: Sun, 27 Mar 2016 14:13:53 +0000 Subject: [issue9303] Migrate sqlite3 module to _v2 API to enhance performance In-Reply-To: <1279541286.68.0.824716490463.issue9303@psf.upfronthosting.co.za> Message-ID: <1459088033.14.0.870921750768.issue9303@psf.upfronthosting.co.za> Changes by Berker Peksag : ---------- nosy: +berker.peksag type: performance -> enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 27 12:50:04 2016 From: report at bugs.python.org (Eric Khoo Jiun Hooi) Date: Sun, 27 Mar 2016 16:50:04 +0000 Subject: [issue23551] IDLE to provide menu link to PIP gui. In-Reply-To: <1425155752.55.0.0736033483828.issue23551@psf.upfronthosting.co.za> Message-ID: <1459097404.63.0.0560959791067.issue23551@psf.upfronthosting.co.za> Eric Khoo Jiun Hooi added the comment: @Terry, this is the code segment that I wrote to display the latest as you mention. Do give comment for improvement. ---------- Added file: http://bugs.python.org/file42308/pip_gui_v3.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 27 12:57:46 2016 From: report at bugs.python.org (Berker Peksag) Date: Sun, 27 Mar 2016 16:57:46 +0000 Subject: [issue26651] Deprecate register_adapter() and register_converter() in sqlite3 Message-ID: <1459097866.18.0.37527564025.issue26651@psf.upfronthosting.co.za> New submission from Berker Peksag: In issue 19065: Gerhard says: "I'm -1 because I believe that ultimately, adapters and converters were a mistake to add to pysqlite. That's why I deprecated them in pysqlite 2.8.0." Here is a patch (based on commit from pysqlite project [1]) to deprecate them. [1] https://github.com/ghaering/pysqlite/commit/c819a1eacb6baa52d9743bd400907307711a7427#diff-a31e41a9e523fbbf9e60ba9a31f38efeR159 ---------- components: Extension Modules files: deprecate_adapters.diff keywords: patch messages: 262525 nosy: berker.peksag, ghaering priority: normal severity: normal stage: patch review status: open title: Deprecate register_adapter() and register_converter() in sqlite3 type: enhancement versions: Python 3.6 Added file: http://bugs.python.org/file42309/deprecate_adapters.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 27 13:00:12 2016 From: report at bugs.python.org (Berker Peksag) Date: Sun, 27 Mar 2016 17:00:12 +0000 Subject: [issue19065] sqlite3 timestamp adapter chokes on timezones In-Reply-To: <1379808201.46.0.645672081963.issue19065@psf.upfronthosting.co.za> Message-ID: <1459098012.75.0.410679143781.issue19065@psf.upfronthosting.co.za> Berker Peksag added the comment: > Do you know what would be the correct step to propose a deprecation in the sqlite3 module of Python proper? I've opened issue 26651 (patch included) to deprecate them. ---------- nosy: +berker.peksag resolution: -> rejected stage: needs patch -> resolved status: open -> closed type: crash -> enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 27 13:23:58 2016 From: report at bugs.python.org (Brett Cannon) Date: Sun, 27 Mar 2016 17:23:58 +0000 Subject: [issue26647] Wordcode In-Reply-To: <1459034868.93.0.159802163565.issue26647@psf.upfronthosting.co.za> Message-ID: <1459099438.73.0.324750135847.issue26647@psf.upfronthosting.co.za> Changes by Brett Cannon : ---------- nosy: +haypo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 27 13:36:07 2016 From: report at bugs.python.org (Berker Peksag) Date: Sun, 27 Mar 2016 17:36:07 +0000 Subject: [issue15117] Please document top-level sqlite3 module variables In-Reply-To: <1340205684.94.0.46461654189.issue15117@psf.upfronthosting.co.za> Message-ID: <1459100167.45.0.0227295169643.issue15117@psf.upfronthosting.co.za> Berker Peksag added the comment: *_version_* attributes OP mentioned have already been documented in b8b26feb3e1a. ---------- nosy: +berker.peksag resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 27 13:56:41 2016 From: report at bugs.python.org (Berker Peksag) Date: Sun, 27 Mar 2016 17:56:41 +0000 Subject: [issue9297] SMTP with Sqlite3 file attached problem In-Reply-To: <1279504516.14.0.42498978414.issue9297@psf.upfronthosting.co.za> Message-ID: <1459101401.03.0.785248227642.issue9297@psf.upfronthosting.co.za> Berker Peksag added the comment: > Unless someone can reproduce the issue, I recommend that we close this ticket. I couldn't reproduce it either. ---------- nosy: +berker.peksag status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 27 13:59:20 2016 From: report at bugs.python.org (Brett Cannon) Date: Sun, 27 Mar 2016 17:59:20 +0000 Subject: [issue26646] Allow built-in module in package In-Reply-To: <1459023628.39.0.77878937212.issue26646@psf.upfronthosting.co.za> Message-ID: <1459101560.82.0.375437328872.issue26646@psf.upfronthosting.co.za> Brett Cannon added the comment: http://bugs.python.org/issue1644818 is also related to this. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 27 14:26:25 2016 From: report at bugs.python.org (Berker Peksag) Date: Sun, 27 Mar 2016 18:26:25 +0000 Subject: [issue18691] sqlite3.Cursor.execute expects sequence as second argument. In-Reply-To: <1376000572.11.0.481266307811.issue18691@psf.upfronthosting.co.za> Message-ID: <1459103185.51.0.279300797358.issue18691@psf.upfronthosting.co.za> Berker Peksag added the comment: I think the name "parameters" causes a confusion here. It basically means def execute(sql, parameters): not def execute(sql, *parameters): So ``con.execute('insert into foo values (?, ?)', (4, 5))`` is the correct usage of the API. Also, this looks like a duplicate of issue 20364. ---------- nosy: +berker.peksag resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> Rename & explain sqlite3.Cursor.execute 'parameters' param _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 27 14:57:28 2016 From: report at bugs.python.org (Mark Lawrence) Date: Sun, 27 Mar 2016 18:57:28 +0000 Subject: [issue9303] Migrate sqlite3 module to _v2 API to enhance performance In-Reply-To: <1279541286.68.0.824716490463.issue9303@psf.upfronthosting.co.za> Message-ID: <1459105048.42.0.284222018534.issue9303@psf.upfronthosting.co.za> Changes by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 27 15:37:49 2016 From: report at bugs.python.org (Roundup Robot) Date: Sun, 27 Mar 2016 19:37:49 +0000 Subject: [issue23758] Improve documenation about num_params in sqlite3 create_function and create_aggregate In-Reply-To: <1427190295.06.0.0583773654336.issue23758@psf.upfronthosting.co.za> Message-ID: <20160327193746.131008.89790.A1685085@psf.io> Roundup Robot added the comment: New changeset 02efd708c5c0 by Berker Peksag in branch '3.5': Issue #23758: Improve num_params docs of create_{function,aggregate} functions https://hg.python.org/cpython/rev/02efd708c5c0 New changeset 5be12f20d8f2 by Berker Peksag in branch 'default': Issue #23758: Improve num_params docs of create_{function,aggregate} functions https://hg.python.org/cpython/rev/5be12f20d8f2 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 27 15:39:33 2016 From: report at bugs.python.org (Berker Peksag) Date: Sun, 27 Mar 2016 19:39:33 +0000 Subject: [issue23758] Improve documenation about num_params in sqlite3 create_function and create_aggregate In-Reply-To: <1427190295.06.0.0583773654336.issue23758@psf.upfronthosting.co.za> Message-ID: <1459107573.13.0.344643630995.issue23758@psf.upfronthosting.co.za> Berker Peksag added the comment: Thank you C?dric. I also added tests to verify the behavior of num_params=-1. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.6 -Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 27 16:12:58 2016 From: report at bugs.python.org (Demur Rumed) Date: Sun, 27 Mar 2016 20:12:58 +0000 Subject: [issue26543] imaplib noop Debug In-Reply-To: <1457738623.54.0.0867122071018.issue26543@psf.upfronthosting.co.za> Message-ID: <1459109578.83.0.103087444394.issue26543@psf.upfronthosting.co.za> Demur Rumed added the comment: I've attached a patch file of the proposed change which seems correct ---------- keywords: +patch nosy: +Demur Rumed Added file: http://bugs.python.org/file42310/imaplib.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 27 16:29:36 2016 From: report at bugs.python.org (=?utf-8?b?0JzQsNGA0Log0JrQvtGA0LXQvdCx0LXRgNCz?=) Date: Sun, 27 Mar 2016 20:29:36 +0000 Subject: [issue26039] More flexibility in zipfile interface In-Reply-To: <1452179451.89.0.468945044395.issue26039@psf.upfronthosting.co.za> Message-ID: <1459110576.25.0.844695331812.issue26039@psf.upfronthosting.co.za> ???? ????????? added the comment: I have the same problem, and make monkey-patch by myself BEFORE seeing this issue (!) Example how I can do that is attached under name "socketpair.py". It will be nice if you take my idea. And after that streaming of zip files would be possible. ---------- nosy: +mmarkk Added file: http://bugs.python.org/file42311/main.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 27 16:51:48 2016 From: report at bugs.python.org (Martin Panter) Date: Sun, 27 Mar 2016 20:51:48 +0000 Subject: [issue23735] Readline not adjusting width after resize with 6.3 In-Reply-To: <1426984974.32.0.405944458303.issue23735@psf.upfronthosting.co.za> Message-ID: <1459111908.38.0.0161685396073.issue23735@psf.upfronthosting.co.za> Martin Panter added the comment: Sorry I forgot to send my draft. Sent now, but you figured it out :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 27 17:08:01 2016 From: report at bugs.python.org (Martin Panter) Date: Sun, 27 Mar 2016 21:08:01 +0000 Subject: [issue26644] SSLSocket.recv(-1) triggers SystemError In-Reply-To: <1458977282.91.0.0462711735469.issue26644@psf.upfronthosting.co.za> Message-ID: <1459112881.27.0.25526766301.issue26644@psf.upfronthosting.co.za> Martin Panter added the comment: The Python 2 fix was slightly different, due to the lack of Argument Clinic. ---------- resolution: -> fixed stage: commit review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 27 17:27:04 2016 From: report at bugs.python.org (=?utf-8?b?0JzQsNGA0Log0JrQvtGA0LXQvdCx0LXRgNCz?=) Date: Sun, 27 Mar 2016 21:27:04 +0000 Subject: [issue26039] More flexibility in zipfile interface In-Reply-To: <1452179451.89.0.468945044395.issue26039@psf.upfronthosting.co.za> Message-ID: <1459114024.47.0.324164564633.issue26039@psf.upfronthosting.co.za> ???? ????????? added the comment: Also, Python have problems with streaming READ of zip archive. I mean ability to read (in some form iterate over) archive when seeking is not available. I mean iteration like one in TAR archives. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 27 17:28:48 2016 From: report at bugs.python.org (Roundup Robot) Date: Sun, 27 Mar 2016 21:28:48 +0000 Subject: [issue25195] mock.ANY doesn't match mock.MagicMock() object In-Reply-To: <1442744840.41.0.232215932607.issue25195@psf.upfronthosting.co.za> Message-ID: <20160327212845.12199.99957.87240504@psf.io> Roundup Robot added the comment: New changeset dcd3b078ab84 by Berker Peksag in branch '3.5': Issue #25195: Fix a regression in mock.MagicMock https://hg.python.org/cpython/rev/dcd3b078ab84 New changeset 880d609b6664 by Berker Peksag in branch 'default': Issue #25195: Fix a regression in mock.MagicMock https://hg.python.org/cpython/rev/880d609b6664 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 27 17:29:41 2016 From: report at bugs.python.org (Berker Peksag) Date: Sun, 27 Mar 2016 21:29:41 +0000 Subject: [issue25195] mock.ANY doesn't match mock.MagicMock() object In-Reply-To: <1442744840.41.0.232215932607.issue25195@psf.upfronthosting.co.za> Message-ID: <1459114181.29.0.680414580704.issue25195@psf.upfronthosting.co.za> Berker Peksag added the comment: Thanks! ---------- keywords: +3.5regression -patch resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 27 17:30:10 2016 From: report at bugs.python.org (Berker Peksag) Date: Sun, 27 Mar 2016 21:30:10 +0000 Subject: [issue25195] mock.ANY doesn't match mock.MagicMock() object In-Reply-To: <1442744840.41.0.232215932607.issue25195@psf.upfronthosting.co.za> Message-ID: <1459114210.95.0.231266132925.issue25195@psf.upfronthosting.co.za> Changes by Berker Peksag : ---------- keywords: +patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 27 17:43:34 2016 From: report at bugs.python.org (Roundup Robot) Date: Sun, 27 Mar 2016 21:43:34 +0000 Subject: [issue26130] redundant local copy of a char pointer in classify in Parser\parser.c In-Reply-To: <1452890208.24.0.32779562482.issue26130@psf.upfronthosting.co.za> Message-ID: <20160327214331.12211.20335.1E484E08@psf.io> Roundup Robot added the comment: New changeset a90f5e2b7160 by Berker Peksag in branch 'default': Issue #26130: Remove redundant variable 's' from Parser/parser.c https://hg.python.org/cpython/rev/a90f5e2b7160 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 27 17:44:15 2016 From: report at bugs.python.org (Berker Peksag) Date: Sun, 27 Mar 2016 21:44:15 +0000 Subject: [issue26130] redundant local copy of a char pointer in classify in Parser\parser.c In-Reply-To: <1452890208.24.0.32779562482.issue26130@psf.upfronthosting.co.za> Message-ID: <1459115055.23.0.868165718199.issue26130@psf.upfronthosting.co.za> Berker Peksag added the comment: Thanks for the patch, Oren! ---------- nosy: +berker.peksag resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: -Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 27 19:49:08 2016 From: report at bugs.python.org (Martin Panter) Date: Sun, 27 Mar 2016 23:49:08 +0000 Subject: [issue22558] Missing doc links to source code In-Reply-To: <1412514337.47.0.069385783283.issue22558@psf.upfronthosting.co.za> Message-ID: <1459122548.02.0.0082991881338.issue22558@psf.upfronthosting.co.za> Changes by Martin Panter : ---------- title: Missing hint to source code - complete -> Missing doc links to source code _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 27 20:15:38 2016 From: report at bugs.python.org (Demur Rumed) Date: Mon, 28 Mar 2016 00:15:38 +0000 Subject: [issue26647] Wordcode In-Reply-To: <1459034868.93.0.159802163565.issue26647@psf.upfronthosting.co.za> Message-ID: <1459124138.9.0.692982401812.issue26647@psf.upfronthosting.co.za> Demur Rumed added the comment: Also missing from this patch is modification of the bytecode magic number ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 27 21:07:32 2016 From: report at bugs.python.org (Martin Panter) Date: Mon, 28 Mar 2016 01:07:32 +0000 Subject: [issue26039] More flexibility in zipfile write interface In-Reply-To: <1452179451.89.0.468945044395.issue26039@psf.upfronthosting.co.za> Message-ID: <1459127252.4.0.205898826607.issue26039@psf.upfronthosting.co.za> Martin Panter added the comment: Mark: I suggest to keep this discussion focussed on writing zip files, although I agree some enhancements to help reading without seeking could be reasonable. ---------- title: More flexibility in zipfile interface -> More flexibility in zipfile write interface _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 27 21:24:26 2016 From: report at bugs.python.org (Martin Panter) Date: Mon, 28 Mar 2016 01:24:26 +0000 Subject: [issue26488] hashlib command line interface In-Reply-To: <1457214866.19.0.989950954277.issue26488@psf.upfronthosting.co.za> Message-ID: <1459128266.93.0.807088496652.issue26488@psf.upfronthosting.co.za> Martin Panter added the comment: FWIW I am not really comfortable with argparse.FileType; see Issue 13824. How does this patch perform when warnings are enabled, or if you specify a file, but then cause some other argparse error? ---------- nosy: +martin.panter _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 27 21:49:32 2016 From: report at bugs.python.org (Martin Panter) Date: Mon, 28 Mar 2016 01:49:32 +0000 Subject: [issue14364] Argparse incorrectly handles '--' as argument to option In-Reply-To: <1332080953.55.0.495639573781.issue14364@psf.upfronthosting.co.za> Message-ID: <1459129772.52.0.352628151213.issue14364@psf.upfronthosting.co.za> Martin Panter added the comment: In Python 3.5, this does not seem fixed. Issue 13922 is marked as resolved and fixed, but Pauls?s patch has not actually been committed. >>> ap = ArgumentParser() >>> ap.add_argument("-t", "--test", type=str, nargs=1) _StoreAction(option_strings=['-t', '--test'], dest='test', nargs=1, const=None, default=None, type=, choices=None, help=None, metavar=None) >>> ap.add_argument('yuri', nargs='?') _StoreAction(option_strings=[], dest='yuri', nargs='?', const=None, default=None, type=None, choices=None, help=None, metavar=None) >>> ap.parse_args(["--test=--", "foo"]) Namespace(test=[], yuri='foo') >>> ap.parse_args(["--test", "--", "foo"]) usage: [-h] [-t TEST] [yuri] : error: argument -t/--test: expected 1 argument argparse.ArgumentError: argument -t/--test: expected 1 argument During handling of the above exception, another exception occurred: __main__.SystemExit: 2 >>> ap.parse_args(["-t--", "foo"]) Namespace(test=[], yuri='foo') >>> ap.parse_args(["-t", "--", "foo"]) usage: [-h] [-t TEST] [yuri] : error: argument -t/--test: expected 1 argument argparse.ArgumentError: argument -t/--test: expected 1 argument During handling of the above exception, another exception occurred: __main__.SystemExit: 2 ---------- nosy: +martin.panter title: Argparse incorrectly handles '--' -> Argparse incorrectly handles '--' as argument to option _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 27 22:04:22 2016 From: report at bugs.python.org (Martin Panter) Date: Mon, 28 Mar 2016 02:04:22 +0000 Subject: [issue19959] argparse.FileType does not expand tilde "~" In-Reply-To: <1386844263.55.0.374493919931.issue19959@psf.upfronthosting.co.za> Message-ID: <1459130662.48.0.441254220616.issue19959@psf.upfronthosting.co.za> Martin Panter added the comment: I think this change is not appropriate for Unix, because it is redundant and would conflict with normal shell expansion. I?m not familiar with Windows, but I suspect it is not appropriate there either (neither Windows command shells nor argparse do wildcard * and ? glob expansion, right?). Pending response from Garth or Julian. ---------- nosy: +martin.panter resolution: -> rejected status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 27 22:23:34 2016 From: report at bugs.python.org (Demur Rumed) Date: Mon, 28 Mar 2016 02:23:34 +0000 Subject: [issue26543] imaplib noop Debug In-Reply-To: <1457738623.54.0.0867122071018.issue26543@psf.upfronthosting.co.za> Message-ID: <1459131814.39.0.614373565473.issue26543@psf.upfronthosting.co.za> Demur Rumed added the comment: Fixes syntax & line length issues in previous patch ---------- Added file: http://bugs.python.org/file42312/imaplib2.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 27 22:30:25 2016 From: report at bugs.python.org (q20611152@163.com) Date: Mon, 28 Mar 2016 02:30:25 +0000 Subject: [issue15859] Fail update installation: 'utf-8' codec can't decode byte 0x90 in position 0: invalid start byte In-Reply-To: <1346736283.51.0.0156916220677.issue15859@psf.upfronthosting.co.za> Message-ID: <1459132225.69.0.732939295953.issue15859@psf.upfronthosting.co.za> q20611152 at 163.com added the comment: this issue occureed when i run gns3-1.4.5 in python3.5.1 help me ! my system is linux 3.6.11 release version is red flag inwise 8.0 ---------- components: -Windows nosy: +shanzhengcheng -BreamoreBoy, christian.heimes, ideasman42, pitrou, python-dev title: PyUnicode_EncodeFSDefault win32 inconsistancy. -> Fail update installation: 'utf-8' codec can't decode byte 0x90 in position 0: invalid start byte Added file: http://bugs.python.org/file42313/gns3-errorlog _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 27 23:08:37 2016 From: report at bugs.python.org (Roundup Robot) Date: Mon, 28 Mar 2016 03:08:37 +0000 Subject: [issue23804] SSLSocket.recv(0) receives up to 1024 bytes In-Reply-To: <1427625023.61.0.148010223441.issue23804@psf.upfronthosting.co.za> Message-ID: <20160328030834.21088.49593.F95F5ADC@psf.io> Roundup Robot added the comment: New changeset 7a3c5f7dda86 by Martin Panter in branch '3.5': Issue #23804: Fix SSL recv/read(0) to not return 1024 bytes https://hg.python.org/cpython/rev/7a3c5f7dda86 New changeset 72c457f9533a by Martin Panter in branch 'default': Issue #23804: Merge SSL zero read fix from 3.5 https://hg.python.org/cpython/rev/72c457f9533a New changeset f4cff2bf9903 by Martin Panter in branch '2.7': Issue #23804: Fix SSL recv/read(0) to not return 1024 bytes https://hg.python.org/cpython/rev/f4cff2bf9903 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 27 23:34:16 2016 From: report at bugs.python.org (Hung-Hsuan Chen) Date: Mon, 28 Mar 2016 03:34:16 +0000 Subject: [issue26652] Cannot install Python 2.7.11 on Windows Server 2008 R2 Message-ID: <1459136056.53.0.428865643545.issue26652@psf.upfronthosting.co.za> New submission from Hung-Hsuan Chen: I tried installing Python2.7.11 on a Virtual machine running Windows Server 2008 R2. However, I cannot complete the installation. I tried reboot the machine and re-install for a couple of times but got no luck. Here I attach the log file of "msiexec /i python-2.7.amd64.msi /l*v python.log". I hope someone can help me to figure this out. Thanks! ---------- components: Installation files: python.log messages: 262550 nosy: Hung-Hsuan Chen priority: normal severity: normal status: open title: Cannot install Python 2.7.11 on Windows Server 2008 R2 versions: Python 2.7 Added file: http://bugs.python.org/file42314/python.log _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 00:00:48 2016 From: report at bugs.python.org (Mike Lenzen) Date: Mon, 28 Mar 2016 04:00:48 +0000 Subject: [issue26653] bisect raises a TypeError when hi is None Message-ID: <1459137648.89.0.2938672633.issue26653@psf.upfronthosting.co.za> New submission from Mike Lenzen: >>> bisect.bisect([1, 2, 3], 1, hi=None) TypeError: 'NoneType' object cannot be interpreted as an integer I'm assuming this is an error in the C implementation because the Python source has: if hi is None: hi = len(a) ---------- components: Library (Lib) messages: 262551 nosy: Mike Lenzen, rhettinger priority: normal severity: normal status: open title: bisect raises a TypeError when hi is None type: behavior versions: Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 00:34:27 2016 From: report at bugs.python.org (Xiang Zhang) Date: Mon, 28 Mar 2016 04:34:27 +0000 Subject: [issue26653] bisect raises a TypeError when hi is None In-Reply-To: <1459137648.89.0.2938672633.issue26653@psf.upfronthosting.co.za> Message-ID: <1459139667.23.0.676367415368.issue26653@psf.upfronthosting.co.za> Xiang Zhang added the comment: The C version bisect_right can only accept number as hi, which conflicts with the python version using None as the default value. ---------- nosy: +xiang.zhang _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 00:54:16 2016 From: report at bugs.python.org (Martin Panter) Date: Mon, 28 Mar 2016 04:54:16 +0000 Subject: [issue9694] argparse required arguments displayed under "optional arguments" In-Reply-To: <1282846759.11.0.900867962743.issue9694@psf.upfronthosting.co.za> Message-ID: <1459140856.08.0.814063979344.issue9694@psf.upfronthosting.co.za> Martin Panter added the comment: I am willing to drop most of the code and comment changes if that moves us closer to consensus. Paul: would you accept changing the heading ?optional arguments? to ?options? in 3.6? I thought we were close to consensus to use ?options?, but maybe that is my own bias showing. Re-reading through this thread, here is a summary of the people that seem to prefer renaming the ?optional arguments? heading: Steven: ?flag arguments?, but concerned about affecting existing help messages David: options, switches Eric: replace adjective ?optional? but leave ?. . . arguments? Ben (OP): options Martin Panter: options, flags, switches, or non-positional arguments Oliver: switches Terry: keyword arguments Ryan: options, or other suggestions Martin d'Anjou and Raymond seem to prefer splitting out a third group, ?required arguments?, although it is not clear how that would tie in with the ?positional arguments? group. I think making it easier to modify the headings is worthwhile only if we deprecated the old heading in favour of using a new default name in the future. To me the problem is the default behaviour, not that argparse is inflexible. Another option might be to fix Issue 10529 (explain using gettext with argparse), and then use that to translate the "optional arguments" string. But I don?t know how to do this. Another thought is if we added a notice to Porting to Python 3.6 in What?s New, that might ease concerns about changing the heading. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 01:14:51 2016 From: report at bugs.python.org (Martin Panter) Date: Mon, 28 Mar 2016 05:14:51 +0000 Subject: [issue18722] Remove uses of the register keyword In-Reply-To: <1376343971.9.0.52964508892.issue18722@psf.upfronthosting.co.za> Message-ID: <1459142091.69.0.311520964143.issue18722@psf.upfronthosting.co.za> Martin Panter added the comment: I did a review of some of the changes in . In particular, there are a couple of comments /* Help register allocation */ which were mangled to /* Help allocation */. But it is not clear if the leftover variable copies are still helping (in which case the comments should be reverted), or if the copies and comments can be removed. ---------- nosy: +martin.panter _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 01:20:24 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 28 Mar 2016 05:20:24 +0000 Subject: [issue19959] argparse.FileType does not expand tilde "~" In-Reply-To: <1386844263.55.0.374493919931.issue19959@psf.upfronthosting.co.za> Message-ID: <1459142424.62.0.596921330862.issue19959@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: I'm with Martin. ---------- nosy: +serhiy.storchaka status: pending -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 01:20:39 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 28 Mar 2016 05:20:39 +0000 Subject: [issue19959] argparse.FileType does not expand tilde "~" In-Reply-To: <1386844263.55.0.374493919931.issue19959@psf.upfronthosting.co.za> Message-ID: <1459142439.53.0.708729246358.issue19959@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 01:28:11 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 28 Mar 2016 05:28:11 +0000 Subject: [issue18722] Remove uses of the register keyword In-Reply-To: <1376343971.9.0.52964508892.issue18722@psf.upfronthosting.co.za> Message-ID: <1459142891.2.0.523341217337.issue18722@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Agree that comments like /* Help allocation */ are confused and misleading. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 01:38:10 2016 From: report at bugs.python.org (=?utf-8?b?0JzQsNGA0Log0JrQvtGA0LXQvdCx0LXRgNCz?=) Date: Mon, 28 Mar 2016 05:38:10 +0000 Subject: [issue26039] More flexibility in zipfile write interface In-Reply-To: <1452179451.89.0.468945044395.issue26039@psf.upfronthosting.co.za> Message-ID: <1459143490.91.0.187508716661.issue26039@psf.upfronthosting.co.za> ???? ????????? added the comment: https://github.com/SpiderOak/ZipStream tries to implement streaming in one more kind. Also libarchive have experimental support of streaming write to zip archives in newest version. So problem is actual. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 01:55:28 2016 From: report at bugs.python.org (paul j3) Date: Mon, 28 Mar 2016 05:55:28 +0000 Subject: [issue14364] Argparse incorrectly handles '--' as argument to option In-Reply-To: <1332080953.55.0.495639573781.issue14364@psf.upfronthosting.co.za> Message-ID: <1459144528.44.0.15652540551.issue14364@psf.upfronthosting.co.za> paul j3 added the comment: I made a mistake of trying to add to or refine a closed patch. Maybe I need to move the dbldash.patch over here for more formal consideration. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 02:08:55 2016 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 28 Mar 2016 06:08:55 +0000 Subject: [issue26653] bisect raises a TypeError when hi is None In-Reply-To: <1459137648.89.0.2938672633.issue26653@psf.upfronthosting.co.za> Message-ID: <1459145335.05.0.581832762783.issue26653@psf.upfronthosting.co.za> Changes by Raymond Hettinger : ---------- assignee: -> rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 02:14:46 2016 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 28 Mar 2016 06:14:46 +0000 Subject: [issue26653] bisect raises a TypeError when hi is None In-Reply-To: <1459137648.89.0.2938672633.issue26653@psf.upfronthosting.co.za> Message-ID: <1459145686.82.0.894637461668.issue26653@psf.upfronthosting.co.za> Raymond Hettinger added the comment: The pure python code used None as a placeholder for an optional argument. It is not an intended input value. The documented signature is: bisect.bisect_left(a, x, lo=0, hi=len(a)). ---------- priority: normal -> low _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 02:17:15 2016 From: report at bugs.python.org (Roundup Robot) Date: Mon, 28 Mar 2016 06:17:15 +0000 Subject: [issue25314] Documentation: argparse's actions store_{true, false} default to False/True (undocumented) In-Reply-To: <1443992693.14.0.504421256983.issue25314@psf.upfronthosting.co.za> Message-ID: <20160328061712.21078.65197.9CC72AB3@psf.io> Roundup Robot added the comment: New changeset 566fe3564684 by Raymond Hettinger in branch '3.5': Issue #25314: store_true and store_false also create appropriate defaults. https://hg.python.org/cpython/rev/566fe3564684 New changeset 9fdeca5fdbf0 by Martin Panter in branch 'default': Issue #25314: Merge argparse doc from 3.5 https://hg.python.org/cpython/rev/9fdeca5fdbf0 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 02:27:03 2016 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 28 Mar 2016 06:27:03 +0000 Subject: [issue26651] Deprecate register_adapter() and register_converter() in sqlite3 In-Reply-To: <1459097866.18.0.37527564025.issue26651@psf.upfronthosting.co.za> Message-ID: <1459146423.78.0.348692718967.issue26651@psf.upfronthosting.co.za> Raymond Hettinger added the comment: A few thoughts: 1) Deprecation messages should say "do X instead" rather than leaving users stranded. 2) As long as most of our users are still with Python 2.7 we need to avoid deprecations that present obstacles to Python 3 adoption or that increase transition costs. 3) The adapters have been around for many years; the older the API, the more people people will have come to rely on it. 4) The standard library is expected to be less changeable than third-party modules (we say that the standard library is where code goes to die and it should already be dead on arrival so that the word "standard" has more meaning. ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 02:34:34 2016 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 28 Mar 2016 06:34:34 +0000 Subject: [issue26632] __all__ decorator In-Reply-To: <1458786797.31.0.0749407715279.issue26632@psf.upfronthosting.co.za> Message-ID: <1459146874.7.0.586979056214.issue26632@psf.upfronthosting.co.za> Raymond Hettinger added the comment: [Barry] > This is probably terrible ... I have to agree with that part ;-) Sorry, but this feels "yucky" and is likely to cause more problems than it solves. ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 02:36:47 2016 From: report at bugs.python.org (Martin Panter) Date: Mon, 28 Mar 2016 06:36:47 +0000 Subject: [issue25314] Documentation: argparse's actions store_{true, false} default to False/True (undocumented) In-Reply-To: <1443992693.14.0.504421256983.issue25314@psf.upfronthosting.co.za> Message-ID: <1459147007.16.0.809262083244.issue25314@psf.upfronthosting.co.za> Martin Panter added the comment: For the record, porting the change was rather easy (hg graft + tweak + hg commit --amend). With that applied, I think it eliminates the need for the store_true/false half of Julien?s patch. Is the store_const half of Julien?s patch ready to commit? ---------- stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 02:39:32 2016 From: report at bugs.python.org (Martin Panter) Date: Mon, 28 Mar 2016 06:39:32 +0000 Subject: [issue23804] SSLSocket.recv(0) receives up to 1024 bytes In-Reply-To: <1427625023.61.0.148010223441.issue23804@psf.upfronthosting.co.za> Message-ID: <1459147172.97.0.784247554525.issue23804@psf.upfronthosting.co.za> Changes by Martin Panter : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.6 -Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 03:26:43 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 28 Mar 2016 07:26:43 +0000 Subject: [issue26632] __all__ decorator In-Reply-To: <1458786797.31.0.0749407715279.issue26632@psf.upfronthosting.co.za> Message-ID: <1459150003.33.0.557542785165.issue26632@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Agree with Raymond. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 04:24:24 2016 From: report at bugs.python.org (Aviv Palivoda) Date: Mon, 28 Mar 2016 08:24:24 +0000 Subject: [issue26488] hashlib command line interface In-Reply-To: <1457214866.19.0.989950954277.issue26488@psf.upfronthosting.co.za> Message-ID: <1459153464.62.0.0864172932623.issue26488@psf.upfronthosting.co.za> Aviv Palivoda added the comment: I actually have noticed issue 13824 while working on this issue. The patch I uploaded to Issue 14156 actually fixes the problem in issue 13824 in addition to the problem with the stdin/stdout. I think we should add a dependency in issue 14156 for this issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 05:06:48 2016 From: report at bugs.python.org (SilentGhost) Date: Mon, 28 Mar 2016 09:06:48 +0000 Subject: [issue26488] hashlib command line interface In-Reply-To: <1457214866.19.0.989950954277.issue26488@psf.upfronthosting.co.za> Message-ID: <1459156008.28.0.116656148026.issue26488@psf.upfronthosting.co.za> Changes by SilentGhost : ---------- dependencies: +argparse.FileType for '-' doesn't work for a mode of 'rb' nosy: +SilentGhost _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 05:57:30 2016 From: report at bugs.python.org (iceboy) Date: Mon, 28 Mar 2016 09:57:30 +0000 Subject: [issue26654] asyncio is not inspecting keyword arguments of functools.partial Message-ID: <1459159050.15.0.830010057156.issue26654@psf.upfronthosting.co.za> New submission from iceboy: import asyncio import functools def foo(x): raise Exception() loop = asyncio.get_event_loop() loop.call_soon(functools.partial(foo, x=1)) loop.run_forever() Current error message: Exception in callback foo()() at ...:4 Expected error message: Exception in callback foo(x=1)() at ...:4 ---------- components: asyncio messages: 262566 nosy: gvanrossum, haypo, iceboy, yselivanov priority: normal severity: normal status: open title: asyncio is not inspecting keyword arguments of functools.partial versions: Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 06:02:43 2016 From: report at bugs.python.org (SilentGhost) Date: Mon, 28 Mar 2016 10:02:43 +0000 Subject: [issue26652] Cannot install Python 2.7.11 on Windows Server 2008 R2 In-Reply-To: <1459136056.53.0.428865643545.issue26652@psf.upfronthosting.co.za> Message-ID: <1459159363.51.0.722334874932.issue26652@psf.upfronthosting.co.za> Changes by SilentGhost : ---------- components: +Windows nosy: +paul.moore, steve.dower, tim.golden, zach.ware _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 07:09:19 2016 From: report at bugs.python.org (Berker Peksag) Date: Mon, 28 Mar 2016 11:09:19 +0000 Subject: [issue15859] PyUnicode_EncodeFSDefault win32 inconsistancy. In-Reply-To: <1346736283.51.0.0156916220677.issue15859@psf.upfronthosting.co.za> Message-ID: <1459163359.01.0.770810520766.issue15859@psf.upfronthosting.co.za> Berker Peksag added the comment: shanzhengcheng: Please don't update closed issues. gns3-1.4.5 is not part of the Python standard library. You'll get better support by using the gns3 support channels. If you still think that this is a bug in Python, please file a new issue by using the form at http://bugs.python.org/issue?@template=item (it would be great if you provide a reproducer without using gns3) Thanks! ---------- components: +Windows nosy: +berker.peksag, christian.heimes, ideasman42, paul.moore, pitrou, python-dev, steve.dower, tim.golden, zach.ware stage: patch review -> resolved title: Fail update installation: 'utf-8' codec can't decode byte 0x90 in position 0: invalid start byte -> PyUnicode_EncodeFSDefault win32 inconsistancy. _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 07:10:38 2016 From: report at bugs.python.org (Berker Peksag) Date: Mon, 28 Mar 2016 11:10:38 +0000 Subject: [issue15859] PyUnicode_EncodeFSDefault win32 inconsistancy. In-Reply-To: <1346736283.51.0.0156916220677.issue15859@psf.upfronthosting.co.za> Message-ID: <1459163438.37.0.666440116203.issue15859@psf.upfronthosting.co.za> Changes by Berker Peksag : ---------- nosy: -paul.moore, steve.dower, tim.golden, zach.ware _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 08:14:04 2016 From: report at bugs.python.org (Barry A. Warsaw) Date: Mon, 28 Mar 2016 12:14:04 +0000 Subject: [issue26632] __all__ decorator In-Reply-To: <1459146874.7.0.586979056214.issue26632@psf.upfronthosting.co.za> Message-ID: <20160328081358.318f27dd@anarchist> Barry A. Warsaw added the comment: On Mar 28, 2016, at 06:34 AM, Raymond Hettinger wrote: >I have to agree with that part ;-) Sorry, but this feels "yucky" and is >likely to cause more problems than it solves. I've been experimenting with something like this in a Mailman branch and I've come to like it much more than I did originally. I'm using the "simple" implementation, so that means that I have a very few explicit appends to __all__. But the use of @public is actually pretty great. I don't have to worry about __all__ getting out of sync (and there turned out to be lots of places where that was happening), it's quite visually appealing (easy to pick out in a crowded file), and it avoids nasty pep8 conflicts. The major downside is actually having to import it from a module very early in the startup sequence. I stick it in mailman/__init__.py but that kind of sucks because I want to move to making that a namespace package so I want to *remove* mailman/__init__.py but there's no other obvious place to put an early `public` definition. Thus after experimenting with it, I'm much more in favor of it. Could you please describe what you don't like about it and what problems you think it will cause? (Plus, I encourage you to try it on a medium to large size project!) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 08:19:49 2016 From: report at bugs.python.org (Julian Berman) Date: Mon, 28 Mar 2016 12:19:49 +0000 Subject: [issue19959] argparse.FileType does not expand tilde "~" In-Reply-To: <1386844263.55.0.374493919931.issue19959@psf.upfronthosting.co.za> Message-ID: <1459167589.89.0.0141571962987.issue19959@psf.upfronthosting.co.za> Julian Berman added the comment: My support (or really, asking for a more generic callable) was to enable other use cases, not this one specifically -- e.g., allowing for constructing a pathlib Path or a twisted.python.filepath.FilePath without needing to write one's own argparse action. For ~ specifically -- it's true if you're going to go via a shell it'd be expanded first, but I'm not sure that'd count as "conflicting" with the shell's expansion, it just won't be needed. Consider that twisted.python.filepath.FilePath for example, expands ~ in its constructor -- people often construct paths in other places and occasionally expansion is convenient. Like in test cases. I certainly don't feel strongly about the patch though, especially as-is. ---------- status: pending -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 09:24:02 2016 From: report at bugs.python.org (Udo Eberhardt) Date: Mon, 28 Mar 2016 13:24:02 +0000 Subject: [issue26655] pathlib glob case sensitivity issue on Windows Message-ID: <1459171442.9.0.718616645463.issue26655@psf.upfronthosting.co.za> New submission from Udo Eberhardt: On Windows Path.glob does not always return the file name with correct case. If the current directory contains a file named MixedCase.txt then the following script: import pathlib p = pathlib.Path('.') print(list(p.glob('*.txt'))) print(list(p.glob('Mixedcase.txt'))) yields: [WindowsPath('MixedCase.txt')] [WindowsPath('mixedcase.txt')] Problem: The result of the second call to glob should be 'MixedCase.txt' as well. I would expect that glob returns a file name exactly as it is spelled in the file system. ---------- components: Library (Lib), Windows messages: 262570 nosy: paul.moore, steve.dower, tim.golden, udo.eberhardt, zach.ware priority: normal severity: normal status: open title: pathlib glob case sensitivity issue on Windows type: behavior versions: Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 11:21:24 2016 From: report at bugs.python.org (Sworddragon) Date: Mon, 28 Mar 2016 15:21:24 +0000 Subject: [issue26656] Documentation for re.compile is a bit outdated Message-ID: <1459178484.74.0.770971045402.issue26656@psf.upfronthosting.co.za> New submission from Sworddragon: The documentation for re.compile says "Compile a regular expression pattern into a regular expression object, which can be used for matching using its match() and search() methods, described below." which implies that match() and search() are the only methods for it while there are a few more. Maybe this sentence should be worded more generic or at least complete the list. ---------- assignee: docs at python components: Documentation messages: 262571 nosy: Sworddragon, docs at python priority: normal severity: normal status: open title: Documentation for re.compile is a bit outdated type: behavior versions: Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 11:30:15 2016 From: report at bugs.python.org (Thomas) Date: Mon, 28 Mar 2016 15:30:15 +0000 Subject: [issue26657] Directory traversal with http.server and SimpleHTTPServer on windows Message-ID: <1459179015.77.0.509336394494.issue26657@psf.upfronthosting.co.za> New submission from Thomas: SimpleHTTPServer and http.server allow directory traversal on Windows. To exploit this vulnerability, replace all ".." in URLs with "c:c:c:..". Example: Run python -m http.server and visit 127.0.0.1:8000/c:c:c:../secret_file_that_should_be_secret_but_is_not.txt There is a warning that those modules are not secure in the module docs, but for some reason they do not appear in the online docs: https://docs.python.org/3/library/http.server.html https://docs.python.org/2/library/simplehttpserver.html It would be nice if that warning was as apparent as for example here: https://docs.python.org/2/library/xml.etree.elementtree.html There are a lot of other URLs that are insecure as well, which can all be traced back to here: https://hg.python.org/cpython/file/tip/Lib/http/server.py#l766 The splitdrive and split functions, which should make sure that the final output is free of ".." are only called once which leads to this control flow: --------------------------------------------------------------- path = "c:/secret/public" word = "c:c:c:.." _, word = os.path.splitdrive(word) # word = "c:c:.." _, word = os.path.split(word) # word = "c:.." path = os.path.join(path, word) # path = "c:/secret/public\\.." --------------------------------------------------------------- Iterating splitdrive and split seems safer: --------------------------------------------------------------- for word in words: # Call split and splitdrive multiple times until # word does not change anymore. has_changed = True while has_changed: previous_word = word _, word = os.path.split(word) _, word = os.path.splitdrive(word) has_changed = word != previous_word --------------------------------------------------------------- There is another weird thing which I am not quite sure about here: https://hg.python.org/cpython/file/tip/Lib/http/server.py#l761 --------------------------------------------------------------- path = posixpath.normpath(path) words = path.split('/') --------------------------------------------------------------- posixpath.normpath does not do anything with backslashes and then the path is split by forward slashes, so it may still contain backslashes. Maybe replacing posixpath.normpath with os.path.normpath and then splitting by os.sep would work, but I don't have enough different operating systems to test this, so someone else should have a look. I have attached some simple fuzzing test that tries a few weird URLs and sees if they lead where they shouldn't. Disclaimer: Might still contain other bugs. ---------- components: Library (Lib) files: fuzz.py messages: 262572 nosy: Thomas priority: normal severity: normal status: open title: Directory traversal with http.server and SimpleHTTPServer on windows type: security versions: Python 3.6 Added file: http://bugs.python.org/file42315/fuzz.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 11:36:47 2016 From: report at bugs.python.org (SilentGhost) Date: Mon, 28 Mar 2016 15:36:47 +0000 Subject: [issue26657] Directory traversal with http.server and SimpleHTTPServer on windows In-Reply-To: <1459179015.77.0.509336394494.issue26657@psf.upfronthosting.co.za> Message-ID: <1459179407.94.0.145400350212.issue26657@psf.upfronthosting.co.za> Changes by SilentGhost : ---------- components: +Windows nosy: +martin.panter, paul.moore, steve.dower, tim.golden, zach.ware versions: +Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 11:59:23 2016 From: report at bugs.python.org (Berker Peksag) Date: Mon, 28 Mar 2016 15:59:23 +0000 Subject: [issue10740] sqlite3 module breaks transactions and potentially corrupts data In-Reply-To: <1292868135.81.0.257293444934.issue10740@psf.upfronthosting.co.za> Message-ID: <1459180763.36.0.495548056138.issue10740@psf.upfronthosting.co.za> Berker Peksag added the comment: Here is a patch. It contains the following commits: * https://github.com/ghaering/pysqlite/commit/f254c534948c41c0ceb8cbabf0d4a2f547754739 * https://github.com/ghaering/pysqlite/commit/796b3afe38cfdac5d7d5ec260826b0a596554631 * https://github.com/ghaering/pysqlite/commit/cae87ee68613697a5f4947b4a0941f59a28da1b6 * https://github.com/ghaering/pysqlite/commit/3567b31bb5e5b226ba006213a9c69dde3f155faf Changes: * Fixed a refcount error * Fixed a compiler warning * Added a whatsnew entry Note: sqlite3_stmt_readonly() has been added in SQLite 3.7.4 (released on 2010-12-07) so this patch will make older SQLite versions unusable with the sqlite3 module. ---------- nosy: +berker.peksag stage: needs patch -> patch review Added file: http://bugs.python.org/file42316/issue10740_upstream.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 12:19:01 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 28 Mar 2016 16:19:01 +0000 Subject: [issue26655] pathlib glob case sensitivity issue on Windows In-Reply-To: <1459171442.9.0.718616645463.issue26655@psf.upfronthosting.co.za> Message-ID: <1459181941.26.0.233680184293.issue26655@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: The problem is that there is no way to just read a file name exactly as it is spelled in the file system. Iterating all names in the directory and finding the one that match specified name ignoring case is not such effective as checking that specified file name exists. ---------- nosy: +pitrou, serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 12:26:46 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 28 Mar 2016 16:26:46 +0000 Subject: [issue26632] __all__ decorator In-Reply-To: <1458786797.31.0.0749407715279.issue26632@psf.upfronthosting.co.za> Message-ID: <1459182406.63.0.129875181602.issue26632@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: There is a helper in test.support that helps to add a test for __all__, and we slowly add these test for all modules. So this is not large issue for the stdlib. New module level names are added not very often. Keeping __all__ in sync is not the largest problem in the maintaining. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 12:32:04 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 28 Mar 2016 16:32:04 +0000 Subject: [issue26653] bisect raises a TypeError when hi is None In-Reply-To: <1459137648.89.0.2938672633.issue26653@psf.upfronthosting.co.za> Message-ID: <1459182724.12.0.491008840583.issue26653@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: May be change the placeholder? For example to sys.maxsize, float('inf') or ['len(a)']. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 12:49:26 2016 From: report at bugs.python.org (Jeremy Kloth) Date: Mon, 28 Mar 2016 16:49:26 +0000 Subject: [issue26658] test_os fails when run on Windows ramdisk Message-ID: <1459183766.58.0.185896673203.issue26658@psf.upfronthosting.co.za> New submission from Jeremy Kloth: The Win32JunctionTests class fails when the test suite is run on an ImDisk[1]_ virtual disk. The junctions are created successfully, however os.stat() fails on them (winerror 123). os.lstat() does succeed. I'm inclined to believe that this is a bug in the ImDisk device driver, but when testDown() is run, it fails to remove the newly created junction to the test directory. By leaving the junction in place, when the test runner completes it removes the entire temporary test directory containing the junction thus removing the Lib test directory! I suggest that at least changing the tearDown() method to use os.path.lexists() to ensure that the junction is removed regardless of its target existing or not. .. [1] http://www.ltr-data.se/opencode.html/#ImDisk ---------- components: Tests, Windows files: test_os.patch keywords: patch messages: 262577 nosy: haypo, jkloth, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: test_os fails when run on Windows ramdisk versions: Python 3.5, Python 3.6 Added file: http://bugs.python.org/file42317/test_os.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 13:32:27 2016 From: report at bugs.python.org (Xiang Zhang) Date: Mon, 28 Mar 2016 17:32:27 +0000 Subject: [issue26657] Directory traversal with http.server and SimpleHTTPServer on windows In-Reply-To: <1459179015.77.0.509336394494.issue26657@psf.upfronthosting.co.za> Message-ID: <1459186347.69.0.573427883727.issue26657@psf.upfronthosting.co.za> Changes by Xiang Zhang : ---------- nosy: +xiang.zhang _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 13:39:49 2016 From: report at bugs.python.org (STINNER Victor) Date: Mon, 28 Mar 2016 17:39:49 +0000 Subject: [issue26658] test_os fails when run on Windows ramdisk In-Reply-To: <1459183766.58.0.185896673203.issue26658@psf.upfronthosting.co.za> Message-ID: STINNER Victor added the comment: Maybe the junction must not include Lib/ but only temporary directories? I didn't read the tedt yet. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 14:21:20 2016 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 28 Mar 2016 18:21:20 +0000 Subject: [issue23551] IDLE to provide menu link to PIP gui. In-Reply-To: <1425155752.55.0.0736033483828.issue23551@psf.upfronthosting.co.za> Message-ID: <1459189280.84.0.313706109174.issue23551@psf.upfronthosting.co.za> Terry J. Reedy added the comment: Sunday morning I posted "Adding a Pip GUI to IDLE and idlelib (GSOC project)" to the pydev list requesting that any objections to the current plan be raised and resolved soon, before final acceptance of a student proposal and official initiation of work on it. About ensurepip (point 1a on Raymond's list): ensurepip is a package in the stdlib. Regardless of how we later run pip, its presence can be tested on startup by trying to import it. If not present, we should ask whether to install it or nor. It can be installed either by running 'python -m ensurepip' in a subprocess or by doing what ensurepip.__main__ does: import ensurepip; ensurepip._main ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 15:39:01 2016 From: report at bugs.python.org (Aleksandr Balezin) Date: Mon, 28 Mar 2016 19:39:01 +0000 Subject: [issue25431] implement address in network in ipaddress module In-Reply-To: <1445089092.67.0.311861464579.issue25431@psf.upfronthosting.co.za> Message-ID: <1459193941.06.0.729780659127.issue25431@psf.upfronthosting.co.za> Aleksandr Balezin added the comment: Any news? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 15:59:51 2016 From: report at bugs.python.org (Philipp Hagemeister) Date: Mon, 28 Mar 2016 19:59:51 +0000 Subject: [issue26657] Directory traversal with http.server and SimpleHTTPServer on windows In-Reply-To: <1459179015.77.0.509336394494.issue26657@psf.upfronthosting.co.za> Message-ID: <1459195191.16.0.0521201180966.issue26657@psf.upfronthosting.co.za> Philipp Hagemeister added the comment: Please find attached a patch which adds a testcase for Windows (on all platforms) as well as code to fix the problem. Since os.path.split returns everything after the final slash/backslash, it only needs to be called once. Note that the usage of posixpath is correct and only relates to the URL parsing - it powers foo/bar/../../ . The path elements may indeed contain backslashes - that's why we call os.path.split on them. ---------- keywords: +patch nosy: +phihag Added file: http://bugs.python.org/file42318/fix-path-traversal-26657.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 16:07:30 2016 From: report at bugs.python.org (Kevin Modzelewski) Date: Mon, 28 Mar 2016 20:07:30 +0000 Subject: [issue26659] slice() leaks memory when part of a cycle Message-ID: <1459195650.62.0.697543008617.issue26659@psf.upfronthosting.co.za> New submission from Kevin Modzelewski: The slice type doesn't participate in GC, which means that if you happen to create a cycle involving a slice, that cycle will never get freed. Here's an example: def f(): l = [] l.append(slice(l)) # Will consume memory without bound: while True: f() This seems pretty hard to trigger accidentally, so it might not be a huge deal -- especially since it seems to have been around for a while. (I only checked 2.7 and trunk though.) I think this could be solved by either having the slice class participate in GC (ie add tp_traverse and tp_clear methods), or maybe doing some type-filtering during slice_new(). ---------- components: Interpreter Core messages: 262582 nosy: Kevin Modzelewski priority: normal severity: normal status: open title: slice() leaks memory when part of a cycle type: resource usage versions: Python 2.7, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 16:51:30 2016 From: report at bugs.python.org (Philipp Hagemeister) Date: Mon, 28 Mar 2016 20:51:30 +0000 Subject: [issue26657] Directory traversal with http.server and SimpleHTTPServer on windows In-Reply-To: <1459179015.77.0.509336394494.issue26657@psf.upfronthosting.co.za> Message-ID: <1459198290.83.0.882321546646.issue26657@psf.upfronthosting.co.za> Philipp Hagemeister added the comment: Update testcase, and call split before splitdrive ---------- Added file: http://bugs.python.org/file42319/fix-path-traversal-26657.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 18:22:28 2016 From: report at bugs.python.org (Laurent Mazuel) Date: Mon, 28 Mar 2016 22:22:28 +0000 Subject: [issue26660] tempfile.TemporaryDirectory() cleanup exception on Windows if readonly files created Message-ID: <1459203748.81.0.389724870435.issue26660@psf.upfronthosting.co.za> New submission from Laurent Mazuel: Using tempfile.TemporaryDirectory() in Windows, creating read-only files in this temp directory leads to PermissionError during the cleanup(). This is a direct cause of this one: https://bugs.python.org/issue19643 And the workaround which was proposed in the issue 19643 and added to the doc here: https://docs.python.org/3/library/shutil.html?highlight=shutil#rmtree-example is not used in the TemporaryDirectory implementation. I don't know if the right solution is to modify the implementation to systematically delete read-only files using the cited workaround, or to add a 'remove_readonly' flag or to update the documentation to clearly says that cleanup will raise a PermissionError if the user creates a read-only file. At least documentation please :) In my specific usecase I "git clone" in the temp directory, and the .git folder contains read-only files. Full stacktrace: Traceback (most recent call last): File "C:\mycode.py", line 149, in build_libraries update(generated_path, dest_folder) File "C:\Program Files\Python35\lib\tempfile.py", line 807, in __exit__ self.cleanup() File "C:\Program Files\Python35\lib\tempfile.py", line 811, in cleanup _shutil.rmtree(self.name) File "C:\Program Files\Python35\lib\shutil.py", line 488, in rmtree return _rmtree_unsafe(path, onerror) File "C:\Program Files\Python35\lib\shutil.py", line 378, in _rmtree_unsafe _rmtree_unsafe(fullname, onerror) File "C:\Program Files\Python35\lib\shutil.py", line 378, in _rmtree_unsafe _rmtree_unsafe(fullname, onerror) File "C:\Program Files\Python35\lib\shutil.py", line 378, in _rmtree_unsafe _rmtree_unsafe(fullname, onerror) File "C:\Program Files\Python35\lib\shutil.py", line 378, in _rmtree_unsafe _rmtree_unsafe(fullname, onerror) File "C:\Program Files\Python35\lib\shutil.py", line 383, in _rmtree_unsafe onerror(os.unlink, fullname, sys.exc_info()) File "C:\Program Files\Python35\lib\shutil.py", line 381, in _rmtree_unsafe os.unlink(fullname) PermissionError: [WinError 5] Access is denied: 'C:\\Users\\me\\AppData\\Local\\Temp\\tmpk62cp34t\\readonly.file' ---------- components: Library (Lib) messages: 262584 nosy: Laurent.Mazuel priority: normal severity: normal status: open title: tempfile.TemporaryDirectory() cleanup exception on Windows if readonly files created type: enhancement versions: Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 19:02:38 2016 From: report at bugs.python.org (Martin Panter) Date: Mon, 28 Mar 2016 23:02:38 +0000 Subject: [issue26657] Directory traversal with http.server and SimpleHTTPServer on windows In-Reply-To: <1459179015.77.0.509336394494.issue26657@psf.upfronthosting.co.za> Message-ID: <1459206158.07.0.62015963299.issue26657@psf.upfronthosting.co.za> Martin Panter added the comment: Thomas: can you point to the ?warning that those modules are not secure in the module docs?? All I can see is a warning in the pydoc output for http.server.__doc__, but that is specifically about the CGI server. The specific bug with allowing c:c:c:.. looks like it would have been triggered by fixing Issue 19456. If so, 2.7 would also be affected. The whole translate_path() algorithm looks over-complicated to me. One quick idea that comes to mind is to skip (or diagnose) each whole URL path component if there is any drive, directory etc syntax present, rather than making an attempt to strip it off. Perhaps check with os.path.dirname() or pathlib?s is_reserved(). One other thing I have wondered about, but I don?t know Windows well enough to be sure. Shouldn?t there be some protection against accessing special files like ? Ideally, I would like to see a common function somewhere to do this kind of path validation and conversion. There are other places even in the standard library where this is needed, which I mentioned at . ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 21:17:34 2016 From: report at bugs.python.org (Eric Khoo Jiun Hooi) Date: Tue, 29 Mar 2016 01:17:34 +0000 Subject: [issue23551] IDLE to provide menu link to PIP gui. In-Reply-To: <1425155752.55.0.0736033483828.issue23551@psf.upfronthosting.co.za> Message-ID: <1459214254.28.0.693222728438.issue23551@psf.upfronthosting.co.za> Eric Khoo Jiun Hooi added the comment: >From what I know after reading the ensurepip script, the ensurepip script is checking whether the pip and it requirement tools are installed right like get_pip.py that was mention https://pip.pypa.io/en/stable/installing/ ? So, we have to put it inside the gui script to ensure that the pip is installed. Otherwise, pass the "python -m ensurepip" to subprocess to install the package before start the gui of pip. Am I understand it correctly? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 21:18:29 2016 From: report at bugs.python.org (Eric Khoo Jiun Hooi) Date: Tue, 29 Mar 2016 01:18:29 +0000 Subject: [issue23551] IDLE to provide menu link to PIP gui. In-Reply-To: <1425155752.55.0.0736033483828.issue23551@psf.upfronthosting.co.za> Message-ID: <1459214309.77.0.662948588675.issue23551@psf.upfronthosting.co.za> Eric Khoo Jiun Hooi added the comment: Is there any other uses of the ensurepip script? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 21:35:39 2016 From: report at bugs.python.org (Guido van Rossum) Date: Tue, 29 Mar 2016 01:35:39 +0000 Subject: [issue26654] asyncio is not inspecting keyword arguments of functools.partial In-Reply-To: <1459159050.15.0.830010057156.issue26654@psf.upfronthosting.co.za> Message-ID: <1459215339.07.0.218397620156.issue26654@psf.upfronthosting.co.za> Guido van Rossum added the comment: Oh, wow. I didn't even know we special-case partial() there. In general we tend to focus more on positional arguments (since asyncio intentionally doesn't take keyword args for callbacks) but I see no reason why we couldn't add this here. Maybe you're interested in writing a patch yourself? You could do it as a PR for the "upstream" git repo https://github.com/python/asyncio ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 22:40:33 2016 From: report at bugs.python.org (Davin Potts) Date: Tue, 29 Mar 2016 02:40:33 +0000 Subject: [issue26633] multiprocessing behavior combining daemon with non-daemon children inconsistent with threading In-Reply-To: <1458789435.04.0.43504353002.issue26633@psf.upfronthosting.co.za> Message-ID: <1459219233.49.0.0823727714443.issue26633@psf.upfronthosting.co.za> Changes by Davin Potts : ---------- nosy: +davin _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 23:50:32 2016 From: report at bugs.python.org (Demur Rumed) Date: Tue, 29 Mar 2016 03:50:32 +0000 Subject: [issue26659] slice() leaks memory when part of a cycle In-Reply-To: <1459195650.62.0.697543008617.issue26659@psf.upfronthosting.co.za> Message-ID: <1459223432.88.0.406122969226.issue26659@psf.upfronthosting.co.za> Demur Rumed added the comment: Implementing tp_traverse & tp_clear seems to runs into complications due to slice_cache ---------- nosy: +Demur Rumed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 01:37:16 2016 From: report at bugs.python.org (Raymond Hettinger) Date: Tue, 29 Mar 2016 05:37:16 +0000 Subject: [issue26653] bisect raises a TypeError when hi is None In-Reply-To: <1459137648.89.0.2938672633.issue26653@psf.upfronthosting.co.za> Message-ID: <1459229836.25.0.278780321116.issue26653@psf.upfronthosting.co.za> Raymond Hettinger added the comment: Sorry, I don't think that is a good idea. The use of None as a placeholder for optional arguments is legitimate and well enshrined in Python history. The code is bisect is very old, stable, and battle-tested. There isn't a real bug here, nothing is broken; instead, we have a near pedantic notion that the C-version must be forced to replicate a minor and irrelevant implementation detail of the Python version that goes beyond what the docs guarantee. I recommend closing this as "not a bug". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 02:23:42 2016 From: report at bugs.python.org (Robert Cope) Date: Tue, 29 Mar 2016 06:23:42 +0000 Subject: [issue16500] Add an 'atfork' module In-Reply-To: <1353252005.31.0.454056781872.issue16500@psf.upfronthosting.co.za> Message-ID: <1459232622.54.0.244864908752.issue16500@psf.upfronthosting.co.za> Changes by Robert Cope : ---------- nosy: +rpcope1 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 02:30:49 2016 From: report at bugs.python.org (Robert Cope) Date: Tue, 29 Mar 2016 06:30:49 +0000 Subject: [issue25829] Mixing multiprocessing pool and subprocess may create zombie process, and cause program to hang. In-Reply-To: <1449655474.19.0.730082771595.issue25829@psf.upfronthosting.co.za> Message-ID: <1459233049.78.0.0573039016934.issue25829@psf.upfronthosting.co.za> Changes by Robert Cope : ---------- nosy: +rpcope1 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 02:40:51 2016 From: report at bugs.python.org (Eryk Sun) Date: Tue, 29 Mar 2016 06:40:51 +0000 Subject: [issue26658] test_os fails when run on Windows ramdisk In-Reply-To: <1459183766.58.0.185896673203.issue26658@psf.upfronthosting.co.za> Message-ID: <1459233651.74.0.873932090831.issue26658@psf.upfronthosting.co.za> Eryk Sun added the comment: > I'm inclined to believe that this is a bug in the ImDisk device driver Junctions, and other filesystem reparse points, are implemented by volume devices, not disk devices. NTFS and ReFS support reparse points, but FAT, FAT32, and exFAT do not. Does the current filesystem claim to support reparse points? Here's how to check this: import ctypes kernel32 = ctypes.WinDLL('kernel32', use_last_error=True) FILE_SUPPORTS_REPARSE_POINTS = 0x00000080 def volume_supports_reparse_points(root_path): flags = ctypes.c_uint() if not kernel32.GetVolumeInformationW(root_path, None, 0, None, None, ctypes.byref(flags), None , 0): raise ctypes.WinError(ctypes.get_last_error()) return bool(flags.value & FILE_SUPPORTS_REPARSE_POINTS) For example: >>> volume_supports_reparse_points('C:\\') True Win32JunctionTests creates a junction to the "Lib/test" directory in the current directory. It should create a temporary target directory instead of using "Lib/test". I installed ImDisk Virtual Disk 2.0.9 and was able to create a valid junction on an NTFS RAM disk. What are the steps required to reproduce the problem? ---------- nosy: +eryksun _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 02:51:02 2016 From: report at bugs.python.org (Robert Cope) Date: Tue, 29 Mar 2016 06:51:02 +0000 Subject: [issue26633] multiprocessing behavior combining daemon with non-daemon children inconsistent with threading In-Reply-To: <1458789435.04.0.43504353002.issue26633@psf.upfronthosting.co.za> Message-ID: <1459234262.16.0.805037051539.issue26633@psf.upfronthosting.co.za> Changes by Robert Cope : ---------- nosy: +rpcope1 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 03:14:25 2016 From: report at bugs.python.org (Martin Panter) Date: Tue, 29 Mar 2016 07:14:25 +0000 Subject: [issue26638] Avoid warnings about missing CLI options when building documentation In-Reply-To: <1458881380.09.0.599104229044.issue26638@psf.upfronthosting.co.za> Message-ID: <1459235665.89.0.399030184608.issue26638@psf.upfronthosting.co.za> Martin Panter added the comment: FTR the warnings that I am fixing were apparently enabled in Sphinx 1.3.4, reverted in 1.3.6, and added in 1.4. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 04:02:24 2016 From: report at bugs.python.org (Udo Eberhardt) Date: Tue, 29 Mar 2016 08:02:24 +0000 Subject: [issue26655] pathlib glob case sensitivity issue on Windows In-Reply-To: <1459171442.9.0.718616645463.issue26655@psf.upfronthosting.co.za> Message-ID: <1459238544.27.0.825805273603.issue26655@psf.upfronthosting.co.za> Udo Eberhardt added the comment: So this is a trade-off between consistent behavior and efficiency. My point of view is that glob is for enumerating matching files and it should consistently return the real file names. Typically glob will be called with a pattern like '*.txt' and it will have to iterate names anyway, right? In the special case that it is called with a literal name it could do the same to produce consistent results. A user who wants to check (more efficiently) if a literal name exists, can use Path.exists(). The statement in the doc could be: Note: To find the literal names in the file system, glob always enumerates files and directories. To check more efficiently whether a specific file exists, use exists(). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 04:11:19 2016 From: report at bugs.python.org (SilentGhost) Date: Tue, 29 Mar 2016 08:11:19 +0000 Subject: [issue26660] tempfile.TemporaryDirectory() cleanup exception on Windows if readonly files created In-Reply-To: <1459203748.81.0.389724870435.issue26660@psf.upfronthosting.co.za> Message-ID: <1459239079.24.0.580095160742.issue26660@psf.upfronthosting.co.za> Changes by SilentGhost : ---------- nosy: +georg.brandl versions: +Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 04:16:06 2016 From: report at bugs.python.org (SilentGhost) Date: Tue, 29 Mar 2016 08:16:06 +0000 Subject: [issue26659] slice() leaks memory when part of a cycle In-Reply-To: <1459195650.62.0.697543008617.issue26659@psf.upfronthosting.co.za> Message-ID: <1459239366.37.0.658956129061.issue26659@psf.upfronthosting.co.za> Changes by SilentGhost : ---------- nosy: +benjamin.peterson, georg.brandl, pitrou, yselivanov _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 05:29:25 2016 From: report at bugs.python.org (Roundup Robot) Date: Tue, 29 Mar 2016 09:29:25 +0000 Subject: [issue25911] Regression: os.walk now using os.scandir() breaks bytes filenames on windows In-Reply-To: <1450539578.39.0.976654454489.issue25911@psf.upfronthosting.co.za> Message-ID: <20160329092922.53134.83344.89368DA8@psf.io> Roundup Robot added the comment: New changeset 2b25fa7e3b7a by Victor Stinner in branch 'default': Fix os._DummyDirEntry.is_symlink() https://hg.python.org/cpython/rev/2b25fa7e3b7a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 05:36:36 2016 From: report at bugs.python.org (Thomas) Date: Tue, 29 Mar 2016 09:36:36 +0000 Subject: [issue26657] Directory traversal with http.server and SimpleHTTPServer on windows In-Reply-To: <1459179015.77.0.509336394494.issue26657@psf.upfronthosting.co.za> Message-ID: <1459244196.0.0.699321548626.issue26657@psf.upfronthosting.co.za> Thomas added the comment: Martin Panter: Regarding the warning, you appear to be correct. However, reading the source of http.server again made me notice _url_collapse_path(path) which seems to have some overlap with translate_path. Also it crashes with an IndexError if path contains '..'. Also, yes, python 2.7's SimpleHTTPServer is affected as well. Discarding weird paths instead of trying to repair them would change semantics, but from a user perspective, it would be easier to understand what is going on, so I'd agree with that change. Further, I agree that it would be nice if there was some library function to safely handle path operations. The function you proposed in https://bugs.python.org/issue21109#msg216675 and https://bitbucket.org/vadmium/pyrescene/src/34264f6/rescene/utility.py#cl-217 leaves handling path separators to the user. Maybe that should be handled as well? The function withstood my fuzzing tests on windows, so it might be correct. There is probably a good reason for disallowing paths that contain /dev/null but I don't know why. Could you add a word or two of documentation to explain? A really high-level solution would be to do away with all the strings and handle paths properly as the structure that they represent instead of trying to fake all kinds of things with strings, but that is probably beyond the scope of this issue. ---------- versions: +Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 05:46:34 2016 From: report at bugs.python.org (Xiang Zhang) Date: Tue, 29 Mar 2016 09:46:34 +0000 Subject: [issue26657] Directory traversal with http.server and SimpleHTTPServer on windows In-Reply-To: <1459179015.77.0.509336394494.issue26657@psf.upfronthosting.co.za> Message-ID: <1459244794.03.0.955718209848.issue26657@psf.upfronthosting.co.za> Xiang Zhang added the comment: Url handling in http.server is not perfect and there have already been some issues talking about it, i.e, issue5714, issue14567. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 05:53:01 2016 From: report at bugs.python.org (STINNER Victor) Date: Tue, 29 Mar 2016 09:53:01 +0000 Subject: [issue26647] Wordcode In-Reply-To: <1459034868.93.0.159802163565.issue26647@psf.upfronthosting.co.za> Message-ID: <1459245181.46.0.98481358496.issue26647@psf.upfronthosting.co.za> STINNER Victor added the comment: Sorry, I don't have the context. Can you please explain your change? What did you do? What is the rationale? Do you expect better performances? If yes, please run the Python benchmark suite and post results here. What is the new format of bytecode? etc. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 06:04:34 2016 From: report at bugs.python.org (SilentGhost) Date: Tue, 29 Mar 2016 10:04:34 +0000 Subject: [issue25805] Failure in test_pkgutil run from command-line In-Reply-To: <1449306484.59.0.680027150317.issue25805@psf.upfronthosting.co.za> Message-ID: <1459245874.93.0.329935411998.issue25805@psf.upfronthosting.co.za> Changes by SilentGhost : ---------- nosy: +r.david.murray versions: +Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 06:09:12 2016 From: report at bugs.python.org (Robert Kuska) Date: Tue, 29 Mar 2016 10:09:12 +0000 Subject: [issue26661] python fails to locate system libffi Message-ID: <1459246152.22.0.57778057602.issue26661@psf.upfronthosting.co.za> New submission from Robert Kuska: Python fails to locate system version of ffi when building. We delete bundled version of ffi and build process fail with following error: error: [Errno 2] No such file or directory: '/builddir/build/BUILD/Python-3.5.1/Modules/_ctypes/libffi' This is caused by setup.py at 1993 checking only for '#define LIBFFI_H' within ffi.h. Content of /usr/include/ffi.h: > $ cat /usr/include/ffi.h /* This file is here to prevent a file conflict on multiarch systems. */ #ifdef ffi_wrapper_h #error "Do not define ffi_wrapper_h!" #endif #define ffi_wrapper_h #if defined(__i386__) #include "ffi-i386.h" #elif defined(__powerpc64__) #include "ffi-ppc64.h" #elif defined(__powerpc__) #include "ffi-ppc.h" #elif defined(__s390x__) #include "ffi-s390x.h" #elif defined(__s390__) #include "ffi-s390.h" #elif defined(__x86_64__) #include "ffi-x86_64.h" #else #error "The libffi-devel package is not usable with the architecture." #endif #undef ffi_wrapper_h It is important to note that this content is Fedora specific. As a workaround we (Fedora) use attached patch. Would it be plausible to accept this patch in upstream? ---------- components: Build files: 00184-ctypes-should-build-with-libffi-multilib-wrapper.patch keywords: patch messages: 262598 nosy: rkuska priority: normal severity: normal status: open title: python fails to locate system libffi type: compile error Added file: http://bugs.python.org/file42320/00184-ctypes-should-build-with-libffi-multilib-wrapper.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 06:36:34 2016 From: report at bugs.python.org (David Bolen) Date: Tue, 29 Mar 2016 10:36:34 +0000 Subject: [issue25911] Regression: os.walk now using os.scandir() breaks bytes filenames on windows In-Reply-To: <1450539578.39.0.976654454489.issue25911@psf.upfronthosting.co.za> Message-ID: <1459247794.31.0.574279942344.issue25911@psf.upfronthosting.co.za> David Bolen added the comment: I'm including some comments here from an email thread I had with Victor about this issue on the Win8 buildbot, which led to his recent changeset 2b25fa7e3b7a. The Win8 3.x failure (the 5 != 4 length error) was due to the revision of os._DummyDirEntry (introduced I believe in eb91d0387d59) using stat() rather than lstat() to check for a symbolic link, which couldn't work, which in turn failed to exclude the symbolic directory link from the walk in the test. The 3.5 branch failure about the mis-matched tuple values from the walk is a separate issue, where the broken directory link is still counted as a directory (rather than a file). It seems due to os.path.isdir() - in the older os._DummyDirEntry implementation - returning True for the broken link in the test, rather than False as on Unix. That's because on Unix the underlying os.stat call fails, but on Windows isdir is replaced with nt._isdir which avoids os.stat but is just a shim for. The success on Windows sort of makes sense since the target_is_directory parameter to os.symlink() was used to create the broken link in the test, so Windows knows it's a directory, even if the link target is missing. If the bytes walk implementation needs to treat broken links like files on Windows (matching the non-bytes version), then it can't depend on isdir() failing. The non-bytes version (using scandir()) works even on Windows since internally scandir appears to build up mode bits out of os.stat/os.lstat calls and never uses isdir. Back-porting the 3.x implementation of DummyDirEntry would be one quick way to fix the 3.5 issue as it also avoids isdir(). BTW, with respect to changeset 2b25fa7e3b7a, I'm not sure it has quite the right semantics for is_dir, at least not if it's supposed to parallel os.path.isdir(). I believe that should return True for a symbolic link to a directory, which it doesn't look like this change would, if is_symlink happened to have been called first. It's possible the semantics of how _DummyDirEntry is used precludes that scenario, but it seems a little fragile. I'd probably just use lstat() for is_symlink, but otherwise not touch is_dir. Finally, as to why this only showed up on the Win8 buildbot - it turns out that's the only machine where the tests could create a symbolic link and thus encounter the scenario - they were prevented on Win7 and Win10 under the normal buildbot user due to lack of privileges (which was a surprise to me). That's also what was happening on Victor's local Win8 VM. So the failing conditions were just being skipped. The Win8 buildbot was itself sort of pure luck, as early on I must have set it up to run under an elevated (administrative) command prompt, probably due to trying to handle some other issue. I've now done the same thing for Win10 so it began seeing the same failures in the last few tests. ---------- nosy: +db3l _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 06:38:23 2016 From: report at bugs.python.org (STINNER Victor) Date: Tue, 29 Mar 2016 10:38:23 +0000 Subject: [issue26662] FreeBSD: "invalid slot offset" error on _ssl, _curses_panel and _testmultiphase extensions Message-ID: <1459247902.98.0.893274525942.issue26662@psf.upfronthosting.co.za> New submission from STINNER Victor: I built Python 3.6 (default) on FreeBSD using: ./configure --cache-file=config_debug.cache --with-pydebug CFLAGS=-O0 make I'm using FreeBSD current, uname -a: FreeBSD freebsd 11.0-CURRENT FreeBSD 11.0-CURRENT #0 r296485: Tue Mar 8 07:04:36 UTC 2016 root at releng2.nyi.freebsd.org:/usr/obj/usr/src/sys/GENERIC amd64 It looks like "cc" is clang LLVM compiler 3.8.0. Extract of the make output: --- [haypo at freebsd ~/prog/python/default]$ make running build running build_ext INFO: Can't locate Tcl/Tk libs and/or headers *** WARNING: importing extension "_testmultiphase" failed with : invalid slot offset *** WARNING: importing extension "_ssl" failed with : invalid slot offset *** WARNING: importing extension "_curses_panel" failed with : invalid slot offset --- ---------- messages: 262600 nosy: haypo priority: normal severity: normal status: open title: FreeBSD: "invalid slot offset" error on _ssl, _curses_panel and _testmultiphase extensions versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 06:54:15 2016 From: report at bugs.python.org (Robert Smallshire) Date: Tue, 29 Mar 2016 10:54:15 +0000 Subject: [issue26663] asyncio _UnixWritePipeTransport._close abandons unflushed writes Message-ID: <1459248855.31.0.82334593717.issue26663@psf.upfronthosting.co.za> New submission from Robert Smallshire: Note: This report is based on a close reading of the asyncio code, rather than having experienced defective behaviour in test or production. The documentation for BaseTransport.close() states: "Close the transport. If the transport has a buffer for outgoing data, buffered data will be flushed asynchronously." The _UnixWritePipeTransport._close method, which is called by close() contains this code in Python 3.5.1 def _close(self, exc=None): self._closing = True if self._buffer: self._loop.remove_writer(self._fileno) self._buffer.clear() self._loop.remove_reader(self._fileno) self._loop.call_soon(self._call_connection_lost, exc) In this context, _buffer is a list of bytes objects comprising yet-to-be-written data. Note that close() removes the writer if _buffer is *not* empty, so the buffered data will never be written. I believe this conditional should be inverted, so the writer is removed only if the buffer is *empty*. So: if not self._buffer: self._loop.remove_writer(self._fileno) Arguably though, a more robust and easier to read test would be to call get_write_buffer_size(), like this: if self.get_write_buffer_size() == 0: self._loop.remove_writer(self._fileno) Note that in the event that the writer is not removed by _close(), the writer will remove itself when the buffer does eventually become empty. Assuming my analysis is correct, and a fix is made to close(), then abort() will also need to be modified to *not* flush buffered writes, as the documentation for abort() states "Close the transport immediately, without waiting for pending operations to complete. Buffered data will be lost." ---------- components: asyncio messages: 262601 nosy: Robert Smallshire, gvanrossum, haypo, yselivanov priority: normal severity: normal status: open title: asyncio _UnixWritePipeTransport._close abandons unflushed writes versions: Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 06:54:31 2016 From: report at bugs.python.org (Robert Smallshire) Date: Tue, 29 Mar 2016 10:54:31 +0000 Subject: [issue26663] asyncio _UnixWritePipeTransport._close abandons unflushed writes In-Reply-To: <1459248855.31.0.82334593717.issue26663@psf.upfronthosting.co.za> Message-ID: <1459248871.1.0.654180651496.issue26663@psf.upfronthosting.co.za> Changes by Robert Smallshire : ---------- type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 06:55:04 2016 From: report at bugs.python.org (STINNER Victor) Date: Tue, 29 Mar 2016 10:55:04 +0000 Subject: [issue26662] FreeBSD: "invalid slot offset" error on _ssl, _curses_panel and _testmultiphase extensions In-Reply-To: <1459247902.98.0.893274525942.issue26662@psf.upfronthosting.co.za> Message-ID: <1459248904.21.0.346977974246.issue26662@psf.upfronthosting.co.za> STINNER Victor added the comment: Oh ok, I understood the issue. --- [haypo at freebsd ~/prog/python/default]$ rm Objects/typeslots.inc [haypo at freebsd ~/prog/python/default]$ make python ./Objects/typeslots.py < ./Include/typeslots.h > Objects/typeslots.inc /bin/sh: python: not found *** Error code 127 Stop. make: stopped in /home/haypo/prog/python/default --- I have "python2" and "python3" but no "python" on FreeBSD CURRENT. The configure script is smart enough to select "python3" as the ASDL generator, but it uses $(PYTHON) ("python") to build Objects/typeslots.inc. We should use a smarter code to select the external "python" program to build Objects/typeslots.inc. Moreover, when "make Objects/typeslots.inc" fails, it creates an empty Objects/typeslots.inc file: --- Objects/typeobject.o: Objects/typeslots.inc Objects/typeslots.inc: $(srcdir)/Include/typeslots.h $(srcdir)/Objects/typeslots.py $(PYTHON) $(srcdir)/Objects/typeslots.py < $(srcdir)/Include/typeslots.h > Objects/typeslots.inc --- The Objects/typeslots.inc should be written directly by Objects/typeslots.py. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 07:06:25 2016 From: report at bugs.python.org (STINNER Victor) Date: Tue, 29 Mar 2016 11:06:25 +0000 Subject: [issue26624] Windows hangs in call to CRT setlocale() In-Reply-To: <1458747871.12.0.710719467032.issue26624@psf.upfronthosting.co.za> Message-ID: <1459249585.13.0.790555458346.issue26624@psf.upfronthosting.co.za> STINNER Victor added the comment: Jeremy: Did you update your buildbot? It looks like the deadlock occurred again: ------------- http://buildbot.python.org/all/builders/AMD64%20Windows7%20SP1%203.x/builds/7478/steps/test/logs/stdio (...) 0:14:50 [398/400] test_concurrent_futures (101 sec) -- running: test_strptime (40 sec) 0:14:52 [399/400] test_ssl -- running: test_strptime (42 sec) command timed out: 1200 seconds without output, attempting to kill program finished with exit code 1 elapsedTime=2096.738000 ------------- By the way, I don't understand why the faulthandler watch dog thread is unable to kill the main process and dump a traceback. I recently added a "faulthandler.dump_traceback_later" call Lib/test/libregrtest/runtest_mp.py. It uses a timeout of 15 min, it looks like buildbot kills the process after a timeout of 20 minutes "without output". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 07:34:49 2016 From: report at bugs.python.org (Roundup Robot) Date: Tue, 29 Mar 2016 11:34:49 +0000 Subject: [issue26643] regrtest: rework libregrtest.save_env submodule In-Reply-To: <1458930024.17.0.00462396415924.issue26643@psf.upfronthosting.co.za> Message-ID: <20160329113444.40498.88668.E8F14B19@psf.io> Roundup Robot added the comment: New changeset c5944a76697b by Victor Stinner in branch '3.5': Issue #26643: Add missing shutil resources to regrtest.py https://hg.python.org/cpython/rev/c5944a76697b ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 07:47:29 2016 From: report at bugs.python.org (Roundup Robot) Date: Tue, 29 Mar 2016 11:47:29 +0000 Subject: [issue25911] Regression: os.walk now using os.scandir() breaks bytes filenames on windows In-Reply-To: <1450539578.39.0.976654454489.issue25911@psf.upfronthosting.co.za> Message-ID: <20160329114726.462.44007.A7177C10@psf.io> Roundup Robot added the comment: New changeset c38ac7ab8d9a by Victor Stinner in branch '3.5': Issue #25911: Backport os._DummyDirEntry fixes https://hg.python.org/cpython/rev/c38ac7ab8d9a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 07:58:44 2016 From: report at bugs.python.org (STINNER Victor) Date: Tue, 29 Mar 2016 11:58:44 +0000 Subject: [issue25911] Regression: os.walk now using os.scandir() breaks bytes filenames on windows In-Reply-To: <1450539578.39.0.976654454489.issue25911@psf.upfronthosting.co.za> Message-ID: <1459252724.78.0.806143062009.issue25911@psf.upfronthosting.co.za> STINNER Victor added the comment: > BTW, with respect to changeset 2b25fa7e3b7a, I'm not sure it has quite the right semantics for is_dir, at least not if it's supposed to parallel os.path.isdir(). I believe that should return True for a symbolic link to a directory, which it doesn't look like this change would, if is_symlink happened to have been called first. It's possible the semantics of how _DummyDirEntry is used precludes that scenario, but it seems a little fragile. I'd probably just use lstat() for is_symlink, but otherwise not touch is_dir. I think that you misunderstood the code. The "use cache lstat" path is only taken if the file is *not* symbolic link. I tested manually _DummyDirEntry on a symbolic link to a directory: _lstat is filled by the constructor, is_dir() *and* is_symlink() returns True. Both are not exclusive, is_dir() works as follow_symlinks=True, whereas is_symlink() works as follow_symlinks=False. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 08:02:49 2016 From: report at bugs.python.org (STINNER Victor) Date: Tue, 29 Mar 2016 12:02:49 +0000 Subject: [issue25911] Regression: os.walk now using os.scandir() breaks bytes filenames on windows In-Reply-To: <1450539578.39.0.976654454489.issue25911@psf.upfronthosting.co.za> Message-ID: <1459252969.69.0.245520278308.issue25911@psf.upfronthosting.co.za> STINNER Victor added the comment: Since all test_os now pass again on 3.x buildbots (after a few months of red buildbots), I backported the _DummyDirEntry fixes to 3.5. David: > The 3.5 branch failure about the mis-matched tuple values from the walk is a separate issue, (...) I'm sorry, I don't understand you. The test_os failure was the same on Python 3.5 and 3.6: - ('@test_4312_tmp\\TEST1\\SUB2', ['broken_link', 'link'], ['tmp3']) ? ---------- + ('@test_4312_tmp\\TEST1\\SUB2', ['link'], ['broken_link', 'tmp3']) ? ++++++++++ This error should now be fixed on Python 3.5 and 3.6. Is there a remaining open issue related to os.scandir() (bytes or Unicode)? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 08:40:15 2016 From: report at bugs.python.org (iceboy) Date: Tue, 29 Mar 2016 12:40:15 +0000 Subject: [issue26654] asyncio is not inspecting keyword arguments of functools.partial In-Reply-To: <1459159050.15.0.830010057156.issue26654@psf.upfronthosting.co.za> Message-ID: <1459255215.91.0.445226846131.issue26654@psf.upfronthosting.co.za> iceboy added the comment: Created a PR https://github.com/python/asyncio/pull/328. Please review. Thanks. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 08:46:25 2016 From: report at bugs.python.org (=?utf-8?b?6YSt5pmv5paH?=) Date: Tue, 29 Mar 2016 12:46:25 +0000 Subject: [issue26664] find a bug in activate.fish of venv of cpython3.6 Message-ID: <1459255585.37.0.253753371111.issue26664@psf.upfronthosting.co.za> New submission from ???: I use venv module to make a virtual environment in cpython3.6. After it, I try to activate it with fish, but it give me an error, like the screenshot. I open the activate.fish and remove the $ sign in line 58 and 59, then the activate file works. I open the activate.fish of py3.5 venv, there isn't a $ sign in line 58 and 59, too. However, there is a bug issue which add the $ in front of the prompt. I'm not sure how this happen, but I think there should not be a $ there. ---------- files: screenshot.png messages: 262609 nosy: ??? priority: normal severity: normal status: open title: find a bug in activate.fish of venv of cpython3.6 Added file: http://bugs.python.org/file42321/screenshot.png _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 08:47:24 2016 From: report at bugs.python.org (=?utf-8?b?6YSt5pmv5paH?=) Date: Tue, 29 Mar 2016 12:47:24 +0000 Subject: [issue26664] find a bug in activate.fish of venv of cpython3.6 In-Reply-To: <1459255585.37.0.253753371111.issue26664@psf.upfronthosting.co.za> Message-ID: <1459255644.58.0.749914136192.issue26664@psf.upfronthosting.co.za> Changes by ??? : ---------- components: +Library (Lib) versions: +Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 08:48:22 2016 From: report at bugs.python.org (=?utf-8?b?6YSt5pmv5paH?=) Date: Tue, 29 Mar 2016 12:48:22 +0000 Subject: [issue26664] find a bug in activate.fish of venv of cpython3.6 In-Reply-To: <1459255585.37.0.253753371111.issue26664@psf.upfronthosting.co.za> Message-ID: <1459255702.91.0.782198541143.issue26664@psf.upfronthosting.co.za> Changes by ??? : ---------- type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 08:51:35 2016 From: report at bugs.python.org (SilentGhost) Date: Tue, 29 Mar 2016 12:51:35 +0000 Subject: [issue26664] find a bug in activate.fish of venv of cpython3.6 In-Reply-To: <1459255585.37.0.253753371111.issue26664@psf.upfronthosting.co.za> Message-ID: <1459255895.0.0.721426963293.issue26664@psf.upfronthosting.co.za> Changes by SilentGhost : ---------- nosy: +vinay.sajip _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 10:24:46 2016 From: report at bugs.python.org (Axel Luttgens) Date: Tue, 29 Mar 2016 14:24:46 +0000 Subject: [issue26665] pip is not bootstrapped by default Message-ID: <1459261486.77.0.745706792357.issue26665@psf.upfronthosting.co.za> New submission from Axel Luttgens: Relevant page: ????https://docs.python.org/2/library/ensurepip.html One may read: ????In most cases, end users of Python shouldn?t need to invoke ????this module directly (as pip should be bootstrapped by default), ????but it may be needed if installing pip was skipped when ????installing Python (or when creating a virtual environment) or ????after explicitly uninstalling pip. As far as I correctly read the configure file that comes with the 2.7.11 tarball, the default is to behave as if --with-ensurepip=no had been passed. As a result, that sentence fragment: ????(as pip should be bootstrapped by default) may appear somewhat ambiguous for those compiling Python themselves. Perhaps could this one avoid some head scratching: ????(as packagers are expected to have bootstrapped pip) HTH, Axel ---------- assignee: docs at python components: Documentation messages: 262610 nosy: Axel, docs at python priority: normal severity: normal status: open title: pip is not bootstrapped by default type: enhancement versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 10:26:34 2016 From: report at bugs.python.org (Axel Luttgens) Date: Tue, 29 Mar 2016 14:26:34 +0000 Subject: [issue26665] pip is not bootstrapped by default on 2.7 In-Reply-To: <1459261486.77.0.745706792357.issue26665@psf.upfronthosting.co.za> Message-ID: <1459261594.76.0.742531551714.issue26665@psf.upfronthosting.co.za> Changes by Axel Luttgens : ---------- title: pip is not bootstrapped by default -> pip is not bootstrapped by default on 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 10:41:03 2016 From: report at bugs.python.org (Steve Dower) Date: Tue, 29 Mar 2016 14:41:03 +0000 Subject: [issue26624] Windows hangs in call to CRT setlocale() In-Reply-To: <1458747871.12.0.710719467032.issue26624@psf.upfronthosting.co.za> Message-ID: <1459262463.41.0.456198642353.issue26624@psf.upfronthosting.co.za> Steve Dower added the comment: The deadlock is between a CRT thread initialization lock and Windows's process-wide module initialization lock. So if anything is being loaded on demand by the watchdog thread, it's probably locked too (and that could be within the CRT or the OS, so not easy to identify). I'm still keen to get some version numbers off the build machine, mainly ucrtbased.dll. I'd add code to the build process to just dump them, but I can't get to that for at least a week right now, so if Jeremy can provide it we can rule in/out some possibilities. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 11:27:22 2016 From: report at bugs.python.org (Raymond Hettinger) Date: Tue, 29 Mar 2016 15:27:22 +0000 Subject: [issue26488] hashlib command line interface In-Reply-To: <1457214866.19.0.989950954277.issue26488@psf.upfronthosting.co.za> Message-ID: <1459265242.34.0.814641101207.issue26488@psf.upfronthosting.co.za> Changes by Raymond Hettinger : ---------- assignee: -> rhettinger nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 11:28:41 2016 From: report at bugs.python.org (Zack Weinberg) Date: Tue, 29 Mar 2016 15:28:41 +0000 Subject: [issue26666] File object hook to modify select(ors) event mask Message-ID: <1459265321.27.0.359178089762.issue26666@psf.upfronthosting.co.za> New submission from Zack Weinberg: This is pretty esoteric, please bear with me. I'm attempting to enhance a transparent-SOCKS module (https://github.com/Anorov/PySocks) to support non-blocking connect(). This means, you should be able to do this: socks.set_default_proxy(socks.SOCKS5, "localhost") s = socks.socksocket(socket.AF_INET, socket.SOCK_STREAM) s.setblocking(False) err = s.connect_ex(address) if err == errno.EINPROGRESS: select.select([], [s], []) # returns when connection completes Note the position of s in the select() arguments: the documented behavior of non-blocking connect(), at the operating system level, is that the socket will become *writable* when the connection resolves (whether successfully or not). However, in this case, under the hood, the socket is *already connected* -- to the proxy server -- after socksocket() returns. When connect_ex() returns EINPROGRESS, the thing we're really waiting for is a SOCKS-protocol reply message, i.e. the socket needs to become *readable* before the application can continue. An application that used the above code (with a hypothetical version of PySocks where this was supported) would get woken up immediately, since the initial SOCKS client->server message doesn't even come close to filling up the TCP send buffer. There's no practical way to hide this divergence with the current library. What would be needed, I think, is a pair of new special methods on filelikes, which rewrite the set of events to listen for and the set of events to report. Hypothetical, for my use case: def __preselect__(self, events): if not self._connecting: return events return selectors.EVENT_READ def __postselect__(self, events): if not self._connecting: return events return selectors.EVENT_WRITE (I'm using the high-level selectors.EVENT_* constants for illustration. This needs to happen in the low-level select-module methods, because callers can't be expected to use selectors.) There are a bunch of awkward corner cases to worry about with this, and I'm not even sure the feature is worth it, but I thought I'd write up the problem and see what other people think. ---------- components: IO messages: 262612 nosy: zwol priority: normal severity: normal status: open title: File object hook to modify select(ors) event mask type: enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 11:29:08 2016 From: report at bugs.python.org (Raymond Hettinger) Date: Tue, 29 Mar 2016 15:29:08 +0000 Subject: [issue26488] hashlib command line interface In-Reply-To: <1457214866.19.0.989950954277.issue26488@psf.upfronthosting.co.za> Message-ID: <1459265348.74.0.877481931203.issue26488@psf.upfronthosting.co.za> Raymond Hettinger added the comment: Here is a quick check versus other command-line tools: $ md5 xml_prolog.diff MD5 (xml_prolog.diff) = c30e1fe70651d5a472efe9598db70771 $ python3.6 -m hashlib md5 xml_prolog.diff c30e1fe70651d5a472efe9598db70771 $ shasum -a 1 xml_prolog.diff db5fd60f3002ed270fe4469c7f343aba515d9b1a xml_prolog.diff $ python3.6 -m hashlib sha1 xml_prolog.diff db5fd60f3002ed270fe4469c7f343aba515d9b1a $ shasum -a 224 xml_prolog.diff d0d18eb3e4d71269a610308e51e49d8b4650134bf2757dd22d69430b xml_prolog.diff $ python3.6 -m hashlib sha224 xml_prolog.diff d0d18eb3e4d71269a610308e51e49d8b4650134bf2757dd22d69430b $ shasum -a 256 xml_prolog.diff 0bbd834589d5fc9e26e32e5c665de4a2fbd93ea3bb4688ea25ef1139cd152b09 xml_prolog.diff $ python3.6 -m hashlib sha256 xml_prolog.diff 0bbd834589d5fc9e26e32e5c665de4a2fbd93ea3bb4688ea25ef1139cd152b09 $ shasum -a 384 xml_prolog.diff f627b6c2bdc95e1af00da2a4b5d3897284127d0e820963f60758e34e5cfeb64cb529bfb306789f73c91d58d7594a3f3b xml_prolog.diff $ python3.6 -m hashlib sha384 xml_prolog.diff f627b6c2bdc95e1af00da2a4b5d3897284127d0e820963f60758e34e5cfeb64cb529bfb306789f73c91d58d7594a3f3b $ shasum -a 512 xml_prolog.diff c93babfef5a25bb569e4fd5c6edbb6d5e1de92044576b68522abcd9d9a356eca6b791df97a08e5c75cd090f00d5f2f73d940b901796b190681d370e5da74e4d8 xml_prolog.diff $ python3.6 -m hashlib sha512 xml_prolog.diff c93babfef5a25bb569e4fd5c6edbb6d5e1de92044576b68522abcd9d9a356eca6b791df97a08e5c75cd090f00d5f2f73d940b901796b190681d370e5da74e4d8 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 11:36:10 2016 From: report at bugs.python.org (SilentGhost) Date: Tue, 29 Mar 2016 15:36:10 +0000 Subject: [issue26488] hashlib command line interface In-Reply-To: <1457214866.19.0.989950954277.issue26488@psf.upfronthosting.co.za> Message-ID: <1459265770.03.0.372007757825.issue26488@psf.upfronthosting.co.za> SilentGhost added the comment: I've left some comment on rietveld yesterday, not sure if you got the e-mail. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 11:36:11 2016 From: report at bugs.python.org (Raymond Hettinger) Date: Tue, 29 Mar 2016 15:36:11 +0000 Subject: [issue26488] hashlib command line interface In-Reply-To: <1457214866.19.0.989950954277.issue26488@psf.upfronthosting.co.za> Message-ID: <1459265771.25.0.108644612252.issue26488@psf.upfronthosting.co.za> Raymond Hettinger added the comment: Overall, I'm +1 on the idea and think the patch looks good. There are two issues to look at: 1) Neither the md5 or shasum command-line tools offer control over the blocksize. I suggest that option be dropped from the command-line API giving a nice simplification and usability improvement. The stdin option has issues: $ md5 abc 0bee89b07a248e27c83fc3d5951213c1 $ python3.6 -m hashlib md5 abc ^D ^CTraceback (most recent call last): File "/Users/raymond/cpython/Lib/runpy.py", line 184, in _run_module_as_main "__main__", mod_spec) File "/Users/raymond/cpython/Lib/runpy.py", line 85, in _run_code exec(code, run_globals) File "/Users/raymond/cpython/Lib/hashlib.py", line 246, in main() File "/Users/raymond/cpython/Lib/hashlib.py", line 238, in main data = args.file.read(args.block_size) KeyboardInterrupt ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 11:40:41 2016 From: report at bugs.python.org (Demur Rumed) Date: Tue, 29 Mar 2016 15:40:41 +0000 Subject: [issue26647] Wordcode In-Reply-To: <1459034868.93.0.159802163565.issue26647@psf.upfronthosting.co.za> Message-ID: <1459266041.79.0.349001120247.issue26647@psf.upfronthosting.co.za> Demur Rumed added the comment: I'll dig up benchmark results when I get home, but I'd be interested to get results on a less wannabe RISC CPU The change is to have all instructions take an argument. This removes the branch on each instruction on whether to load oparg. It then also aligns instructions to always be 2 bytes rather than 1 or 3 by having arguments only take up 1 byte. In the case that an argument to an instruction is greater than 255, it can chain EXTENDED_ARG up to 3 times. In practice this rarely occurs, mostly only for jumps, & abarnert measured stdlib to be ~5% smaller The rationale is that this offers 3 benefits: Smaller code size, simpler instruction iteration/indexing (One may now scan backwards, as peephole.c does in this patch), which between the two results in a small perf gain (the only way for perf to be negatively impacted is by an increase in EXTENDED_ARGs, when I post benchmarking I'll also post a count of how many more EXTENDED_ARGs are emitted) This also means that if I want to create something like a tracer that tracks some information for each instruction, I can allocate an array of codesize/2 bytes, then index off of half the instruction index. This isn't currently done in peephole.c, nor does this include halving jump opargs I've looked up the 'recent work to cache attribute/global lookup' issue I mentioned: http://bugs.python.org/issue26219 I believe that patch would benefit from this one, but it'd be better to get Yury's opinion that belief ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 11:59:30 2016 From: report at bugs.python.org (Paul Morelle) Date: Tue, 29 Mar 2016 15:59:30 +0000 Subject: [issue18987] distutils.utils.get_platform() for 32-bit Python on a 64-bit machine In-Reply-To: <1378731781.77.0.0136191125302.issue18987@psf.upfronthosting.co.za> Message-ID: <1459267170.63.0.359962602605.issue18987@psf.upfronthosting.co.za> Changes by Paul Morelle : ---------- nosy: +madprog _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 13:38:04 2016 From: report at bugs.python.org (Barry A. Warsaw) Date: Tue, 29 Mar 2016 17:38:04 +0000 Subject: [issue26632] __all__ decorator In-Reply-To: <1459182406.63.0.129875181602.issue26632@psf.upfronthosting.co.za> Message-ID: <20160329133801.16aa684f@subdivisions.wooz.org> Barry A. Warsaw added the comment: On Mar 28, 2016, at 04:26 PM, Serhiy Storchaka wrote: >There is a helper in test.support that helps to add a test for __all__, and >we slowly add these test for all modules. So this is not large issue for the >stdlib. > >New module level names are added not very often. Keeping __all__ in sync is >not the largest problem in the maintaining. stdlib use is not really the point of this proposal. It's for all those 3rd party projects that use __all__. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 14:22:54 2016 From: report at bugs.python.org (Brett Cannon) Date: Tue, 29 Mar 2016 18:22:54 +0000 Subject: [issue26667] Update importlib to accept pathlib.Path objects Message-ID: <1459275774.9.0.416740988554.issue26667@psf.upfronthosting.co.za> New submission from Brett Cannon: We should go through importlib and update the various APIs to accept pathlib.Path objects and not just str. ---------- messages: 262618 nosy: brett.cannon priority: normal severity: normal status: open title: Update importlib to accept pathlib.Path objects type: enhancement versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 14:48:27 2016 From: report at bugs.python.org (Mike Lissner) Date: Tue, 29 Mar 2016 18:48:27 +0000 Subject: [issue10682] With '*args' or even bare '*' in def/call argument list, trailing comma causes SyntaxError In-Reply-To: <1292128202.55.0.0300342497244.issue10682@psf.upfronthosting.co.za> Message-ID: <1459277307.08.0.164277187103.issue10682@psf.upfronthosting.co.za> Mike Lissner added the comment: This is an old issue, but where I run into it frequently is when I use the format function and string interpolation. For example, this throws a SyntaxError: "The name of the person is {name_first} {name_last}".format( **my_obj.__dict__, ) Because strings tend to be fairly long, it's pretty common that the arguments to format end up on their own line. I was always taught to use trailing commas in Python, and I'm fanatical about ensuring they're there. It's a smart part of the language that saves you from many bugs and much typing when copy/pasting/tweaking. This is the first time I've ever run into an implementation bug in CPython, and at least from the post on StackOverflow, this looks like the parser isn't obeying the grammar: https://stackoverflow.com/questions/16950394/python-why-is-this-invalid-syntax ---------- nosy: +Mike.Lissner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 14:49:21 2016 From: report at bugs.python.org (Vinay Sajip) Date: Tue, 29 Mar 2016 18:49:21 +0000 Subject: [issue26664] find a bug in activate.fish of venv of cpython3.6 In-Reply-To: <1459255585.37.0.253753371111.issue26664@psf.upfronthosting.co.za> Message-ID: <1459277361.73.0.851087551703.issue26664@psf.upfronthosting.co.za> Vinay Sajip added the comment: The change you mention was in response to Issue #26348. The patch supplied there introduced the $ characters you say aren't required. I'm not a fish user, but it would seem that "$__VENV_PROMPT__" would resolve to the *value* of the environment variable __VENV_PROMPT__, whereas "__VENV_PROMPT__" would just resolve to the literal string "__VENV_PROMPT__" which doesn't seem like what is wanted. Can you explain the reasoning by which you assert that the $ isn't wanted? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 14:51:44 2016 From: report at bugs.python.org (Vinay Sajip) Date: Tue, 29 Mar 2016 18:51:44 +0000 Subject: [issue26606] logging.baseConfig is missing the encoding parameter In-Reply-To: <1458598626.88.0.490041392552.issue26606@psf.upfronthosting.co.za> Message-ID: <1459277504.55.0.508081394521.issue26606@psf.upfronthosting.co.za> Vinay Sajip added the comment: But you can open a stream using the encoding you want and pass it as the stream= parameter to basicConfig(). Why does that not work for you? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 14:53:38 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 29 Mar 2016 18:53:38 +0000 Subject: [issue26667] Update importlib to accept pathlib.Path objects In-Reply-To: <1459275774.9.0.416740988554.issue26667@psf.upfronthosting.co.za> Message-ID: <1459277618.82.0.485624727674.issue26667@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- dependencies: +Support Path objects in the posix module _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 16:20:13 2016 From: report at bugs.python.org (STINNER Victor) Date: Tue, 29 Mar 2016 20:20:13 +0000 Subject: [issue26647] Wordcode In-Reply-To: <1459034868.93.0.159802163565.issue26647@psf.upfronthosting.co.za> Message-ID: <1459282813.49.0.455482321709.issue26647@psf.upfronthosting.co.za> STINNER Victor added the comment: > This also means that if I want to create something like a tracer that tracks some information for each instruction, I can allocate an array of codesize/2 bytes, then index off of half the instruction index. This isn't currently done in peephole.c, nor does this include halving jump opargs There is something called "inline caching": put the cache between instructions, in the same memory block. Example of paper on CPython: "Efficient Inline Caching without Dynamic Translation" by Stefan Brunthaler (2009) https://www.sba-research.org/wp-content/uploads/publications/sac10.pdf Yury's approach is a standard lookup table: offset => cache. In the issue #26219, he even used two tables: co->co_opt_opcodemap is an array mapping an instruction offset to the offset in the cache, then the second offset is used to retrieve cache data from a second array. You have 3 structures (co_code, co_opt_opcodemap, co_opt), whereas inline caching propose to only use one flat structure (a single array). The paper promises "improved data locality and instruction decoding effciency". but "The new combined data-structure requires significantly more space?two native machine words for each instruction byte. To compensate for the additional space requirements, we use a profiling infrastructure to decide when to switch to this new instruction encoding at run time." Memory footprint and detection of hot code is handled in the issue #26219. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 16:21:07 2016 From: report at bugs.python.org (STINNER Victor) Date: Tue, 29 Mar 2016 20:21:07 +0000 Subject: [issue26219] implement per-opcode cache in ceval In-Reply-To: <1453918500.26.0.0886095278127.issue26219@psf.upfronthosting.co.za> Message-ID: <1459282867.34.0.766385775821.issue26219@psf.upfronthosting.co.za> STINNER Victor added the comment: See the issue #26647 which may make the implementation of this cache simpler. See also my message about inline caching: https://bugs.python.org/issue26647#msg262622 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 16:32:48 2016 From: report at bugs.python.org (STINNER Victor) Date: Tue, 29 Mar 2016 20:32:48 +0000 Subject: [issue26647] Wordcode In-Reply-To: <1459034868.93.0.159802163565.issue26647@psf.upfronthosting.co.za> Message-ID: <1459283568.84.0.810397878066.issue26647@psf.upfronthosting.co.za> STINNER Victor added the comment: > The change is to have all instructions take an argument. This removes the branch on each instruction on whether to load oparg. (...) Oh ok, I like that :-) I had the same idea. Your patch contains unrelated changes, you should revert them to have a change simpler to review. Removing HAVE_ARGUMENT from opcode.h/dis.py doesn't seem like a good idea. IMHO it's stil useful for dis to show a more compact bytcode. For example, I expect "DUP_TOP", not "DUP_TOP 0", or worse "DUP_TOP 5". For backward compatibility, I also suggest to keep HAS_ARG() even if it must not be used to decode instructions anymore. The following obvious change is to use a pointer aligned to 16-bits for co_code to be able to use 16-bit instructions rather than two 8-bit instructions to retrieve the opcode and then the argument in ceval.c (see the issue #25823). I suggest to implement that later to keep the change as simple as possible. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 16:39:37 2016 From: report at bugs.python.org (Steven Basart) Date: Tue, 29 Mar 2016 20:39:37 +0000 Subject: [issue18844] allow weights in random.choice In-Reply-To: <1377537825.13.0.508607501106.issue18844@psf.upfronthosting.co.za> Message-ID: <1459283977.24.0.285015032599.issue18844@psf.upfronthosting.co.za> Steven Basart added the comment: Reopen this idea but removing the generator from weighted choice. ---------- nosy: +progressive-o Added file: http://bugs.python.org/file42322/weighted_choice_v3.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 16:54:00 2016 From: report at bugs.python.org (Demur Rumed) Date: Tue, 29 Mar 2016 20:54:00 +0000 Subject: [issue26647] Wordcode In-Reply-To: <1459034868.93.0.159802163565.issue26647@psf.upfronthosting.co.za> Message-ID: <1459284840.68.0.423494301732.issue26647@psf.upfronthosting.co.za> Changes by Demur Rumed : ---------- nosy: +abarnert _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 17:04:47 2016 From: report at bugs.python.org (Steven Basart) Date: Tue, 29 Mar 2016 21:04:47 +0000 Subject: [issue18844] allow weights in random.choice In-Reply-To: <1377537825.13.0.508607501106.issue18844@psf.upfronthosting.co.za> Message-ID: <1459285487.91.0.13071458926.issue18844@psf.upfronthosting.co.za> Steven Basart added the comment: The entire function of weighted choice. I removed the generator and replaced it by adding an optional argument to specify an amount by which you want to call this function. ---------- Added file: http://bugs.python.org/file42323/weighted_choice_v3.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 17:10:34 2016 From: report at bugs.python.org (STINNER Victor) Date: Tue, 29 Mar 2016 21:10:34 +0000 Subject: [issue26647] ceval: use Wordcode, 16-bit bytecode In-Reply-To: <1459034868.93.0.159802163565.issue26647@psf.upfronthosting.co.za> Message-ID: <1459285834.38.0.823944389167.issue26647@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- title: Wordcode -> ceval: use Wordcode, 16-bit bytecode _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 17:30:47 2016 From: report at bugs.python.org (STINNER Victor) Date: Tue, 29 Mar 2016 21:30:47 +0000 Subject: [issue26488] hashlib command line interface In-Reply-To: <1457214866.19.0.989950954277.issue26488@psf.upfronthosting.co.za> Message-ID: <1459287047.03.0.152024322166.issue26488@psf.upfronthosting.co.za> STINNER Victor added the comment: About the compatibility with existing tools, I recall a discussion when the tarfile module got a CLI. First I expected a clone of the UNIX tar command, but it was decided to design a new *simpler* CLI. --------------------------------------------------- $ python3 -m tarfile usage: tarfile.py [-h] [-v] [-l | -e [ ...] | -c [ ...] | -t ] A simple command line interface for tarfile module. optional arguments: -h, --help show this help message and exit -v, --verbose Verbose output -l , --list Show listing of a tarfile -e [ ...], --extract [ ...] Extract tarfile into target dir -c [ ...], --create [ ...] Create tarfile from sources -t , --test Test if a tarfile is valid --------------------------------------------------- A common trap of the md5sum CLI is that users write "echo string|md5sum" which adds a newline to string. For an unknown reason, my french manual page of the md5sum command has a -s STRING/--string=STRING argument, but not my effective md5sum program. Maybe we should consider adding such option to avoid the trap? Do you want to implement a function to compare computed hash to a file which contains the expected hash? Check for file integrity, md5sum -c FILE/--check=FILE. Example: ------ $ md5sum test_socket_with.patch > check $ cat check cfc1d69e76c827c32af4f28f50714a5e test_socket_with.patch $ md5sum -c check test_socket_with.patch: OK $ vim test_socket_with.patch $ md5sum -c check test_socket_with.patch: FAILED md5sum: WARNING: 1 computed checksum did NOT match ------ I worked hard to release the GIL when a hash is released. It would be super cool (a killer feature?) to automatically spawn threads to compute the hash. For example, use N threads where N is the number of CPU (os.cpu_count() or 1). Last time I wrote my md5sum.py, it was much faster than the UNIX md5sum tool since it uses all my CPU cores. You should just ensure that output is written in the correct order. Raymond wrote: > 1) Neither the md5 or shasum command-line tools offer control over the blocksize. I suggest that option be dropped from the command-line API giving a nice simplification and usability improvement. I agree. You should compute it per file using os.stat().st_blksize: https://docs.python.org/dev/library/os.html#os.stat_result.st_blksize The io module uses st_blksize if it is greater than 1, or 8 * 1024 bytes. (By the way, it looks like shutil.copyfile() doesn't use st_blksize.) ---------- nosy: +haypo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 17:31:55 2016 From: report at bugs.python.org (STINNER Victor) Date: Tue, 29 Mar 2016 21:31:55 +0000 Subject: [issue26488] hashlib command line interface In-Reply-To: <1457214866.19.0.989950954277.issue26488@psf.upfronthosting.co.za> Message-ID: <1459287115.47.0.865737647619.issue26488@psf.upfronthosting.co.za> STINNER Victor added the comment: > I think we should add a dependency in issue 14156 for this issue. Maybe you can start using strings for filename parameters and open files manually, and later consider switching back to FileType once it's fixed? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 17:36:21 2016 From: report at bugs.python.org (STINNER Victor) Date: Tue, 29 Mar 2016 21:36:21 +0000 Subject: [issue26666] File object hook to modify select(ors) event mask In-Reply-To: <1459265321.27.0.359178089762.issue26666@psf.upfronthosting.co.za> Message-ID: <1459287381.59.0.805885700468.issue26666@psf.upfronthosting.co.za> STINNER Victor added the comment: > I'm attempting to enhance a transparent-SOCKS module (https://github.com/Anorov/PySocks) to support non-blocking connect(). Obvious question: why not working on the asyncio support in this library? ---------- components: +asyncio nosy: +gvanrossum, haypo, yselivanov _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 17:43:10 2016 From: report at bugs.python.org (STINNER Victor) Date: Tue, 29 Mar 2016 21:43:10 +0000 Subject: [issue26624] Windows hangs in call to CRT setlocale() In-Reply-To: <1458747871.12.0.710719467032.issue26624@psf.upfronthosting.co.za> Message-ID: <1459287790.25.0.173240613838.issue26624@psf.upfronthosting.co.za> STINNER Victor added the comment: > The deadlock is between a CRT thread initialization lock and Windows's process-wide module initialization lock. So if anything is being loaded on demand by the watchdog thread, it's probably locked too (and that could be within the CRT or the OS, so not easy to identify). Basically, on timeout, the faulthandler thread uses the write() syscall and reads memory in the Python process. It's designed to be super safe. The code only uses async-signal safe functions, since the same code is used in signal handlers. https://hg.python.org/cpython/file/688c6b16228e/Modules/faulthandler.c#l540 But the watchdog is trigerred by PyThread_acquire_lock_timed() which indirectly calls WaitForSingleObjectEx() on Windows. In expect that the wait times out before the lock is released on this buildbot. Maybe Windows provides a safer function to implement a watchdog? Basically, the required function is a wait that can be interrupted. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 17:54:39 2016 From: report at bugs.python.org (STINNER Victor) Date: Tue, 29 Mar 2016 21:54:39 +0000 Subject: [issue26654] asyncio is not inspecting keyword arguments of functools.partial In-Reply-To: <1459159050.15.0.830010057156.issue26654@psf.upfronthosting.co.za> Message-ID: <1459288479.19.0.601775180486.issue26654@psf.upfronthosting.co.za> STINNER Victor added the comment: > Oh, wow. I didn't even know we special-case partial() there. I wrote the code doing that. I did it to get more readable and shorter logs since asyncio produces a lot of logs. Example: Exception in callback print("Hello", "World!")() at ...:4 without special case: Exception in functools.partial(, 'Hello', 'World!') at ...:4 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 17:57:59 2016 From: report at bugs.python.org (STINNER Victor) Date: Tue, 29 Mar 2016 21:57:59 +0000 Subject: [issue25911] Regression: os.walk now using os.scandir() breaks bytes filenames on windows In-Reply-To: <1450539578.39.0.976654454489.issue25911@psf.upfronthosting.co.za> Message-ID: <1459288679.4.0.0153058552624.issue25911@psf.upfronthosting.co.za> STINNER Victor added the comment: The issue looks to be fixed in Python 3.5 (future version 3.5.2) and 3.6, I close the issue. I repeat myself: On Python 3, don't store filenames as bytes, it's a bad practice. Use unicode, it works on all platforms and gives access to the full Unicode Character Set! ---------- resolution: -> fixed status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 17:58:50 2016 From: report at bugs.python.org (STINNER Victor) Date: Tue, 29 Mar 2016 21:58:50 +0000 Subject: [issue26662] configure/Makefile doesn't check if "python" command works, needed to build Objects/typeslots.inc In-Reply-To: <1459247902.98.0.893274525942.issue26662@psf.upfronthosting.co.za> Message-ID: <1459288730.68.0.281188690107.issue26662@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- title: FreeBSD: "invalid slot offset" error on _ssl, _curses_panel and _testmultiphase extensions -> configure/Makefile doesn't check if "python" command works, needed to build Objects/typeslots.inc _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 17:59:03 2016 From: report at bugs.python.org (STINNER Victor) Date: Tue, 29 Mar 2016 21:59:03 +0000 Subject: [issue26662] configure/Makefile doesn't check if "python" command works, needed to build Objects/typeslots.inc In-Reply-To: <1459247902.98.0.893274525942.issue26662@psf.upfronthosting.co.za> Message-ID: <1459288743.7.0.941584254496.issue26662@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- components: +Build _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 17:59:21 2016 From: report at bugs.python.org (STINNER Victor) Date: Tue, 29 Mar 2016 21:59:21 +0000 Subject: [issue26661] python fails to locate system libffi In-Reply-To: <1459246152.22.0.57778057602.issue26661@psf.upfronthosting.co.za> Message-ID: <1459288761.02.0.149424830302.issue26661@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- nosy: +haypo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 18:10:35 2016 From: report at bugs.python.org (Zack Weinberg) Date: Tue, 29 Mar 2016 22:10:35 +0000 Subject: [issue26666] File object hook to modify select(ors) event mask In-Reply-To: <1459265321.27.0.359178089762.issue26666@psf.upfronthosting.co.za> Message-ID: <1459289435.57.0.629240246873.issue26666@psf.upfronthosting.co.za> Zack Weinberg added the comment: > Obvious question: why not working on the asyncio support in this library? The whole point of a transparent SOCKS module is that it provides a function that's a *drop-in replacement* for socket.socket(). An asyncio-based SOCKS module would have a completely different API. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 18:18:46 2016 From: report at bugs.python.org (STINNER Victor) Date: Tue, 29 Mar 2016 22:18:46 +0000 Subject: [issue26659] slice() leaks memory when part of a cycle In-Reply-To: <1459195650.62.0.697543008617.issue26659@psf.upfronthosting.co.za> Message-ID: <1459289926.06.0.015001778741.issue26659@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- nosy: +haypo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 18:30:38 2016 From: report at bugs.python.org (STINNER Victor) Date: Tue, 29 Mar 2016 22:30:38 +0000 Subject: [issue26649] Fail update installation: 'utf-8' codec can't decode In-Reply-To: <1459058080.48.0.96946977004.issue26649@psf.upfronthosting.co.za> Message-ID: <1459290638.66.0.84021514564.issue26649@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- resolution: -> third party status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 18:32:22 2016 From: report at bugs.python.org (Martin Panter) Date: Tue, 29 Mar 2016 22:32:22 +0000 Subject: [issue26662] configure/Makefile doesn't check if "python" command works, needed to build Objects/typeslots.inc In-Reply-To: <1459247902.98.0.893274525942.issue26662@psf.upfronthosting.co.za> Message-ID: <1459290742.59.0.767774439991.issue26662@psf.upfronthosting.co.za> Martin Panter added the comment: Typeslots.inc is listed in the .hgtouch file, so you might be able to work around by running ?make touch? before building. I noticed there are other boostrap scripts that require a ?python? command via various mechanisms, e.g. Python/makeopcodetargets.py is run via ?#! /usr/bin/env python? by default. It would at least be nice to make everything uniform, i.e. always use a /usr/bin/env hashbang, always use $(PYTHON), or always use this smarter external Python command. ---------- nosy: +martin.panter _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 19:09:23 2016 From: report at bugs.python.org (Martin Panter) Date: Tue, 29 Mar 2016 23:09:23 +0000 Subject: [issue26666] File object hook to modify select(ors) event mask In-Reply-To: <1459265321.27.0.359178089762.issue26666@psf.upfronthosting.co.za> Message-ID: <1459292963.13.0.601193744197.issue26666@psf.upfronthosting.co.za> Martin Panter added the comment: Python?s select() call operates at a minimal OS level. I don?t completely understand your __preselect__() etc proposal, but it does sound like you are trying to invent another higher-level ?asynchronous? framework like asyncio. I think you are wrong about the proxy connection being made in the socksocket() constructor. In general, there could be both write and read events depending on the stage of the proxy connection setup. E.g. with a HTTP proxy, there would be write events to establish the underlying TCP connection, and also to send the CONNECT request, and then a read event to receive the proxy?s response. Perhaps the SSL socket wrapper objects face a similar situation to your problem. In non-blocking mode, SSLWantRead/WriteError exceptions are raised that indicate which select() event is required. ---------- nosy: +martin.panter _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 19:13:41 2016 From: report at bugs.python.org (STINNER Victor) Date: Tue, 29 Mar 2016 23:13:41 +0000 Subject: [issue26662] configure/Makefile doesn't check if "python" command works, needed to build Objects/typeslots.inc In-Reply-To: <1459247902.98.0.893274525942.issue26662@psf.upfronthosting.co.za> Message-ID: <1459293221.45.0.688049843685.issue26662@psf.upfronthosting.co.za> STINNER Victor added the comment: > Typeslots.inc is listed in the .hgtouch file, so you might be able to work around by running ?make touch? before building. My initial issue is that "import ssl" fails with : invalid slot offset. This error is really strange and Google doesn't know it. I probably missed something when I compiled Python, but I would prefer that Python build system detects such issues for me, rather than having to use workarounds. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 19:30:19 2016 From: report at bugs.python.org (Roundup Robot) Date: Tue, 29 Mar 2016 23:30:19 +0000 Subject: [issue26641] doctest doesn't support packages In-Reply-To: <1458907235.84.0.937791906936.issue26641@psf.upfronthosting.co.za> Message-ID: <20160329233016.18440.47553.FC344065@psf.io> Roundup Robot added the comment: New changeset 32539353eb95 by Victor Stinner in branch 'default': doctest now supports packages https://hg.python.org/cpython/rev/32539353eb95 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 19:31:02 2016 From: report at bugs.python.org (STINNER Victor) Date: Tue, 29 Mar 2016 23:31:02 +0000 Subject: [issue26641] doctest doesn't support packages In-Reply-To: <1458907235.84.0.937791906936.issue26641@psf.upfronthosting.co.za> Message-ID: <1459294262.37.0.0645770554741.issue26641@psf.upfronthosting.co.za> STINNER Victor added the comment: I pushed a different fix using module.__path__ since my use case is the test module splitted into at least two directories. ---------- resolution: -> fixed status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 19:41:27 2016 From: report at bugs.python.org (Martin Panter) Date: Tue, 29 Mar 2016 23:41:27 +0000 Subject: [issue26662] configure/Makefile doesn't check if "python" command works, needed to build Objects/typeslots.inc In-Reply-To: <1459247902.98.0.893274525942.issue26662@psf.upfronthosting.co.za> Message-ID: <1459294887.31.0.144806736753.issue26662@psf.upfronthosting.co.za> Martin Panter added the comment: Maybe the configure.ac code for generating opcode.h is a better alternative. It looks like it prints a warning but would continue with the build: if test "$PYTHON" = not-found; then OPCODEHGEN="@echo python: $PYTHON! cannot run Tools/scripts/generate_opcode_h.py" else OPCODEHGEN="$PYTHON" fi ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 20:43:16 2016 From: report at bugs.python.org (Roundup Robot) Date: Wed, 30 Mar 2016 00:43:16 +0000 Subject: [issue26295] Random failures when running test suite in parallel (-m test -j0) caused by test_regrtest In-Reply-To: <1454663707.24.0.201658170139.issue26295@psf.upfronthosting.co.za> Message-ID: <20160330004307.40514.45464.17B35779@psf.io> Roundup Robot added the comment: New changeset f7ddd72b70ea by Victor Stinner in branch 'default': Issue #26295: When using "python3 -m test --testdir=TESTDIR", regrtest doesn't https://hg.python.org/cpython/rev/f7ddd72b70ea New changeset c83349c129c9 by Victor Stinner in branch 'default': Issue #26295: test_regrtest now uses a temporary directory https://hg.python.org/cpython/rev/c83349c129c9 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 21:14:28 2016 From: report at bugs.python.org (STINNER Victor) Date: Wed, 30 Mar 2016 01:14:28 +0000 Subject: [issue26668] Remove Lib/test/test_importlib/regrtest.py? Message-ID: <1459300468.22.0.543956048142.issue26668@psf.upfronthosting.co.za> New submission from STINNER Victor: Docstring of the file: """Run Python's standard test suite using importlib.__import__. Tests known to fail because of assumptions that importlib (properly) invalidates are automatically skipped if the entire test suite is run. Otherwise all command-line options valid for test.regrtest are also valid for this script. """ Since Python 3 now uses importlib by default for __import__, I think that the file became useless and can be removed. ---------- messages: 262641 nosy: brett.cannon, eric.snow, haypo priority: normal severity: normal status: open title: Remove Lib/test/test_importlib/regrtest.py? versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 21:15:24 2016 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 30 Mar 2016 01:15:24 +0000 Subject: [issue18844] allow weights in random.choice In-Reply-To: <1377537825.13.0.508607501106.issue18844@psf.upfronthosting.co.za> Message-ID: <1459300524.8.0.881522830193.issue18844@psf.upfronthosting.co.za> Raymond Hettinger added the comment: Thanks for the patch. Can I get you to fill out a contributor agreement? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 21:16:09 2016 From: report at bugs.python.org (STINNER Victor) Date: Wed, 30 Mar 2016 01:16:09 +0000 Subject: [issue26666] File object hook to modify select(ors) event mask In-Reply-To: <1459265321.27.0.359178089762.issue26666@psf.upfronthosting.co.za> Message-ID: <1459300569.6.0.068356540761.issue26666@psf.upfronthosting.co.za> STINNER Victor added the comment: > The whole point of a transparent SOCKS module is that it provides a function that's a *drop-in replacement* for socket.socket(). Fully transparent asynchronous I/O is an old dream of developers. You may try eventlet if you like monkey-patching. It's a deliberate choice in the asyncio design to make asynchonous I/O explicit in the code. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 21:18:23 2016 From: report at bugs.python.org (STINNER Victor) Date: Wed, 30 Mar 2016 01:18:23 +0000 Subject: [issue26639] Tools/i18n/pygettext.py: replace deprecated imp module with importlib In-Reply-To: <1458903005.49.0.704638577802.issue26639@psf.upfronthosting.co.za> Message-ID: <1459300703.26.0.0688868770106.issue26639@psf.upfronthosting.co.za> STINNER Victor added the comment: See also the issue #20021 '"modernize" makeopcodetargets.py"' (now closed). ---------- nosy: +berker.peksag, serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 22:04:12 2016 From: report at bugs.python.org (Brett Cannon) Date: Wed, 30 Mar 2016 02:04:12 +0000 Subject: [issue26668] Remove Lib/test/test_importlib/regrtest.py? In-Reply-To: <1459300468.22.0.543956048142.issue26668@psf.upfronthosting.co.za> Message-ID: <1459303452.87.0.984266403128.issue26668@psf.upfronthosting.co.za> Brett Cannon added the comment: So that file wasn't to make sure importlib was used by the test suite but to actually make sure importlib.__import__ was heavily exercised (it's not the same as builtins.__import__ which is an accelerated C version). But thanks to test_importlib.util that shouldn't be an issue as long as all the modules in test_importlib.import_ use util.test_both(..., __import__=util.__import__). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 22:04:22 2016 From: report at bugs.python.org (Brett Cannon) Date: Wed, 30 Mar 2016 02:04:22 +0000 Subject: [issue26668] Remove Lib/test/test_importlib/regrtest.py? In-Reply-To: <1459300468.22.0.543956048142.issue26668@psf.upfronthosting.co.za> Message-ID: <1459303462.75.0.230927917806.issue26668@psf.upfronthosting.co.za> Changes by Brett Cannon : ---------- assignee: -> brett.cannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 22:12:59 2016 From: report at bugs.python.org (Demur Rumed) Date: Wed, 30 Mar 2016 02:12:59 +0000 Subject: [issue26647] ceval: use Wordcode, 16-bit bytecode In-Reply-To: <1459034868.93.0.159802163565.issue26647@psf.upfronthosting.co.za> Message-ID: <1459303979.39.0.702717059378.issue26647@psf.upfronthosting.co.za> Demur Rumed added the comment: I've attached some benchmarking results as requested There is 1 failing test which doesn't fail in master for test_trace; the unit test for #9936 ---------- Added file: http://bugs.python.org/file42324/wcpybm.txt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 22:29:30 2016 From: report at bugs.python.org (Demur Rumed) Date: Wed, 30 Mar 2016 02:29:30 +0000 Subject: [issue26647] ceval: use Wordcode, 16-bit bytecode In-Reply-To: <1459034868.93.0.159802163565.issue26647@psf.upfronthosting.co.za> Message-ID: <1459304970.73.0.784975771727.issue26647@psf.upfronthosting.co.za> Demur Rumed added the comment: To clarify format of extended arg listings: 1st column is the number of instances of EXTENDED_ARG being emitted, 2nd column is length of bytecode, followed by filename The previous numbers were of modules, which generally are run-once and listing many constants. I've attached a modification where instead I iterated over the code objects inside co_consts from compiling the *.py file. Trunk currently only emits EXTENDED_ARGs for classes (Pdb, & then the rest in Lib/typing.py) so I've omitted it ---------- Added file: http://bugs.python.org/file42325/exarg_in_funcs.txt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 23:28:57 2016 From: report at bugs.python.org (Brett Cannon) Date: Wed, 30 Mar 2016 03:28:57 +0000 Subject: [issue26647] ceval: use Wordcode, 16-bit bytecode In-Reply-To: <1459034868.93.0.159802163565.issue26647@psf.upfronthosting.co.za> Message-ID: <1459308537.41.0.786866618312.issue26647@psf.upfronthosting.co.za> Brett Cannon added the comment: Thanks for the benchmark results, Demur, but I think the benchmarks Victor was talking about hg.Python.org/benchmarks ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 01:02:04 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 30 Mar 2016 05:02:04 +0000 Subject: [issue18844] allow weights in random.choice In-Reply-To: <1377537825.13.0.508607501106.issue18844@psf.upfronthosting.co.za> Message-ID: <1459314124.07.0.0353997081824.issue18844@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: What is wrong with generators? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 02:50:19 2016 From: report at bugs.python.org (Roundup Robot) Date: Wed, 30 Mar 2016 06:50:19 +0000 Subject: [issue26295] Random failures when running test suite in parallel (-m test -j0) caused by test_regrtest In-Reply-To: <1454663707.24.0.201658170139.issue26295@psf.upfronthosting.co.za> Message-ID: <20160330065016.60121.88973.F5D38F60@psf.io> Roundup Robot added the comment: New changeset e29f12ed4444 by Victor Stinner in branch 'default': Issue #26295: Fix test_regrtest.test_tools_buildbot_test() https://hg.python.org/cpython/rev/e29f12ed4444 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 02:51:22 2016 From: report at bugs.python.org (Roundup Robot) Date: Wed, 30 Mar 2016 06:51:22 +0000 Subject: [issue26295] Random failures when running test suite in parallel (-m test -j0) caused by test_regrtest In-Reply-To: <1454663707.24.0.201658170139.issue26295@psf.upfronthosting.co.za> Message-ID: <20160330065120.5043.26232.40110B60@psf.io> Roundup Robot added the comment: New changeset e47e00723e5d by Victor Stinner in branch 'default': Issue #26295: Enhanc test_regrtest.test_tools_script_run_tests() https://hg.python.org/cpython/rev/e47e00723e5d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 03:11:55 2016 From: report at bugs.python.org (Steven Basart) Date: Wed, 30 Mar 2016 07:11:55 +0000 Subject: [issue18844] allow weights in random.choice In-Reply-To: <1377537825.13.0.508607501106.issue18844@psf.upfronthosting.co.za> Message-ID: <1459321915.42.0.712073476017.issue18844@psf.upfronthosting.co.za> Steven Basart added the comment: Hello rhettinger. I filled out the form thanks for letting me know about it. Is there anything else I have to do? Hey serhiy.storchaka There were several things "wrong" with the previous implementation in my opinion. 1st they tried to add too much. Which would if allowed would clutter up the random library if every function had both it's implementation as well as an accompanied generator. The other problem being that both were attempted to be made as callable to the public API. I would prefer the generator if present to be hidden and would also have to be more sophisticated to be able to check if it was being called with new input. 2nd by adding in the generator to the pulbic API of the random library it makes it far more confusing and obfuscates the true purpose of this function anyways which is to get a weighted choice. So basically there is nothing wrong with generators but they don't necessarily belong here so I removed it to try to get back to the core principles of what the function should be doing, by making it simpler. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 03:17:23 2016 From: report at bugs.python.org (Gregory P. Smith) Date: Wed, 30 Mar 2016 07:17:23 +0000 Subject: [issue26669] time.localtime(float("NaN")) does not raise a ValueError on all platforms Message-ID: <1459322243.53.0.921219428076.issue26669@psf.upfronthosting.co.za> New submission from Gregory P. Smith: time.localtime(float("NaN")) raises a ValueError on x86_64 using the few compilers I have tested it with. (this makes sense) >>> time.localtime(float("NaN")) Traceback (most recent call last): File "", line 1, in ValueError: (75, 'Value too large for defined data type') On an arm and arm64 system, it does not and treats NaN as 0. (nonsense!) >>> time.localtime(float("NaN")) time.struct_time(tm_year=1970, tm_mon=1, tm_mday=1, tm_hour=0, tm_min=0, tm_sec=0, tm_wday=3, tm_yday=1, tm_isdst=0) The root of this problem appears to be the (potentially questionable? I'll ask a C compiler person...) code in Python/pytime.c's (3.x) Modules/timemodule.c's (2.7) double to time_t conversion function. I'm not sure what it does is supposed to be well defined behavior with NaN... The easy fix is to add: #include and add || isnan(x) || isinf(x) to the check that raises a ValueError in https://hg.python.org/cpython/file/4c903ceeb4d1/Python/pytime.c#l149 (3.x) https://hg.python.org/cpython/file/2.7/Modules/timemodule.c#l102 (2.7) Along with a relevant assertRaises(ValueError) unittest for NaN, inf and -inf in test_time.py. ---------- components: Extension Modules, Interpreter Core messages: 262653 nosy: gregory.p.smith priority: normal severity: normal status: open title: time.localtime(float("NaN")) does not raise a ValueError on all platforms versions: Python 2.7, Python 3.4, Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 03:30:01 2016 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 30 Mar 2016 07:30:01 +0000 Subject: [issue26653] bisect raises a TypeError when hi is None In-Reply-To: <1459137648.89.0.2938672633.issue26653@psf.upfronthosting.co.za> Message-ID: <1459323001.63.0.962744267999.issue26653@psf.upfronthosting.co.za> Changes by Raymond Hettinger : ---------- resolution: -> not a bug status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 03:39:55 2016 From: report at bugs.python.org (Sebastien Bourdeauducq) Date: Wed, 30 Mar 2016 07:39:55 +0000 Subject: [issue26509] spurious ConnectionAbortedError logged on Windows In-Reply-To: <1457412256.22.0.929855467044.issue26509@psf.upfronthosting.co.za> Message-ID: <1459323595.06.0.383820498916.issue26509@psf.upfronthosting.co.za> Sebastien Bourdeauducq added the comment: Can someone please commit the patch? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 04:20:14 2016 From: report at bugs.python.org (STINNER Victor) Date: Wed, 30 Mar 2016 08:20:14 +0000 Subject: [issue26670] Add a developer mode: -X dev command line option Message-ID: <1459326014.81.0.126746862215.issue26670@psf.upfronthosting.co.za> New submission from STINNER Victor: Attached patch implements the idea proposed on the python-ideas mailing list: https://mail.python.org/pipermail/python-ideas/2016-March/039314.html The patch is a proof-of-concept. The code still contains FIXME. ---------- files: dev_mode.patch keywords: patch messages: 262655 nosy: haypo priority: normal severity: normal status: open title: Add a developer mode: -X dev command line option type: enhancement versions: Python 3.6 Added file: http://bugs.python.org/file42326/dev_mode.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 04:56:22 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 30 Mar 2016 08:56:22 +0000 Subject: [issue18844] allow weights in random.choice In-Reply-To: <1377537825.13.0.508607501106.issue18844@psf.upfronthosting.co.za> Message-ID: <1459328182.12.0.00517547088348.issue18844@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: I disagree. My patch adds two functions because they serve two different purposes. weighted_choice() returns one random value as other functions in the random module. weighted_choice_generator() provides more efficient way to generate random values, since startup cost is more significant than for other random value generators. Generators are widely used in Python, especially in Python 3. If they considered confusing, we should deprecate builtins map(), filter(), zip() and the itertools module at first place. Your function, Steven, returns a list containing one random value by default. It does not match the interface of other functions in the random module. It matches the interface of NumPy random module. In Python you need two separate functions, one that returns single value, and other that returns a list of values. But returning iterator and generating values by demand is more preferable in Python 3. Generatorsa are more flexible. With weighted_choice_generator() it is easy to get the result of your function: list(islice(weighted_choice_generator(data), amount)). But generating dynamic amount of values with your interface is impossible. Raymond, if you have now free time, could you please make a review of weighted_choice_generator_2.patch? ---------- keywords: +needs review versions: +Python 3.6 -Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 05:31:14 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 30 Mar 2016 09:31:14 +0000 Subject: [issue26671] Clean up path_converter in posixmodule.c Message-ID: <1459330274.5.0.616265410958.issue26671@psf.upfronthosting.co.za> New submission from Serhiy Storchaka: path_converter in Modules/posixmodule.c sequentially tries to convert an argument to str, bytes, and int. If previous conversion is failed, it clears the error and tries with type. This can hide some errors (such as MemoryError) and even cause using unexpected conversion. Proposed patch cleans up path_converter. In addition it avoids copying the content of instances of string subclass. ---------- assignee: serhiy.storchaka components: Extension Modules files: path_converter_cleanup.patch keywords: patch messages: 262657 nosy: larry, serhiy.storchaka priority: normal severity: normal stage: patch review status: open title: Clean up path_converter in posixmodule.c type: enhancement versions: Python 3.6 Added file: http://bugs.python.org/file42327/path_converter_cleanup.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 05:31:48 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 30 Mar 2016 09:31:48 +0000 Subject: [issue26027] Support Path objects in the posix module In-Reply-To: <1452114329.99.0.617690911804.issue26027@psf.upfronthosting.co.za> Message-ID: <1459330308.16.0.965435622012.issue26027@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- dependencies: +Clean up path_converter in posixmodule.c _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 06:13:26 2016 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 30 Mar 2016 10:13:26 +0000 Subject: [issue26647] ceval: use Wordcode, 16-bit bytecode In-Reply-To: <1459034868.93.0.159802163565.issue26647@psf.upfronthosting.co.za> Message-ID: <1459332806.63.0.951946814011.issue26647@psf.upfronthosting.co.za> Raymond Hettinger added the comment: Demur, I think you're on the right track here. It will nice to be rid of the HAVE_ARGUMENT tests and to not have to decode the arguments one-byte at a time. Overall, the patch looks good (although it includes several small unrelated changes). Besides the speed benefit, the code looks cleaner than before. I was surprised to see that the peephole optimizer grew larger, but the handling of extended arguments is likely worth it even though it adds several new wordy chunks of code. When it comes to benchmarks, expect a certain amount of noise (especially from those that use I/O or that exercise the C-API more than the pure python bytecode). ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 06:44:23 2016 From: report at bugs.python.org (Ronald Oussoren) Date: Wed, 30 Mar 2016 10:44:23 +0000 Subject: [issue26670] Add a developer mode: -X dev command line option In-Reply-To: <1459326014.81.0.126746862215.issue26670@psf.upfronthosting.co.za> Message-ID: <1459334663.52.0.933559365785.issue26670@psf.upfronthosting.co.za> Ronald Oussoren added the comment: Why does this patch execv() the interpreter to set options? I'd expect it to be possible to get the same result by updating the argument parsing code in Py_Main. ---------- nosy: +ronaldoussoren _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 06:46:19 2016 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 30 Mar 2016 10:46:19 +0000 Subject: [issue26647] ceval: use Wordcode, 16-bit bytecode In-Reply-To: <1459034868.93.0.159802163565.issue26647@psf.upfronthosting.co.za> Message-ID: <1459334779.0.0.44339273067.issue26647@psf.upfronthosting.co.za> Raymond Hettinger added the comment: FWIW, I'm seeing about a 7% improvement to pystone. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 07:19:11 2016 From: report at bugs.python.org (Axel Luttgens) Date: Wed, 30 Mar 2016 11:19:11 +0000 Subject: [issue26672] regrtest missing in the module name Message-ID: <1459336751.45.0.914074281653.issue26672@psf.upfronthosting.co.za> New submission from Axel Luttgens: Relevant page: ????https://docs.python.org/2/library/test.html One may read (section 25.5.2): ????Specifying all as the value for the -u option enables all ????possible resources: python -m test -uall. I guess this should be: ????Specifying all as the value for the -u option enables all ????possible resources: python -m test.regrtest -uall. HTH, Axel ---------- assignee: docs at python components: Documentation messages: 262661 nosy: Axel, docs at python priority: normal severity: normal status: open title: regrtest missing in the module name type: enhancement versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 08:28:38 2016 From: report at bugs.python.org (Demur Rumed) Date: Wed, 30 Mar 2016 12:28:38 +0000 Subject: [issue26647] ceval: use Wordcode, 16-bit bytecode In-Reply-To: <1459034868.93.0.159802163565.issue26647@psf.upfronthosting.co.za> Message-ID: <1459340918.07.0.170423056401.issue26647@psf.upfronthosting.co.za> Demur Rumed added the comment: While it's good to know benchmarking in core Python goes beyond the microbenchmarks included in the distribution, I'm having some trouble with hg.python.org/benchmarks due to my system only having 256MB of ram I've attached results for 2 benchmarks: 2to3 & regex ---------- Added file: http://bugs.python.org/file42328/2to3re.txt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 09:03:16 2016 From: report at bugs.python.org (Aviv Palivoda) Date: Wed, 30 Mar 2016 13:03:16 +0000 Subject: [issue26488] hashlib command line interface In-Reply-To: <1457214866.19.0.989950954277.issue26488@psf.upfronthosting.co.za> Message-ID: <1459342996.52.0.652143621951.issue26488@psf.upfronthosting.co.za> Aviv Palivoda added the comment: Sorry on the late response for some reason i don't receive email notification from the tracker for the past few days. 1) Thanks for the review SilentGhost the patch attached include your CR suggestions. 2) Raymond I have fixed the problem with ctrl+D. I tried writing a test to simulate this problem but i don't seem to be able to simulated the terminal behavior on ctrl+D. 3) Removed the block_size option as suggested by Raymond and Victor and using os.stat().st_blksize as suggested by Victor. 4) I changed the CLI to support all available algorithms in hashlib. I am not sure if this is too many choices to show in the --help message. 5) About removing the use of argparse.FileType i would prefer resolving issue 14156 but if you think this is problematic i will do the change. 6) What do you think about changing the API to be more like md5sum? a) Allowing * in the file name to calcualte on multiple files. b) Adding the check option. c) printing file name in output. ---------- Added file: http://bugs.python.org/file42329/hashlib-script-mod-2.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 09:05:59 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 30 Mar 2016 13:05:59 +0000 Subject: [issue26655] pathlib glob case sensitivity issue on Windows In-Reply-To: <1459171442.9.0.718616645463.issue26655@psf.upfronthosting.co.za> Message-ID: <1459343159.48.0.245022525675.issue26655@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: For now glob(r'c:\very\long\case\insensitive\path\*.txt') have to iterate names only in one directory. For restoring actual path case it have to iterate all parent directories: r'c:\very\long\case\insensitive\path', r'c:\very\long\case\insensitive', r'c:\very\long\case', r'c:\very\long', r'c:\very', and 'c:\\'. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 09:48:17 2016 From: report at bugs.python.org (Jeremy Kloth) Date: Wed, 30 Mar 2016 13:48:17 +0000 Subject: [issue26624] Windows hangs in call to CRT setlocale() In-Reply-To: <1458747871.12.0.710719467032.issue26624@psf.upfronthosting.co.za> Message-ID: <1459345697.72.0.935585057176.issue26624@psf.upfronthosting.co.za> Jeremy Kloth added the comment: I would have responded sooner, but add me to the list of those not receiving tracker notifications... My buildbot is running Windows 7 with all updates (last checked 3/29) and VS2015 Update 1. ucrtbase: 10.0.10586.9 (11/19/2015) ucrtbased: 10.0.10240.16384 (07/09/2015) vcruntime140d: 14.00.23506.0 (11/05/2015) Interestingly enough, my Win10 development machine has: ucrtbase: 10.0.14295.1000 (03/19/2016) ucrtbased: 10.0.10586.15 (11/20/2015) vcruntime140d: 14.0.23506.0 (11/05/2015) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 09:56:19 2016 From: report at bugs.python.org (Christian Heimes) Date: Wed, 30 Mar 2016 13:56:19 +0000 Subject: [issue26488] hashlib command line interface In-Reply-To: <1457214866.19.0.989950954277.issue26488@psf.upfronthosting.co.za> Message-ID: <1459346179.07.0.0983601093012.issue26488@psf.upfronthosting.co.za> Christian Heimes added the comment: I see a potential performance issue here. The block size is a small value, usually a couple of kb. With such a small value, the runtime will be dominated by Python call overhead and syscalls. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 10:02:46 2016 From: report at bugs.python.org (Jeremy Kloth) Date: Wed, 30 Mar 2016 14:02:46 +0000 Subject: [issue26658] test_os fails when run on Windows ramdisk In-Reply-To: <1459183766.58.0.185896673203.issue26658@psf.upfronthosting.co.za> Message-ID: <1459346566.56.0.871683681194.issue26658@psf.upfronthosting.co.za> Jeremy Kloth added the comment: To reproduce: P:\python-default>PCBuild\amd64\python_d.exe Python 3.6.0a0 (default:708beeb65026, Mar 30 2016, 08:50:27) [MSC v.1900 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import os, _winapi >>> _winapi.CreateJunction('PCbuild', 'junctest') >>> assert os.listdir('PCbuild') == os.listdir('junctest') >>> os.path.exists('junctest') False >>> os.path.lexists('junctest') True >>> os.stat('junctest') Traceback (most recent call last): File "", line 1, in OSError: [WinError 1] Incorrect function: 'junctest' >>> os.lstat('junctest') os.stat_result(st_mode=16895, st_ino=1688849860290629, st_dev=719101600, st_nlink=1, st_uid=0, st_gid=0, st_size=0, st_atime=1459349589, st_mtime=1459349589, st_ctime=1459349589) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 10:19:56 2016 From: report at bugs.python.org (Udo Eberhardt) Date: Wed, 30 Mar 2016 14:19:56 +0000 Subject: [issue26655] pathlib glob case sensitivity issue on Windows In-Reply-To: <1459171442.9.0.718616645463.issue26655@psf.upfronthosting.co.za> Message-ID: <1459347596.33.0.0531479518303.issue26655@psf.upfronthosting.co.za> Udo Eberhardt added the comment: Meanwhile I realized this problem as well. There is no easy solution to determine exact spelling of the entire path. So it seems there is no simple solution to my problem. The concept of treating file system paths case-insensitive (as Windows does) seems to be a bad idea. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 10:35:14 2016 From: report at bugs.python.org (Steve Dower) Date: Wed, 30 Mar 2016 14:35:14 +0000 Subject: [issue26624] Windows hangs in call to CRT setlocale() In-Reply-To: <1458747871.12.0.710719467032.issue26624@psf.upfronthosting.co.za> Message-ID: <1459348514.83.0.131329972614.issue26624@psf.upfronthosting.co.za> Steve Dower added the comment: So you've still got the old ucrtbased.dll on the buildbot, which is why we're still seeing the issue. Because it's a different OS I'm not surprised to see a difference between ucrtbase.dll instances. There should be an installer for the debug runtime somewhere inside your VS install directory (under vc/redist). If you take the one from your dev machine and run it on the buildbot we should be good. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 11:32:00 2016 From: report at bugs.python.org (wysaard) Date: Wed, 30 Mar 2016 15:32:00 +0000 Subject: [issue26673] Tkinter error when opening IDLE configuration menu Message-ID: <1459351920.73.0.899924616631.issue26673@psf.upfronthosting.co.za> New submission from wysaard: I'm using Python 3.5.1 on Arch Linux. I've restalled the python package which provides IDLE, and the tkinter package which is used by IDLE, but to no effect. My problem is this: When in the menu at the top in IDLE, I click on Options -> Configure IDLE, the menu will stop responding, and nothing happens after that. Doing this when I run IDLE in a terminal provides the following error on clicking `Configure IDLE`: Exception in Tkinter callback Traceback (most recent call last): File "/usr/lib/python3.5/tkinter/__init__.py", line 1549, in __call__ return self.func(*args) File "/usr/lib/python3.5/idlelib/EditorWindow.py", line 516, in config_dialog configDialog.ConfigDialog(self.top,'Settings') File "/usr/lib/python3.5/idlelib/configDialog.py", line 74, in __init__ self.LoadConfigs() File "/usr/lib/python3.5/idlelib/configDialog.py", line 1086, in LoadConfigs self.LoadFontCfg() File "/usr/lib/python3.5/idlelib/configDialog.py", line 988, in LoadFontCfg self.SetFontSample() File "/usr/lib/python3.5/idlelib/configDialog.py", line 866, in SetFontSample self.labelFontSample.config(font=newFont) File "/usr/lib/python3.5/tkinter/__init__.py", line 1330, in configure return self._configure('configure', cnf, kw) File "/usr/lib/python3.5/tkinter/__init__.py", line 1321, in _configure self.tk.call(_flatten((self._w, cmd)) + self._options(cnf)) _tkinter.TclError: expected integer but got "" I have no idea what to do here. ---------- components: IDLE messages: 262670 nosy: wysaard priority: normal severity: normal status: open title: Tkinter error when opening IDLE configuration menu type: crash versions: Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 12:03:05 2016 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 30 Mar 2016 16:03:05 +0000 Subject: [issue26647] ceval: use Wordcode, 16-bit bytecode In-Reply-To: <1459034868.93.0.159802163565.issue26647@psf.upfronthosting.co.za> Message-ID: <1459353785.33.0.47250465434.issue26647@psf.upfronthosting.co.za> Raymond Hettinger added the comment: Report on Darwin Raymonds-2013-MacBook-Pro.local 15.4.0 Darwin Kernel Version 15.4.0: Fri Feb 26 22:08:05 PST 2016; root:xnu-3248.40.184~3/RELEASE_X86_64 x86_64 i386 Total CPU cores: 8 ### 2to3 ### Min: 4.680941 -> 4.437426: 1.05x faster Avg: 4.703692 -> 4.498773: 1.05x faster Significant (t=9.57) Stddev: 0.02670 -> 0.03972: 1.4874x larger ### chameleon_v2 ### Min: 3.391806 -> 3.300793: 1.03x faster Avg: 3.447192 -> 3.340437: 1.03x faster Significant (t=28.26) Stddev: 0.03141 -> 0.02098: 1.4972x smaller ### django_v3 ### Min: 0.339693 -> 0.328680: 1.03x faster Avg: 0.347655 -> 0.335704: 1.04x faster Significant (t=16.97) Stddev: 0.00477 -> 0.00518: 1.0871x larger ### nbody ### Min: 0.159703 -> 0.148231: 1.08x faster Avg: 0.164307 -> 0.152380: 1.08x faster Significant (t=34.06) Stddev: 0.00260 -> 0.00234: 1.1123x smaller The following not significant results are hidden, use -v to show them: fastpickle, fastunpickle, json_dump_v2, json_load, regex_v8, tornado_http. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 12:41:51 2016 From: report at bugs.python.org (Jeremy Kloth) Date: Wed, 30 Mar 2016 16:41:51 +0000 Subject: [issue26624] Windows hangs in call to CRT setlocale() In-Reply-To: <1458747871.12.0.710719467032.issue26624@psf.upfronthosting.co.za> Message-ID: <1459356111.14.0.218466083608.issue26624@psf.upfronthosting.co.za> Jeremy Kloth added the comment: After attempting to find the installer for ucrtbased.dll on my dev machine and reading various blog posts on the Visual C++ Team Blog and hunting through several KB articles, I've come across what I think is needed for an up-to-date Universal CRT. When installing (or in this case modifying) VS2015, the Windows 10 SDK *MUST* also be installed. It is unhelpfully located in the setup menu under "Windows and Web Development" (good) -> "Universal Windows App Development Tools" (not so good) -> "Tools (1.2) and Windows 10 SDK (10.0.10586)". As Python is not an UWP app, I thought nothing of this submenu when installing VS2015 initially. With the SDK installed, my ucrtbased.dll is at version 10.0.10586.15. Now we wait and see if the deadlocking still happens. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 13:08:18 2016 From: report at bugs.python.org (Eryk Sun) Date: Wed, 30 Mar 2016 17:08:18 +0000 Subject: [issue26658] test_os fails when run on Windows ramdisk In-Reply-To: <1459183766.58.0.185896673203.issue26658@psf.upfronthosting.co.za> Message-ID: <1459357698.93.0.506597342914.issue26658@psf.upfronthosting.co.za> Eryk Sun added the comment: I see now. It's not a problem with the junction. In the stat implementation, after verifying that the directory or file is a reparse point, it opens it again without FILE_FLAG_OPEN_REPARSE_POINT, in order to open the target instead of the link. I don't understand why it doesn't use this handle to call GetFileInformationByHandle again, this time on the target. Instead it calls get_target_path in order to recursively call stat on the target path. To get the target path it calls GetFinalPathNameByHandle and requests the DOS name, which requires a drive letter. At this point Windows has a native NT path (e.g. \Device\ImDisk0\python-default\PCBuild), so it has to query the mountpoint manager to get the DOS drive letter mapping (i.e. \Device\ImDisk0 => P:). This is done by opening a handle for \\.\MountPointManager and calling DeviceIoControl to query the drive letter. This is the call that fails with ERROR_INVALID_FUNCTION (1). Indeed, you'll get the same error if you try calling os.path._getfinalpathname on any directory or file on this drive. It's probably the case that the ImDisk driver doesn't support the mountpoint manager at all. For example, in the \Global?? object directory there's no GUID symbolic link assigned to the device, which is normally assigned by the mountpoint manager. Also, mountvol.exe doesn't list the ImDisk drive. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 13:15:00 2016 From: report at bugs.python.org (Steve Dower) Date: Wed, 30 Mar 2016 17:15:00 +0000 Subject: [issue26624] Windows hangs in call to CRT setlocale() In-Reply-To: <1458747871.12.0.710719467032.issue26624@psf.upfronthosting.co.za> Message-ID: <1459358100.75.0.13383392417.issue26624@psf.upfronthosting.co.za> Steve Dower added the comment: Ergh... that's awkward (but it explains why some of my own machines are missing bits). Victor, I'll get back to you about the watchdog once I'm at an actual PC. This week I'm at a conference. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 13:44:12 2016 From: report at bugs.python.org (Roundup Robot) Date: Wed, 30 Mar 2016 17:44:12 +0000 Subject: [issue26494] Double deallocation on iterator exhausting In-Reply-To: <1457288764.94.0.168287313304.issue26494@psf.upfronthosting.co.za> Message-ID: <20160330174409.11929.43735.6D4BBAEC@psf.io> Roundup Robot added the comment: New changeset 905b5944119c by Serhiy Storchaka in branch '3.5': Issue #26494: Fixed crash on iterating exhausting iterators. https://hg.python.org/cpython/rev/905b5944119c New changeset 73ce47d4a7b2 by Serhiy Storchaka in branch 'default': Issue #26494: Fixed crash on iterating exhausting iterators. https://hg.python.org/cpython/rev/73ce47d4a7b2 New changeset cff06d875678 by Serhiy Storchaka in branch '2.7': Issue #26494: Fixed crash on iterating exhausting iterators. https://hg.python.org/cpython/rev/cff06d875678 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 13:49:06 2016 From: report at bugs.python.org (Josh Rosenberg) Date: Wed, 30 Mar 2016 17:49:06 +0000 Subject: [issue26647] ceval: use Wordcode, 16-bit bytecode In-Reply-To: <1459034868.93.0.159802163565.issue26647@psf.upfronthosting.co.za> Message-ID: <1459360146.93.0.407608880301.issue26647@psf.upfronthosting.co.za> Changes by Josh Rosenberg : ---------- nosy: +josh.r _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 14:11:50 2016 From: report at bugs.python.org (Roundup Robot) Date: Wed, 30 Mar 2016 18:11:50 +0000 Subject: [issue26492] Exhausted array iterator should left exhausted In-Reply-To: <1457280280.79.0.892048425987.issue26492@psf.upfronthosting.co.za> Message-ID: <20160330181143.40494.80024.5C18877C@psf.io> Roundup Robot added the comment: New changeset 89ba67ee83d6 by Serhiy Storchaka in branch '3.5': Issue #26492: Added additional tests for exhausted iterators of mutable sequences. https://hg.python.org/cpython/rev/89ba67ee83d6 New changeset b4ea00d50e7e by Serhiy Storchaka in branch 'default': Issue #26492: Added additional tests for exhausted iterators of mutable sequences. https://hg.python.org/cpython/rev/b4ea00d50e7e New changeset 249ef9d02aa6 by Serhiy Storchaka in branch '2.7': Issue #26492: Added additional tests for exhausted iterators of mutable sequences. https://hg.python.org/cpython/rev/249ef9d02aa6 New changeset b6eebe7cf5ae by Serhiy Storchaka in branch 'default': Issue #26492: Exhausted iterator of array.array now conforms with the behavior https://hg.python.org/cpython/rev/b6eebe7cf5ae ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 14:25:05 2016 From: report at bugs.python.org (Brett Cannon) Date: Wed, 30 Mar 2016 18:25:05 +0000 Subject: [issue26647] ceval: use Wordcode, 16-bit bytecode In-Reply-To: <1459034868.93.0.159802163565.issue26647@psf.upfronthosting.co.za> Message-ID: <1459362305.61.0.960044715688.issue26647@psf.upfronthosting.co.za> Brett Cannon added the comment: Thanks to Demur and Raymond for running the benchmarks. All of these numbers look good and with Raymond saying the code looks cleaner and everyone so far -- including me -- liking the overall idea this definitely seems worth continuing to work on. Thanks for starting this, Demur, and I hope you feel up for continuing to work on making this work! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 14:48:14 2016 From: report at bugs.python.org (Steven Basart) Date: Wed, 30 Mar 2016 18:48:14 +0000 Subject: [issue18844] allow weights in random.choice In-Reply-To: <1377537825.13.0.508607501106.issue18844@psf.upfronthosting.co.za> Message-ID: <1459363694.77.0.930635042841.issue18844@psf.upfronthosting.co.za> Steven Basart added the comment: Hey serhiy.storchaka I can edit the code to output just one value if called with simply a list and then return a list of values if called with the optional amount parameter. My code also needs to check that amount >= 1. My code was mostly just to restart this discussion as I personally like the idea of the function for weighted choice and would like it to be standard in the random library. I have no qualms with adding both weighted_choice and weighted_choice_generator but my concern is mostly that you are asking too much and it won't go through by trying to add two functions at the same time. The other thing is that I believe that weighted_choice could suffice with just one function call. I just think my last concern is that generators are different from the other functions in random.py. Whereas they are more intuitive and accepted in the builtins like map and zip etc. There isn't any other functions in the random library that return that type of object when called. They instead return a numerical result. Those are my concerns and hence why I rewrote the code. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 15:46:16 2016 From: report at bugs.python.org (Mahmoud Lababidi) Date: Wed, 30 Mar 2016 19:46:16 +0000 Subject: [issue26623] JSON encode: more informative error In-Reply-To: <1458744500.18.0.912653699585.issue26623@psf.upfronthosting.co.za> Message-ID: <1459367176.21.0.840843657106.issue26623@psf.upfronthosting.co.za> Mahmoud Lababidi added the comment: Is there a use case where the representation is too long? I think it may be useful to see the representation, but perhaps you are correct. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 18:11:23 2016 From: report at bugs.python.org (wim glenn) Date: Wed, 30 Mar 2016 22:11:23 +0000 Subject: [issue26351] Occasionally check for Ctrl-C in long-running operations like sum In-Reply-To: <1455299252.18.0.421982887455.issue26351@psf.upfronthosting.co.za> Message-ID: <1459375883.72.0.0669945654604.issue26351@psf.upfronthosting.co.za> Changes by wim glenn : ---------- nosy: +wim.glenn _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 18:22:30 2016 From: report at bugs.python.org (Karl Stahl) Date: Wed, 30 Mar 2016 22:22:30 +0000 Subject: [issue2943] Distutils should generate a better error message when the SDK is not installed In-Reply-To: <1211455981.94.0.404413935613.issue2943@psf.upfronthosting.co.za> Message-ID: <1459376550.08.0.00226979616165.issue2943@psf.upfronthosting.co.za> Changes by Karl Stahl : ---------- nosy: +Karl Stahl _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 19:20:04 2016 From: report at bugs.python.org (Jeremy Kloth) Date: Wed, 30 Mar 2016 23:20:04 +0000 Subject: [issue26658] test_os fails when run on Windows ramdisk In-Reply-To: <1459183766.58.0.185896673203.issue26658@psf.upfronthosting.co.za> Message-ID: <1459380004.4.0.143737048308.issue26658@psf.upfronthosting.co.za> Jeremy Kloth added the comment: I'm fine with the tests for CreateFunction failing for an ImDisk virtual drive, however something needs to be changed with the test to not remove the test directory on tearDown(). Changing it to use a temporary directory to link against is a workaround, but still leaves remnants once finished. My solution of using lexists() in tearDown() however, ensures that any created items are cleaned up regardless of the test result. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 19:51:15 2016 From: report at bugs.python.org (Eitaro Kuwabara) Date: Wed, 30 Mar 2016 23:51:15 +0000 Subject: =?utf-8?q?=5Bissue26674=5D_=E3=80=90typo=E3=80=91_Japanese_Documentation?= Message-ID: <1459381875.82.0.77228452533.issue26674@psf.upfronthosting.co.za> New submission from Eitaro Kuwabara: I found a tiny typo in Japanese Documentation(Python3.5.1) http://docs.python.jp/3/library/pathlib.html#general-properties ???????????????????????????????????????????????????????????Path ?????????????????Path ?????????????????????? ???? ?????????????? ????????? ---------- messages: 262681 nosy: Eitaro Kuwabara priority: normal severity: normal status: open title: ?typo? Japanese Documentation versions: Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 20:15:28 2016 From: report at bugs.python.org (Ezio Melotti) Date: Thu, 31 Mar 2016 00:15:28 +0000 Subject: =?utf-8?q?=5Bissue26674=5D_=E3=80=90typo=E3=80=91_Japanese_Documentation?= In-Reply-To: <1459381875.82.0.77228452533.issue26674@psf.upfronthosting.co.za> Message-ID: <1459383328.06.0.654762682317.issue26674@psf.upfronthosting.co.za> Ezio Melotti added the comment: The Japanese translation is not officially maintained by us -- you should report this to the translators. They should also update the page at http://docs.python.jp/3/bugs.html since it points to this bug tracker (I assume this is how you got here). Thanks anyway for reporting the typo! ---------- nosy: +ezio.melotti resolution: -> third party stage: -> resolved status: open -> closed type: -> enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 22:49:57 2016 From: report at bugs.python.org (Swaprava Nath) Date: Thu, 31 Mar 2016 02:49:57 +0000 Subject: [issue26675] Appending to a large list flushes old entries Message-ID: <1459392597.63.0.301580588543.issue26675@psf.upfronthosting.co.za> New submission from Swaprava Nath: I'm storing several variables in a list after a computation in a for loop. I'm bundling the variables in a tuple and appending this tuple to a list. So, the structure should be: iter 1: list = [tuple1] iter 2: list = [tuple1, tuple2] iter 3: list = [tuple1, tuple2, tuple3] etc. and the tuple has dissimilar objects. Surprisingly, I see that the list grows until a point and then suddenly all old entries are flushed out and new tuple_n is the only entry iter n: list = [tuple_n] Is this a bug? Or is there a cap on the size of the list? ---------- files: knapsack.py messages: 262683 nosy: Swaprava Nath priority: normal severity: normal status: open title: Appending to a large list flushes old entries type: behavior versions: Python 2.7 Added file: http://bugs.python.org/file42330/knapsack.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 22:52:26 2016 From: report at bugs.python.org (Demur Rumed) Date: Thu, 31 Mar 2016 02:52:26 +0000 Subject: [issue26647] ceval: use Wordcode, 16-bit bytecode In-Reply-To: <1459034868.93.0.159802163565.issue26647@psf.upfronthosting.co.za> Message-ID: <1459392746.28.0.561670145058.issue26647@psf.upfronthosting.co.za> Demur Rumed added the comment: Added back HAVE_ARGUMENT & HAS_ARG. As a result printing has removed arguments Removed some code which was labelled unrelated This does _not_ include having f_lasti be -1 instead of -2 ---------- Added file: http://bugs.python.org/file42331/wpy2.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 22:56:18 2016 From: report at bugs.python.org (Swaprava Nath) Date: Thu, 31 Mar 2016 02:56:18 +0000 Subject: [issue26675] Appending to a large list flushes old entries In-Reply-To: <1459392597.63.0.301580588543.issue26675@psf.upfronthosting.co.za> Message-ID: <1459392978.22.0.421207301304.issue26675@psf.upfronthosting.co.za> Changes by Swaprava Nath : Removed file: http://bugs.python.org/file42330/knapsack.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 22:57:51 2016 From: report at bugs.python.org (Swaprava Nath) Date: Thu, 31 Mar 2016 02:57:51 +0000 Subject: [issue26675] Appending to a large list flushes old entries In-Reply-To: <1459392597.63.0.301580588543.issue26675@psf.upfronthosting.co.za> Message-ID: <1459393071.51.0.0052774773444.issue26675@psf.upfronthosting.co.za> Swaprava Nath added the comment: I realised that this is a normal behavior, I just had two for loops, nested, and every time the inner for loop runs, the list flushes. No worries, sorry! ---------- resolution: -> not a bug _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 22:58:16 2016 From: report at bugs.python.org (Swaprava Nath) Date: Thu, 31 Mar 2016 02:58:16 +0000 Subject: [issue26675] Appending to a large list flushes old entries In-Reply-To: <1459392597.63.0.301580588543.issue26675@psf.upfronthosting.co.za> Message-ID: <1459393096.61.0.276686918069.issue26675@psf.upfronthosting.co.za> Changes by Swaprava Nath : ---------- status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 23:42:15 2016 From: report at bugs.python.org (Mike Lenzen) Date: Thu, 31 Mar 2016 03:42:15 +0000 Subject: [issue26653] bisect raises a TypeError when hi is None In-Reply-To: <1459137648.89.0.2938672633.issue26653@psf.upfronthosting.co.za> Message-ID: <1459395735.22.0.479762374914.issue26653@psf.upfronthosting.co.za> Mike Lenzen added the comment: Sounds good, but then I think the docs could be clearer about this. I scratched my head at the function signature bisect.bisect_left(a, x, lo=0, hi=len(a)) because it isn't valid (in Python, maybe in C?), so I checked the source and saw hi=None. I'm not sure how to concisely describe it though. Listing two signatures doesn't seem ideal. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 31 00:29:57 2016 From: report at bugs.python.org (Raymond Hettinger) Date: Thu, 31 Mar 2016 04:29:57 +0000 Subject: [issue26488] hashlib command line interface In-Reply-To: <1457214866.19.0.989950954277.issue26488@psf.upfronthosting.co.za> Message-ID: <1459398597.29.0.290116959459.issue26488@psf.upfronthosting.co.za> Raymond Hettinger added the comment: I concur. The blocksize should be fixed and large (perhaps 256kB). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 31 01:18:57 2016 From: report at bugs.python.org (SilentGhost) Date: Thu, 31 Mar 2016 05:18:57 +0000 Subject: [issue26673] Tkinter error when opening IDLE configuration menu In-Reply-To: <1459351920.73.0.899924616631.issue26673@psf.upfronthosting.co.za> Message-ID: <1459401537.09.0.547287090664.issue26673@psf.upfronthosting.co.za> Changes by SilentGhost : ---------- components: +Tkinter nosy: +gpolo, kbk, roger.serwy, serhiy.storchaka, terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 31 01:34:27 2016 From: report at bugs.python.org (Mark Lawrence) Date: Thu, 31 Mar 2016 05:34:27 +0000 Subject: [issue2943] Distutils should generate a better error message when the SDK is not installed In-Reply-To: <1211455981.94.0.404413935613.issue2943@psf.upfronthosting.co.za> Message-ID: <1459402467.45.0.708084358791.issue2943@psf.upfronthosting.co.za> Changes by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 31 01:47:20 2016 From: report at bugs.python.org (Eryk Sun) Date: Thu, 31 Mar 2016 05:47:20 +0000 Subject: [issue26658] test_os fails when run on Windows ramdisk In-Reply-To: <1459183766.58.0.185896673203.issue26658@psf.upfronthosting.co.za> Message-ID: <1459403240.13.0.18084492332.issue26658@psf.upfronthosting.co.za> Eryk Sun added the comment: I don't disagree with using os.path.lexists. However, I think it should also use a temporary target directory. Also, if it's possible to fix the behavior of os.stat when GetFinalPathNameByHandle fails (considering we already have a handle for the target), then that's icing on the cake. Another issue related to leaving garbage behind is when the DeviceIoControl call fails to store the reparse point. In this case, _winapi.CreateJunction fails to remove the directory that it creates for the junction. That should be fixed and tested. If CreateJunction fails with ERROR_INVALID_FUNCTION, test_create_junction should be modified to fail only if self.junction still exists. Otherwise the test should pass, i.e. it worked correctly by raising an exception and cleaning up after itself given a filesystem that doesn't support junctions. ---------- type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 31 03:14:53 2016 From: report at bugs.python.org (Martin Panter) Date: Thu, 31 Mar 2016 07:14:53 +0000 Subject: [issue26676] Add missing XMLPullParser to ElementTree.__all__ Message-ID: <1459408493.0.0.169001428442.issue26676@psf.upfronthosting.co.za> Changes by Martin Panter : ---------- components: XML files: elementtree-all.patch keywords: patch nosy: martin.panter priority: normal severity: normal stage: patch review status: open title: Add missing XMLPullParser to ElementTree.__all__ versions: Python 3.6 Added file: http://bugs.python.org/file42332/elementtree-all.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 31 03:18:10 2016 From: report at bugs.python.org (Martin Panter) Date: Thu, 31 Mar 2016 07:18:10 +0000 Subject: [issue23883] __all__ lists are incomplete In-Reply-To: <1428423790.05.0.732881467443.issue23883@psf.upfronthosting.co.za> Message-ID: <1459408690.08.0.18997579728.issue23883@psf.upfronthosting.co.za> Changes by Martin Panter : ---------- dependencies: +Add missing XMLPullParser to ElementTree.__all__ _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 31 04:11:09 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 31 Mar 2016 08:11:09 +0000 Subject: [issue26676] Add missing XMLPullParser to ElementTree.__all__ Message-ID: <1459411869.75.0.477396717658.issue26676@psf.upfronthosting.co.za> New submission from Serhiy Storchaka: LGTM. ---------- assignee: -> martin.panter nosy: +serhiy.storchaka stage: patch review -> commit review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 31 05:49:58 2016 From: report at bugs.python.org (Roundup Robot) Date: Thu, 31 Mar 2016 09:49:58 +0000 Subject: [issue22854] Documentation/implementation out of sync for IO In-Reply-To: <1415804787.06.0.347049835041.issue22854@psf.upfronthosting.co.za> Message-ID: <20160331094955.18434.17603.4816707F@psf.io> Roundup Robot added the comment: New changeset dc9e5f09ac0c by Martin Panter in branch '3.5': Issue #22854: Clarify documentation about UnsupportedOperation and add tests https://hg.python.org/cpython/rev/dc9e5f09ac0c New changeset c27e9dcad1a3 by Martin Panter in branch 'default': Issue #22854: Merge UnsupportedOperation fixes from 3.5 https://hg.python.org/cpython/rev/c27e9dcad1a3 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 31 06:00:29 2016 From: report at bugs.python.org (Roundup Robot) Date: Thu, 31 Mar 2016 10:00:29 +0000 Subject: [issue22854] Documentation/implementation out of sync for IO In-Reply-To: <1415804787.06.0.347049835041.issue22854@psf.upfronthosting.co.za> Message-ID: <20160331100022.53138.45557.01ABDCB9@psf.io> Roundup Robot added the comment: New changeset 3d9d9ca75a31 by Martin Panter in branch '2.7': Issue #22854: fileno() is always required in IOBase; remove test https://hg.python.org/cpython/rev/3d9d9ca75a31 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 31 06:03:41 2016 From: report at bugs.python.org (SilentGhost) Date: Thu, 31 Mar 2016 10:03:41 +0000 Subject: [issue26655] pathlib glob case sensitivity issue on Windows In-Reply-To: <1459171442.9.0.718616645463.issue26655@psf.upfronthosting.co.za> Message-ID: <1459418621.73.0.956329306757.issue26655@psf.upfronthosting.co.za> Changes by SilentGhost : ---------- resolution: -> wont fix stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 31 06:55:12 2016 From: report at bugs.python.org (Roundup Robot) Date: Thu, 31 Mar 2016 10:55:12 +0000 Subject: [issue22854] Documentation/implementation out of sync for IO In-Reply-To: <1415804787.06.0.347049835041.issue22854@psf.upfronthosting.co.za> Message-ID: <20160331105508.5055.77346.9FE70B8A@psf.io> Roundup Robot added the comment: New changeset fb10d1f5016e by Martin Panter in branch 'default': Issue #22854: Skip pipe seekable() tests on Windows https://hg.python.org/cpython/rev/fb10d1f5016e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 31 07:24:54 2016 From: report at bugs.python.org (Roundup Robot) Date: Thu, 31 Mar 2016 11:24:54 +0000 Subject: [issue22854] Documentation/implementation out of sync for IO In-Reply-To: <1415804787.06.0.347049835041.issue22854@psf.upfronthosting.co.za> Message-ID: <20160331112451.97191.64100.091F5701@psf.io> Roundup Robot added the comment: New changeset 66765a49465f by Martin Panter in branch '3.5': Issue #22854: Skip pipe seek tests on Windows https://hg.python.org/cpython/rev/66765a49465f New changeset 3b7811b58a1f by Martin Panter in branch 'default': Issue #22854: Merge Windows pipe skipping from 3.5 https://hg.python.org/cpython/rev/3b7811b58a1f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 31 07:32:10 2016 From: report at bugs.python.org (Martin Panter) Date: Thu, 31 Mar 2016 11:32:10 +0000 Subject: [issue22854] Documentation/implementation out of sync for IO In-Reply-To: <1415804787.06.0.347049835041.issue22854@psf.upfronthosting.co.za> Message-ID: <1459423930.73.0.601260624299.issue22854@psf.upfronthosting.co.za> Martin Panter added the comment: I gave up on porting the fix to 2.7. Python 3 raises UnsupportedOperation (which inherits ValueError) in many cases due to Issue 9293, but Python 2 raises IOError (which does not inherit ValueError). Changing how BufferedWriter.read() etc work in Python 2 would break test_io_after_close(). Also, none of the doc strings in Python 2 need fixing. Also according to the buildbots, Windows can seek in pipes. Or at least tell() doesn?t raise an exception. So I skipped the seek testing on Windows. ---------- versions: -Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 31 08:17:47 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 31 Mar 2016 12:17:47 +0000 Subject: [issue26494] Double deallocation on iterator exhausting In-Reply-To: <1457288764.94.0.168287313304.issue26494@psf.upfronthosting.co.za> Message-ID: <1459426667.4.0.0525624424505.issue26494@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- assignee: -> serhiy.storchaka resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 31 08:18:36 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 31 Mar 2016 12:18:36 +0000 Subject: [issue26492] Exhausted array iterator should left exhausted In-Reply-To: <1457280280.79.0.892048425987.issue26492@psf.upfronthosting.co.za> Message-ID: <1459426716.84.0.373520266296.issue26492@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 31 11:08:02 2016 From: report at bugs.python.org (Larry Hastings) Date: Thu, 31 Mar 2016 15:08:02 +0000 Subject: [issue26671] Clean up path_converter in posixmodule.c In-Reply-To: <1459330274.5.0.616265410958.issue26671@psf.upfronthosting.co.za> Message-ID: <1459436882.35.0.436217110772.issue26671@psf.upfronthosting.co.za> Larry Hastings added the comment: I approve in principle, but this patch isn't ready. If we compile on Win32, and allow_fd is on, and they pass in an invalid fd, your patched code will reach line 914 "length = PyBytes_GET_SIZE(bytes);" but bytes will be uninitialized. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 31 11:49:21 2016 From: report at bugs.python.org (Florian Dold) Date: Thu, 31 Mar 2016 15:49:21 +0000 Subject: [issue26677] pyvenv: activate.fish breaks $PATH for bash scripts Message-ID: <1459439361.75.0.379052301641.issue26677@psf.upfronthosting.co.za> New submission from Florian Dold: When sourcing the activate script from bash, $PATH is restored from $_OLD_VIRTUAL_PATH. If bash was invoked from fish (e.g. when running a shell script), and a virtualenv was activated from fish via activate.fish, the $_OLD_VIRTUAL_PATH will contain path separated by the ascii record separator char (chr(30)), since this is how the fish shell stores arrays. But the activate script for bash will then set $PATH to $_OLD_VIRTUAL_PATH, which breaks most bash scripts. Instead the activate scripts should differentiate between $_OLD_BASH_VIRTUAL_PATH and $_OLD_FISH_VIRTUAL_PATH or the activate.fish should take care to replace chr(30) with colons before it sets $_OLD_VIRTUAL_PATH. bash$ pyvenv my-venv bash$ fish fish$ . my-venv/bin/activate.fish fish$ bash bash$ . my-venv/bin/activate # $PATH is now broken, since it contains record separators instead of colons to separate paths ---------- components: Library (Lib) messages: 262696 nosy: Florian.Dold priority: normal severity: normal status: open title: pyvenv: activate.fish breaks $PATH for bash scripts versions: Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 31 12:09:18 2016 From: report at bugs.python.org (SilentGhost) Date: Thu, 31 Mar 2016 16:09:18 +0000 Subject: [issue26677] pyvenv: activate.fish breaks $PATH for bash scripts In-Reply-To: <1459439361.75.0.379052301641.issue26677@psf.upfronthosting.co.za> Message-ID: <1459440558.8.0.410207870229.issue26677@psf.upfronthosting.co.za> Changes by SilentGhost : ---------- nosy: +vinay.sajip type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 31 13:17:16 2016 From: report at bugs.python.org (Barry A. Warsaw) Date: Thu, 31 Mar 2016 17:17:16 +0000 Subject: [issue26632] __all__ decorator In-Reply-To: <1458871966.39.0.0608393740585.issue26632@psf.upfronthosting.co.za> Message-ID: <20160331131712.3265775e@subdivisions.wooz.org> Barry A. Warsaw added the comment: On Mar 25, 2016, at 02:12 AM, Eryk Sun wrote: >I added a prototype to Python/bltinmodule.c that gets or creates the __all__ >list from the current globals (i.e. PyEval_GetGlobals). Hi Eryk. Can you post your diff to bltinmodule.c? I'd like to see your code. >It accepts at most one positional argument and any number of keyword >arguments. It adds the positional argument's __name__ to __all__, sets it in >globals, and returns a reference for use as a decorator. The keyword argument >dict is used to update globals and extend __all__. I like this. The dual functionality of `public` looks like it will handle almost all use cases. I think we're in widespread agreement about the decorator, and the keyword arguments are a nice approach to public constants. I guess I'm a little less sure about the positional argument API. In adding @public to Mailman, I noticed there are a few public names which are instances. These could be "publicized" with the keyword argument approach, but I don't think they can work as positional arguments, because the instances themselves don't have __name__s. For example, currently: factory = DateFactory() factory.reset() today = factory.today now = factory.now layers.MockAndMonkeyLayer.register_reset(factory.reset) __all__.extend([ 'factory', 'now', 'today', ]) With only keyword arguments, which isn't bad: public(factory=DateFactory()) factory.reset() public(today=factory.today, now=factor.now) What's the use case for positionals? >The positional argument must have a __name__ that's a string: Right. But what class of objects does that cover that isn't already covered (or that explicitly appending to __all__ is good enough)? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 31 13:36:39 2016 From: report at bugs.python.org (Andy Maier) Date: Thu, 31 Mar 2016 17:36:39 +0000 Subject: [issue26678] Incorrect linking to elements in datetime package Message-ID: <1459445799.81.0.161788997927.issue26678@psf.upfronthosting.co.za> New submission from Andy Maier: Hi, I did search for these in the open bugs, but did not find any matching bug. I have a project that revealed that some of its InterSphinx links to existing classes/types or methods to not resolve their targets, or to resolve to a target that is not the right one (IMO). This issue here describes everything I found in the datetime package. Line numbers in this issue apply to the datetime.rst file as of commit 96a98bcaac70 (https://hg.python.org/cpython/file/96a98bcaac70/Doc/library/datetime.rst). * class datetime.tzinfo: An intersphinx link to it gets resolved but targets the short description of the class in the intro (line 106 of datetime.rst), and I did not find a way to target the full description (line 1552), which is really what this should be resolved to (IMO). I suspect that this has to do with the fact that this class has only one anchor on its short description on line 106, while companion classes such as datetime.datetime have two anchors (lines 91 and 681) where the last one wins (and happens to be the long description). However, see the next item. * class datetime.timezone: Same issue as for class datetime.tzinfo; links get resolved but land on the short intro. However, this time there are two anchors (lines 113 and 1795). So maybe my suspicion above is rather speculation... * method datetime.tzinfo.utcoffset: An intersphinx link to it does not get resolved. On line 1579 in datetime.rst, there is a `.. method:: tzinfo.utcoffset(dt)` but at least these intersphinx links did not get resolved: :func:`py:tzinfo.utcoffset` :func:`py:datetime.tzinfo.utcoffset` Do method anchors need the anchor for their defining class close by to work? Which because if the first issue above, would be the short version of it, way above. (Again speculation) * Same for method datetime.tzinfo.dst ---------- assignee: docs at python components: Documentation messages: 262698 nosy: andymaier, docs at python priority: normal severity: normal status: open title: Incorrect linking to elements in datetime package type: enhancement versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 31 14:36:50 2016 From: report at bugs.python.org (Aviv Palivoda) Date: Thu, 31 Mar 2016 18:36:50 +0000 Subject: [issue26488] hashlib command line interface In-Reply-To: <1457214866.19.0.989950954277.issue26488@psf.upfronthosting.co.za> Message-ID: <1459449410.76.0.585514089719.issue26488@psf.upfronthosting.co.za> Aviv Palivoda added the comment: I am adding a new patch with a API compatible to GNU md5sum: $ python -m hashlib md5 /bin/sh $ d985d0ea551c1253c2305140c583d11f /bin/sh I will soon add the feature's requested by Victor: 1) The check option. 2) Running the hash calculation for different files in different threads. If anyone would like any other feature he thinks will be helpful please post it. If we choose to use this API we should remove the dependency on issue 14156. ---------- Added file: http://bugs.python.org/file42333/hashlib-script-mod-md5sum-style.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 31 14:46:04 2016 From: report at bugs.python.org (=?utf-8?b?SsSBbmlzIMWgbGFwacWGxaE=?=) Date: Thu, 31 Mar 2016 18:46:04 +0000 Subject: [issue26606] logging.baseConfig is missing the encoding parameter In-Reply-To: <1458598626.88.0.490041392552.issue26606@psf.upfronthosting.co.za> Message-ID: <1459449964.22.0.245714340784.issue26606@psf.upfronthosting.co.za> J?nis ?lapi?? added the comment: Using the stream or other options requires much more coding (for example, an additional redirection of sys.stdout to a file) instead of just one line with the basicConfig. In the meanwhile, I tried to use logging.FileHandler instead where I could specify the encoding in parameters and it works as I wanted when used the basicConfig method. Anyway, it would be nice to have the encoding parameter among the basicConfig parameters when logging to files. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 31 15:33:42 2016 From: report at bugs.python.org (Robert Bachmann) Date: Thu, 31 Mar 2016 19:33:42 +0000 Subject: [issue26679] curses: Descripton of KEY_NPAGE and KEY_PPAGE inverted Message-ID: <1459452822.7.0.402599297468.issue26679@psf.upfronthosting.co.za> New submission from Robert Bachmann: The table on lists: __________________________ Page Up KEY_NPAGE Page Down KEY_PPAGE __________________________ it should be vice versa. ---------- assignee: docs at python components: Documentation files: curses.patch keywords: patch messages: 262701 nosy: Robert Bachmann, docs at python priority: normal severity: normal status: open title: curses: Descripton of KEY_NPAGE and KEY_PPAGE inverted type: enhancement versions: Python 2.7, Python 3.5, Python 3.6 Added file: http://bugs.python.org/file42334/curses.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 31 15:34:24 2016 From: report at bugs.python.org (Robert Smallshire) Date: Thu, 31 Mar 2016 19:34:24 +0000 Subject: [issue26680] Incorporating float.is_integer into the numeric tower and Decimal Message-ID: <1459452864.35.0.120403756979.issue26680@psf.upfronthosting.co.za> New submission from Robert Smallshire: When the useful float.is_integer method was added the opportunity was missed to incorporate this method into the numeric tower defined in numbers.py. This increased the API distance between different number types, making them less substitutable than previously, leading to what might be considered to be absurd behaviour: >>> a = 5.0 >>> b = 5 >>> a.is_integer() True >>> b.is_integer() Traceback (most recent call last): File "", line 1, in AttributeError: 'int' object has no attribute 'is_integer' The first attached patch modifies Python to: 1) Implement int.is_integer() to always return True 2) Add Real.is_integer() as an abstract method in numbers.py 3) Provide a default implementation in Rational.is_integer() in numbers.py 4) Adds tests for is_integer() for int and Fraction. 5) Documentation changes commensurate with above. Although the Decimal type deliberately lies outside the numeric tower for reasons not relevant here, the principle of least surprise suggests that it too should support is_integer(). In fact, the implementation already contains just such a function, although it is not exposed to Python. The second patch implements is_integer() for both the pure Python and C implementations of Decimal, again with commensurate tests and documentation changes. I hope these changes can be implemented to reduce the degree of surprise encountered when working with different number types in Python. ---------- components: Library (Lib) files: is_integer_numeric_tower.patch keywords: patch messages: 262702 nosy: Robert Smallshire2 priority: normal severity: normal status: open title: Incorporating float.is_integer into the numeric tower and Decimal type: enhancement Added file: http://bugs.python.org/file42335/is_integer_numeric_tower.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 31 15:34:50 2016 From: report at bugs.python.org (SilentGhost) Date: Thu, 31 Mar 2016 19:34:50 +0000 Subject: [issue26488] hashlib command line interface In-Reply-To: <1457214866.19.0.989950954277.issue26488@psf.upfronthosting.co.za> Message-ID: <1459452890.74.0.590500058214.issue26488@psf.upfronthosting.co.za> SilentGhost added the comment: The mailing system is acting up, so just for the record, I've left comments on rietveld regarding md5sum-style patch. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 31 15:39:32 2016 From: report at bugs.python.org (Robert Smallshire) Date: Thu, 31 Mar 2016 19:39:32 +0000 Subject: [issue26680] Incorporating float.is_integer into the numeric tower and Decimal In-Reply-To: <1459452864.35.0.120403756979.issue26680@psf.upfronthosting.co.za> Message-ID: <1459453172.49.0.227917744017.issue26680@psf.upfronthosting.co.za> Robert Smallshire added the comment: Adding the second patch file. ---------- Added file: http://bugs.python.org/file42336/is_integer_decimal.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 31 15:47:23 2016 From: report at bugs.python.org (SilentGhost) Date: Thu, 31 Mar 2016 19:47:23 +0000 Subject: [issue26680] Incorporating float.is_integer into the numeric tower and Decimal In-Reply-To: <1459452864.35.0.120403756979.issue26680@psf.upfronthosting.co.za> Message-ID: <1459453643.08.0.580826522856.issue26680@psf.upfronthosting.co.za> Changes by SilentGhost : ---------- components: +Extension Modules nosy: +facundobatista, mark.dickinson, rhettinger, skrah stage: -> patch review versions: +Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 31 16:10:57 2016 From: report at bugs.python.org (Christian Heimes) Date: Thu, 31 Mar 2016 20:10:57 +0000 Subject: [issue26488] hashlib command line interface In-Reply-To: <1457214866.19.0.989950954277.issue26488@psf.upfronthosting.co.za> Message-ID: <1459455057.56.0.865804214112.issue26488@psf.upfronthosting.co.za> Christian Heimes added the comment: Threading doesn't make much sense here. The runtime of hash computation is usually dominated by I/O performance. On a typical consumer computer SSDs have a sequential read performance of 200 to 500 MiB/sec. SHA-512 performance between 100 to 150 Mib/sec. Threading could make parallel computation a bit faster, but at the cost of a much more complex implementation. Let's keep it simple. Both Python's hashlib implementation and OpenSSL aren't the best foundation if you are aiming for maximum performance. All libraries do couple of malloc()s, memcpy() and have additional overheads, too. And please don't use MD5 in your examples. Go for sha256. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 31 16:43:14 2016 From: report at bugs.python.org (Aviv Palivoda) Date: Thu, 31 Mar 2016 20:43:14 +0000 Subject: [issue26488] hashlib command line interface In-Reply-To: <1457214866.19.0.989950954277.issue26488@psf.upfronthosting.co.za> Message-ID: <1459456994.12.0.404664569866.issue26488@psf.upfronthosting.co.za> Aviv Palivoda added the comment: Thanks for the review SilentGhost. I am including the patch after the changes from your CR comments. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 31 16:46:15 2016 From: report at bugs.python.org (Aviv Palivoda) Date: Thu, 31 Mar 2016 20:46:15 +0000 Subject: [issue26488] hashlib command line interface In-Reply-To: <1457214866.19.0.989950954277.issue26488@psf.upfronthosting.co.za> Message-ID: <1459457175.26.0.654950671562.issue26488@psf.upfronthosting.co.za> Changes by Aviv Palivoda : Added file: http://bugs.python.org/file42337/hashlib-script-mod-md5sum-style-2.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 31 17:19:36 2016 From: report at bugs.python.org (Vinay Sajip) Date: Thu, 31 Mar 2016 21:19:36 +0000 Subject: [issue26606] logging.baseConfig is missing the encoding parameter In-Reply-To: <1458598626.88.0.490041392552.issue26606@psf.upfronthosting.co.za> Message-ID: <1459459176.02.0.180478407809.issue26606@psf.upfronthosting.co.za> Vinay Sajip added the comment: > requires much more coding Much more? How so? It just seems like one open() call and passing the result to basicConfig(). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 31 17:24:12 2016 From: report at bugs.python.org (Roundup Robot) Date: Thu, 31 Mar 2016 21:24:12 +0000 Subject: [issue22854] Documentation/implementation out of sync for IO In-Reply-To: <1415804787.06.0.347049835041.issue22854@psf.upfronthosting.co.za> Message-ID: <20160331212403.53142.39792.09687258@psf.io> Roundup Robot added the comment: New changeset b3c79e0ba477 by Martin Panter in branch '3.5': Issue #22854: Fix logic for skipping test https://hg.python.org/cpython/rev/b3c79e0ba477 New changeset de8412dc477e by Martin Panter in branch 'default': Issue #22854: Merge test fix from 3.5 https://hg.python.org/cpython/rev/de8412dc477e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 31 18:24:18 2016 From: report at bugs.python.org (Martin Panter) Date: Thu, 31 Mar 2016 22:24:18 +0000 Subject: [issue26678] Incorrect linking to elements in datetime package In-Reply-To: <1459445799.81.0.161788997927.issue26678@psf.upfronthosting.co.za> Message-ID: <1459463058.36.0.941112305855.issue26678@psf.upfronthosting.co.za> Martin Panter added the comment: Currently the ?datetime? documentation has quick descriptions of classes marked up with ?.. class::? in the introduction, and then dedicated sections with more details. Many other parts of Python?s documentation have a similar structure. IMO it is better to include the ?.. class::? markup closer to the list of methods, and then each method can be indented underneath it. See my changes to the ?socketserver? documentation (Issue 15608, compare 3.4 vs 3.5) where I indented a whole lot of methods under class definitions. I suspect the reason why things are not like this is just that it is leftover from a conversion from an earlier markup format. The earlier class introductions are also marked up with :noindex:, which would explain which become link targets. Dunno about your intersphinx stuff though. Is that linking to the Python documentation from external projects? ---------- nosy: +martin.panter _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 31 19:21:14 2016 From: report at bugs.python.org (Matthias welp) Date: Thu, 31 Mar 2016 23:21:14 +0000 Subject: [issue26681] decorators for attributes Message-ID: <1459466474.52.0.905793421704.issue26681@psf.upfronthosting.co.za> New submission from Matthias welp: This is a suggestion, and not final. The current ways to define the getter and setter methods for an attribute are these two: @property def name(): """ Docstring """ pass @name.setter def name(value): pass @name.deleter def name(value): pass and name = property(getter, setter, deleter, docstring) Of the two ways you can create a property, only the second one allows you to use your method definition multiple times, as seen here: value = property(getter, setter, deleter) value_2 = property(getter, setter, deleter) but this has the drawback that it can only use defined method. You can go around by defining a wrapper method, but even then you will have to put the value of your attribute inside the parenthesis of your behaviour definition, or put another assignation statement into your file. To prevent this, I propose the addition of decorators to attributes, which would behave like the decorators on functions: class Decorator(object): def __init__(self, ref): self.val = ref def __get__(self): return self.val def __set__(self, val): self.val = val def __del__(self): del self.val @Decorator val = value @Decorator val_2 = value_2 This should behave just like decorators on functions, but then with the functionality of attributes. In the proposed __init__ method ref would be the attribute after the evaluation of its declaration, similar to function decorators. The main benefit of this would be that the definition of attributes that behave in a similar way (get-, set- and delete-behaviour is the same) you only have to define one decorator for multiple attributes and you can change the behaviour of your attributes in a more intuitive way. The current alternatives are these: class Decorator(object): def __init__(self, ref): self.val = ref def __get__(self): return self.val def __set__(self, val): self.val = val def __del__(self): del self.val @Decorator def val(): pass @Decorator def val_2(): pass and def decorate(value): _value = value def get(): return _value def set(value): _value = value def del(): del _value return property(get, set, del) @decorate def val(): pass val_2 = decorate(1) val_3 = decorate() val_3 = 20 I think it is weird that to create an attribute that is decorated, I need to create a function, or need to explicitely call the decorator. This is why the decorators were added for functions, I think it might as well be added for attributes. ---------- components: Interpreter Core messages: 262710 nosy: Matthias welp priority: normal severity: normal status: open title: decorators for attributes type: enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 31 19:54:06 2016 From: report at bugs.python.org (Martin Panter) Date: Thu, 31 Mar 2016 23:54:06 +0000 Subject: [issue22854] Documentation/implementation out of sync for IO In-Reply-To: <1415804787.06.0.347049835041.issue22854@psf.upfronthosting.co.za> Message-ID: <1459468446.38.0.0504036225062.issue22854@psf.upfronthosting.co.za> Changes by Martin Panter : ---------- resolution: -> fixed stage: commit review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 31 20:05:45 2016 From: report at bugs.python.org (Ethan Furman) Date: Fri, 01 Apr 2016 00:05:45 +0000 Subject: [issue26681] decorators for attributes In-Reply-To: <1459466474.52.0.905793421704.issue26681@psf.upfronthosting.co.za> Message-ID: <1459469145.63.0.44775185979.issue26681@psf.upfronthosting.co.za> Ethan Furman added the comment: Please discuss this idea on the Python-Ideas mailing list first; if that goes well you can bring the idea to Python-Dev; if that also goes well feel free to reopen this issue. --- In the meantime you could probably do something with a custom descriptor/class decorator pair; if you need help with that you could try the Python-List or StackOverflow. ---------- nosy: +ethan.furman resolution: -> rejected stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 31 20:28:21 2016 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 01 Apr 2016 00:28:21 +0000 Subject: [issue26682] Ttk Notebook tabs do not show with 1-2 char names Message-ID: <1459470501.64.0.00235900367072.issue26682@psf.upfronthosting.co.za> New submission from Terry J. Reedy: >From https://stackoverflow.com/questions/36336010/cannot-see-all-tabs-in-ttk-notebook import tkinter as tk from tkinter.ttk import Frame, Notebook root = tk.Tk() nb = Notebook(root, width=320, height=240) nb.pack(fill='both', expand=1) page0 = Frame(nb) page1 = Frame(nb) page2 = Frame(nb) page3 = Frame(nb) page4 = Frame(nb) nb.add(page0, text="0") nb.add(page1, text="1") nb.add(page2, text="2") nb.add(page3, text="3") nb.add(page4, text="4") Only tabs 0 and 1 show. Add a space before or after the number and 2 & 3 show. Add 6 spaces after 4 and '4 ' shows. Appears to work OK with 3 chars, with first and third non-blank. I presume this is a ttk bug. http://www.tcl.tk/man/tcl8.6/TkCmd/ttk_notebook.htm#M14 just says 'a string'. I plan to close this as 3rd party in a few days, but I wanted to document the defacto spec here on the tracker. ---------- components: Tkinter messages: 262712 nosy: serhiy.storchaka, terry.reedy, wordtech priority: normal severity: normal status: open title: Ttk Notebook tabs do not show with 1-2 char names type: behavior versions: Python 2.7, Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 31 21:31:32 2016 From: report at bugs.python.org (Raymond Hettinger) Date: Fri, 01 Apr 2016 01:31:32 +0000 Subject: [issue26683] Questionable terminology for describing what locals() does Message-ID: <1459474292.87.0.515226107717.issue26683@psf.upfronthosting.co.za> New submission from Raymond Hettinger: The docs for locals() say that inside a function that local variables and free variables are included: https://docs.python.org/3/library/functions.html#locals Elsewhere we use the terms "cell variables" or "nonlocals". Mathematically, the word "free" means unbound, so that isn't applicable here and isn't the usual way of describing variables in the enclosing scope. >>> def f(x): def g(y): z = x + y print(locals()) return g >>> f(10)(20) {'x': 10, 'y': 20, 'z': 30} Also, I'm not sure why "x" and "y" are included in the definition for locals(). That seems strange given that "x" and "y" are not local to "g" and that "x += 1" would fail with an UnboundLocalError. ---------- assignee: docs at python components: Documentation messages: 262713 nosy: docs at python, rhettinger priority: normal severity: normal status: open title: Questionable terminology for describing what locals() does versions: Python 2.7, Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 31 21:47:33 2016 From: report at bugs.python.org (Raymond Hettinger) Date: Fri, 01 Apr 2016 01:47:33 +0000 Subject: [issue26680] Incorporating float.is_integer into the numeric tower and Decimal In-Reply-To: <1459452864.35.0.120403756979.issue26680@psf.upfronthosting.co.za> Message-ID: <1459475253.57.0.147042449167.issue26680@psf.upfronthosting.co.za> Raymond Hettinger added the comment: -0 I question whether we ever needed a short-cut for x==int(x). Adding this to the numeric tower would cause it to propagate broadly including the int type. To me, this seems like feature creep resulting in language bloat. The decimal module has been around for a long time and no one has ever requested the feature. This suggests it would be just another unused method in a module that already has learnability and usability problems due to a fat API. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 31 21:50:25 2016 From: report at bugs.python.org (Raymond Hettinger) Date: Fri, 01 Apr 2016 01:50:25 +0000 Subject: [issue26680] Incorporating float.is_integer into the numeric tower and Decimal In-Reply-To: <1459452864.35.0.120403756979.issue26680@psf.upfronthosting.co.za> Message-ID: <1459475425.39.0.350180154858.issue26680@psf.upfronthosting.co.za> Raymond Hettinger added the comment: One other thought: the name is_integer() is inconsistent with the nomenclature in numbers.py. Had this been included at the outset, its name would have been is_integral(). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 31 22:09:27 2016 From: report at bugs.python.org (Demur Rumed) Date: Fri, 01 Apr 2016 02:09:27 +0000 Subject: [issue26647] ceval: use Wordcode, 16-bit bytecode In-Reply-To: <1459034868.93.0.159802163565.issue26647@psf.upfronthosting.co.za> Message-ID: <1459476567.88.0.975304638311.issue26647@psf.upfronthosting.co.za> Demur Rumed added the comment: Addressed feedback from josh.rosenberg besides reintroducing FOURTH/SET_FOURTH ---------- Added file: http://bugs.python.org/file42338/wpy3.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 31 22:10:17 2016 From: report at bugs.python.org (Demur Rumed) Date: Fri, 01 Apr 2016 02:10:17 +0000 Subject: [issue26647] ceval: use Wordcode, 16-bit bytecode In-Reply-To: <1459034868.93.0.159802163565.issue26647@psf.upfronthosting.co.za> Message-ID: <1459476617.5.0.893610326018.issue26647@psf.upfronthosting.co.za> Changes by Demur Rumed : Removed file: http://bugs.python.org/file42338/wpy3.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 31 22:12:49 2016 From: report at bugs.python.org (Demur Rumed) Date: Fri, 01 Apr 2016 02:12:49 +0000 Subject: [issue26647] ceval: use Wordcode, 16-bit bytecode In-Reply-To: <1459034868.93.0.159802163565.issue26647@psf.upfronthosting.co.za> Message-ID: <1459476769.24.0.860193907976.issue26647@psf.upfronthosting.co.za> Changes by Demur Rumed : Added file: http://bugs.python.org/file42339/wpy3.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 31 23:04:49 2016 From: report at bugs.python.org (Ethan Furman) Date: Fri, 01 Apr 2016 03:04:49 +0000 Subject: [issue26684] pathlib.Path.with_name() and .with_suffix do not allow combining with an empty Path Message-ID: <1459479889.57.0.867705716846.issue26684@psf.upfronthosting.co.za> New submission from Ethan Furman: The methods .with_name() and .with_suffix() of pathlib.Path (and friends) do not allow a name or suffix to be added to a path alone -- I get ValueError(... has an empty name...). This is the documented behavior, but it seems incredibly user-unfriendly. ---------- messages: 262717 nosy: ethan.furman, pitrou priority: normal severity: normal status: open title: pathlib.Path.with_name() and .with_suffix do not allow combining with an empty Path type: behavior versions: Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 31 23:36:16 2016 From: report at bugs.python.org (Martin Panter) Date: Fri, 01 Apr 2016 03:36:16 +0000 Subject: [issue26683] Questionable terminology for describing what locals() does In-Reply-To: <1459474292.87.0.515226107717.issue26683@psf.upfronthosting.co.za> Message-ID: <1459481776.11.0.164121959283.issue26683@psf.upfronthosting.co.za> Martin Panter added the comment: Regarding ?free variables?, in Issue 17546 I proposed the wording ?. . . also includes non-local, non-global names?. In your code example, I would consider y to be 100 percent local to the g() function. It is a function parameter, and ?y += 1? should work. I agree x is not a true local, it is a ?non-local non-global?. A national variable maybe :) For functions, considering that you shouldn?t modify the dictionary (original concern in Issue 17546), I do agree the behaviour is a bit strange and inconsistent. It might have made more sense to either only return true locals, or return a complete namespace of locals, non-locals, globals, and builtins. It seems there is no way to get a similar list of non-local non-globals in a class scope. ---------- nosy: +martin.panter _______________________________________ Python tracker _______________________________________