[issue23688] unnecessary copying of memoryview in gzip.GzipFile.write ?

2015-03-17 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Better way is data = data.cast('B'). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23688 ___ ___

[issue23688] unnecessary copying of memoryview in gzip.GzipFile.write ?

2015-03-17 Thread STINNER Victor
STINNER Victor added the comment: Better way is data = data.cast('B'). Why is this cast required? Can you please elaborate? If some memoryview must be rejected, again, we need more unit tests. -- ___ Python tracker rep...@bugs.python.org

[issue23685] Fix usage of PyMODINIT_FUNC

2015-03-17 Thread Steve Dower
Steve Dower added the comment: I don't think we should be using PyMODINIT_FUNC for builtin modules, since that will make the init functions publicly available from python35.dll. That said, I do like being able to be consistent here... can we define PyMODINIT_FUNC differently when building

[issue23685] Fix usage of PyMODINIT_FUNC

2015-03-17 Thread STINNER Victor
STINNER Victor added the comment: I don't think we should be using PyMODINIT_FUNC for builtin modules, since that will make the init functions publicly available from python35.dll. Do you mean that my change on PC/config.c is wrong? For example, Modules/arraymodule.c already contains:

[issue23695] idiom for clustering a data series into n-length groups

2015-03-17 Thread Raymond Hettinger
Changes by Raymond Hettinger raymond.hettin...@gmail.com: -- assignee: docs@python - rhettinger nosy: +rhettinger ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23695 ___

[issue23688] unnecessary copying of memoryview in gzip.GzipFile.write?

2015-03-17 Thread Martin Panter
Martin Panter added the comment: I would say that the current patch looks correct enough, in that it would still get the correct lengths when a memoryview() object is passed in. The zlib module’s crc32() function and compress() method already seem to support arbitrary bytes-like objects. But

[issue23207] logging.basicConfig does not validate keyword arguments

2015-03-17 Thread Jeremy Goss
Jeremy Goss added the comment: The argument validation in basicConfig has introduced another problem. I cannot pass in an optional filename/filemode argument pair. Previously, I passed in an optional logfile argument from ArgumentParser (which could be None). Now, I get a ValueError because

[issue19495] context manager for measuring duration of blocks of code

2015-03-17 Thread Martin Panter
Changes by Martin Panter vadmium...@gmail.com: -- nosy: +vadmium ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19495 ___ ___ Python-bugs-list

[issue19351] python msi installers - silent mode

2015-03-17 Thread Doug Rohm
Doug Rohm added the comment: I realize this hasn't been commented on for a long time, but I'm noticing the same issue trying to do a silent install with the 3.4.3 x64 windows installer. The 3.4.2 x64 windows installer worked perfectly fine, but I can't seem to get the registry and add/remove

[issue23695] idiom for clustering a data series into n-length groups

2015-03-17 Thread Paddy McCarthy
Paddy McCarthy added the comment: Hmmm. It seems that the problem isn't to do with the fact that it works, or how to apply it; the problem is with *how* it works. Making it an idiom means that too many will use it without knowing why it works which could lead to later maintenance issues. I

[issue23441] rlcompleter: tab on empty prefix = insert spaces

2015-03-17 Thread R. David Murray
R. David Murray added the comment: The CLI is a UI. We're using readline facilities (ie: the terminal) to improve it. And people cut and paste from the interactive terminal, so I think the presence of tab characters is a negative from that perspective as well. --

[issue23458] [2.7] random: make the file descriptor non-inheritable (on POSIX)

2015-03-17 Thread Ned Deily
Ned Deily added the comment: FD_CLOEXEC is first support on OS X 10.5. Here's a patch to skip the test on earlier systems: tested on 10.4, 10.5, and 10.10. -- nosy: +ned.deily stage: - commit review Added file: http://bugs.python.org/file38516/issue23458_tiger.patch

[issue12855] linebreak sequences should be better documented

2015-03-17 Thread Martin Panter
Martin Panter added the comment: Note to self, or anyone else handling this patch: See https://bugs.python.org/issue22232#msg225769 for further improvement ideas: * Might be good to bring back the reference to universal newlines, but say it accepts additional line boundaries * Terry also

[issue22233] http.client splits headers on none-\r\n characters

2015-03-17 Thread Martin Panter
Changes by Martin Panter vadmium...@gmail.com: -- nosy: +vadmium ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22233 ___ ___ Python-bugs-list

[issue22232] str.splitlines splitting on non-\r\n characters

2015-03-17 Thread Martin Panter
Changes by Martin Panter vadmium...@gmail.com: -- nosy: +vadmium ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22232 ___ ___ Python-bugs-list

[issue23624] str.center inconsistent with format ^

2015-03-17 Thread Vedran Čačić
Vedran Čačić added the comment: Only one detail to resolve: you say format is quite capable of handing a variable width field. It does, but not in a really nice way. Honestly, would you really rather see {:^{}}.format(title, width) than title.center(width) ? Nested formats are

[issue22852] urllib.parse wrongly strips empty #fragment

2015-03-17 Thread Demian Brecht
Demian Brecht added the comment: I cannot imagine some existing code (other than an exploit) that would be broken by restoring the empty “//” component; do you have an example? You're likely right about the usage (I can't think of a plausible use case at any rate). At first read of #23505,

[issue2211] Cookie.Morsel interface needs update

2015-03-17 Thread Demian Brecht
Demian Brecht added the comment: Thanks for the updates Serhiy. All look good to me. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2211 ___ ___

[issue1553375] Add traceback.print_full_exception()

2015-03-17 Thread Robert Collins
Robert Collins added the comment: That should be straightforward - its just sequence suffix/prefix overlap detection, and FrameSummary (unlike frames) can be compared with ==. So yes, I think it makes it easier. It's not on my immediate itch-scratching though, but if someone were to poke at

[issue18983] Specify time unit for timeit CLI

2015-03-17 Thread Roundup Robot
Roundup Robot added the comment: New changeset 1ebf8d5b7d60 by Robert Collins in branch 'default': Issue #18983: Allow selection of output units in timeit. https://hg.python.org/cpython/rev/1ebf8d5b7d60 -- nosy: +python-dev ___ Python tracker

[issue2211] Cookie.Morsel interface needs update

2015-03-17 Thread Demian Brecht
Changes by Demian Brecht demianbre...@gmail.com: -- stage: patch review - commit review ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2211 ___ ___

[issue23552] Have timeit warn about runs that are not independent of each other

2015-03-17 Thread Robert Collins
Robert Collins added the comment: I think for PyPI its actually important here - the JIT'd state of the code is essentially global state being mutated - you can't assess how fast the code is without first warming up the JIT, and if it warms up half way through your fastest run, you're still

[issue23644] g++ module compile fails with ‘_Atomic’ does not name a type

2015-03-17 Thread STINNER Victor
STINNER Victor added the comment: With the pystate_cplusplus.patch I was able to compile both min_example.tar.gz and my actual extension. So I with your patch, it does work. Thank you. Cool! I applied this simple patch instead of trying to write an ugly glue in pyatomic.h between C and C++.

[issue18983] Specify time unit for timeit CLI

2015-03-17 Thread Roundup Robot
Roundup Robot added the comment: New changeset ed34dd00405e by Robert Collins in branch 'default': Fix patch attribution for issue 18983. https://hg.python.org/cpython/rev/ed34dd00405e -- ___ Python tracker rep...@bugs.python.org

[issue23183] timeit CLI best of 3: undocumented output format

2015-03-17 Thread Robert Collins
Changes by Robert Collins robe...@robertcollins.net: -- nosy: +rbcollins ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23183 ___ ___

[issue23606] ctypes.util.find_library(c) no longer makes sense

2015-03-17 Thread Steve Dower
Steve Dower added the comment: Pretty much, except the entry point DLL version won't increment unless there's a breaking change to the API. So you have to know where it's from, but (AIUI) the l1-0-0 file will always be available. At some point it may turn into a wrapper rather than a

[issue23689] Memory leak in Modules/sre_lib.h

2015-03-17 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- nosy: +serhiy.storchaka ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23689 ___ ___

[issue18983] Specify time unit for timeit CLI

2015-03-17 Thread Robert Collins
Changes by Robert Collins robe...@robertcollins.net: -- nosy: +rbcollins resolution: - fixed stage: patch review - resolved status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18983

[issue23631] 3.5 (a2) traceback regression snarls Idle

2015-03-17 Thread Berker Peksag
Changes by Berker Peksag berker.pek...@gmail.com: -- stage: needs patch - resolved ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23631 ___ ___

[issue23183] timeit CLI best of 3: undocumented output format

2015-03-17 Thread Robert Collins
Robert Collins added the comment: Here is a patch with some prose - feedback appreciated! -- keywords: +patch Added file: http://bugs.python.org/file38531/issue-23183-1.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23183

[issue23183] timeit CLI best of 3: undocumented output format

2015-03-17 Thread Robert Collins
Changes by Robert Collins robe...@robertcollins.net: -- stage: - patch review ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23183 ___ ___

[issue23689] Memory leak in Modules/sre_lib.h

2015-03-17 Thread STINNER Victor
STINNER Victor added the comment: Oh cool, you wrote a script to reproduce the issue! And Serhiy wrote a patch, great! Great job guys. sre_clean_repeat_data.patch looks good to me. @Serhiy: Can you try the example to ensure that it fixes the issue? If yes, go ahead! --

[issue23688] unnecessary copying of memoryview in gzip.GzipFile.write ?

2015-03-17 Thread STINNER Victor
STINNER Victor added the comment: While we are here, it is possible to add the support of general byte-like objects. With and without the patch, write() accepts bytes, bytearray and memoryview. Which other byte-like types do you know? writeframesraw() method of aifc, sunau and wave modules

[issue6422] timeit called from within Python should allow autoranging

2015-03-17 Thread Robert Collins
Changes by Robert Collins robe...@robertcollins.net: -- nosy: +rbcollins stage: needs patch - patch review ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6422 ___

[issue23552] Have timeit warn about runs that are not independent of each other

2015-03-17 Thread Robert Collins
Robert Collins added the comment: Reviewed on rietvald. -- stage: - patch review ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23552 ___ ___

[issue23644] g++ module compile fails with ‘_Atomic’ does not name a type

2015-03-17 Thread Roundup Robot
Roundup Robot added the comment: New changeset cb05b6d7aacd by Victor Stinner in branch 'default': Issue #23644: Fix issues with C++ when compiling Python extensions https://hg.python.org/cpython/rev/cb05b6d7aacd -- ___ Python tracker

[issue23606] ctypes.util.find_library(c) no longer makes sense

2015-03-17 Thread eryksun
eryksun added the comment: Say I need to use ctypes to call _wsopen_s to open a file without write sharing. If I read you correctly, you're saying I'll need to know it's exported by api-ms-win-crt-stdio-l1-1-0.dll? Does the 'l1-1-0' suffix reflect a version number that will be incremented

[issue23690] re functions never release GIL

2015-03-17 Thread STINNER Victor
STINNER Victor added the comment: Aren't Python strings immutable? Yes. But the re module supports more types than just str and bytes. For example, bytearray is also accepted: re.match(b'^abc', b'abc') _sre.SRE_Match object; span=(0, 3), match=b'abc' re.match(b'^abc', bytearray(b'abc'))

[issue22038] Implement atomic operations on non-x86 platforms

2015-03-17 Thread STINNER Victor
STINNER Victor added the comment: stdatomic.h is not compatible with C++: I disabled completly pyatomic.h on C++. pyatomic.h is only needed by Python core, not to compile Python extensions, so it's not an issue. -- ___ Python tracker

[issue23679] SSL Ciphers RC4

2015-03-17 Thread mogli
mogli added the comment: That was fast, great job! For the record: The SSLv3 issue I also wrote about was a false positive because the test only works with Javascript. Python 2.7.9 has SSLv3 disabled by default as it should. urllib2.urlopen(https://sslv3.dshield.org;) # fails as it should

[issue23685] Fix usage of PyMODINIT_FUNC

2015-03-17 Thread STINNER Victor
New submission from STINNER Victor: Attached patch fixes the usage of the PyMODINIT_FUNC macro. My patch is based on Thomas Wouters's patch of the issue #11410. I don't understand why Modules/pyexpat.c redefined PyMODINIT_FUNC if not defined. In which case PyMODINIT_FUNC was not defined? I'm

[issue23646] PEP 475: handle EINTR in the time module, retry sleep()

2015-03-17 Thread Roundup Robot
Roundup Robot added the comment: New changeset 4accc35cbfcf by Victor Stinner in branch 'default': Revert changeset d927047b1d8eb87738676980a24930d053ba2150 https://hg.python.org/cpython/rev/4accc35cbfcf -- nosy: +python-dev ___ Python tracker

[issue23625] load_module() docs: zipped eggs are not loaded.

2015-03-17 Thread Paul Moore
Paul Moore added the comment: Egg files are a format defined by setuptools. If you look in the setuptools documentation it notes that egg files are simply zipfiles with a particular structure and naming convention. So from a core Python perspective, you can use eggs just like any other

[issue11410] Use GCC visibility attrs in PyAPI_*

2015-03-17 Thread STINNER Victor
STINNER Victor added the comment: I extracted the changes on the PyMODINIT_FUNC macro and I opened the issue #23685. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11410 ___

[issue23625] load_module() docs: zipped eggs are not loaded.

2015-03-17 Thread Thomas Guettler
Thomas Guettler added the comment: The docs should be where new users look. I don't speak about several hundret words Where do you think new users look for documentation if they want a method which does find a module? -- ___ Python tracker

[issue23458] [2.7] random: make the file descriptor non-inheritable (on POSIX)

2015-03-17 Thread STINNER Victor
STINNER Victor added the comment: Ned Deily added the comment: FD_CLOEXEC is first support on OS X 10.5. Here's a patch to skip the test on earlier systems: tested on 10.4, 10.5, and 10.10. What do you mean by first support? Does it mean that fcntl(fd, F_SETFD, FD_CLOEXEC) is simply a

[issue23646] PEP 475: handle EINTR in the time module, retry sleep()

2015-03-17 Thread STINNER Victor
STINNER Victor added the comment: I commited sleep_eintr.patch by mistake. After this change, test_socket started to fail on Windows. I don't understand why. http://buildbot.python.org/all/builders/AMD64%20Windows7%20SP1%203.x/builds/5836/steps/test/logs/stdio

[issue11410] Use GCC visibility attrs in PyAPI_*

2015-03-17 Thread STINNER Victor
STINNER Victor added the comment: +#if defined(__GNUC__) __GNUC__ = 4 +# define HAVE_ATTRIBUTE_VISIBILITY +#endif Clang now also supports __attribute__((visibility(...))). I don't know since which version. I'm not sure because I don't see it:

[issue23625] load_module() docs: zipped eggs are not loaded.

2015-03-17 Thread Thomas Guettler
Thomas Guettler added the comment: In this case I am wearing newbee user glasses. And with this glasses on my nose, I don't care for implementation. I am confused that imp module does not work like import foo. -- ___ Python tracker

[issue11410] Use GCC visibility attrs in PyAPI_*

2015-03-17 Thread STINNER Victor
STINNER Victor added the comment: The getargs.c change *is* necessary, although it doesn't have to be that exact change. Why not moving these declarations to Include/modsupport.h where _PyArg_Parse...() are already used? -- ___ Python tracker

[issue11410] Use GCC visibility attrs in PyAPI_*

2015-03-17 Thread STINNER Victor
STINNER Victor added the comment: In the issue #23685, I proposed a patch to add _PyBUILTIN_MODINIT_FUNC for builtin modules. It makes possible to hide PyInit_xxx symbols of builtin symbols with __attribute__((visibility(hidden))). It also avoids to export these privates symbols on Windows in

[issue23689] Memory leak in Modules/sre_lib.h

2015-03-17 Thread Evgeny Kapun
Evgeny Kapun added the comment: Memory leak only happens if match operation terminates abruptly, e.g. because of SIGINT. In this case, DO_JUMP doesn't come back. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23689

[issue23689] Memory leak in Modules/sre_lib.h

2015-03-17 Thread Evgeny Kapun
Evgeny Kapun added the comment: Tracemalloc code: import re import signal import tracemalloc class AlarmError(Exception): pass def handle_alarm(signal, frame): raise AlarmError signal.signal(signal.SIGALRM, handle_alarm) s1 =

[issue23688] unnecessary copying of memoryview in gzip.GzipFile.write ?

2015-03-17 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: You patch is correct Wolfgang, but with cast('B') the patch would be smaller (no need to replace len(data) to nbytes). While we are here, it is possible to add the support of general byte-like objects. if not isinstance(data, bytes): data =

[issue23691] re.finditer iterator is not reentrant, but doesn't protect against nested calls to __next__

2015-03-17 Thread Evgeny Kapun
New submission from Evgeny Kapun: Iterator returned by re.finditer includes a SRE_STATE value, which is not designed to be used concurrently. However, it is possible to call __next__ on such iterator while another such call is in progress, e.g. from a signal handler. This may result in

[issue9134] sre bug: lastmark_save/restore

2015-03-17 Thread Evgeny Kapun
Changes by Evgeny Kapun abacabadabac...@gmail.com: -- nosy: +abacabadabacaba ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9134 ___ ___

[issue23690] re functions never release GIL

2015-03-17 Thread Evgeny Kapun
Evgeny Kapun added the comment: Aren't Python strings immutable? Also, match functions still permit execution of signal handlers, which can execute any Python code. If GIL is needed during matching, can it be released temporarily to permit thread switching? --

[issue23325] Turn SIG_DFL and SIG_IGN into functions

2015-03-17 Thread Ethan Furman
Ethan Furman added the comment: A private method is being added to Enum to better support Enum replacement of constants, part of which includes changing __reduce_ex__ to return the string of the name. These changes answer points 1 and 4. Point 2 would be nice, but seems somewhat less

[issue433030] SRE: Atomic Grouping (?...) is not supported

2015-03-17 Thread Evgeny Kapun
Changes by Evgeny Kapun abacabadabac...@gmail.com: -- nosy: +abacabadabacaba ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue433030 ___ ___

[issue23692] Undocumented feature prevents re module from finding certain matches

2015-03-17 Thread Evgeny Kapun
New submission from Evgeny Kapun: This pattern matches: re.match('(?:()|(?(1)()|z)){2}(?(2)a|z)', 'a') But this doesn't: re.match('(?:()|(?(1)()|z)){0,2}(?(2)a|z)', 'a') The difference is that {2} is replaced by {0,2}. This shouldn't prevent the pattern from matching anywhere where

[issue9782] _multiprocessing.c warnings under 64-bit Windows

2015-03-17 Thread Mark Lawrence
Mark Lawrence added the comment: Where do we currently stand with all compiler warnings, I'm still seeing some but I recall that we've other open issues about this problem? -- nosy: +serhiy.storchaka, steve.dower, zach.ware versions: +Python 3.4, Python 3.5 -Python 3.2

[issue23695] idiom for clustering a data series into n-length groups

2015-03-17 Thread Ethan Furman
Ethan Furman added the comment: I think an example should suffice: s = [1, 2, 3, 4, 5, 6, 7, 8, 9] n = 3 zip(*[iter(s)]*n) [(1, 2, 3), (4, 5, 6), (7, 8, 9)] -- nosy: +ethan.furman versions: -Python 3.2, Python 3.3 ___ Python tracker

[issue23458] [2.7] random: make the file descriptor non-inheritable (on POSIX)

2015-03-17 Thread Ned Deily
Ned Deily added the comment: The buildbot is now green - closed. -- resolution: - fixed stage: commit review - resolved status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23458

[issue23694] PEP 475: handle EINTR in fileutils.c

2015-03-17 Thread STINNER Victor
Changes by STINNER Victor victor.stin...@gmail.com: -- nosy: +neologix ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23694 ___ ___

[issue23694] PEP 475: handle EINTR in fileutils.c

2015-03-17 Thread STINNER Victor
STINNER Victor added the comment: fileutils_eintr.patch: handle EINTR for open, fopen and dup (only on Linux for dup in _Py_dup). _Py_wfopen() and _Py_fopen() are not modified because callers are not really prepared to handle exceptions. These functions are mostly used during early steps of

[issue23696] zipimport: chain ImportError to OSError

2015-03-17 Thread STINNER Victor
New submission from STINNER Victor: To work on the issue #23694, I refactored the C function _Py_fopen_obj() to raise an exception on error. I noticed the that zipimport replaces the current exception with ZipImportError. Attached patch chains the ZipImportError to the OSError to provide more

[issue23529] Limit decompressed data when reading from LZMAFile and BZ2File

2015-03-17 Thread Nikolaus Rath
Nikolaus Rath added the comment: If you want to add support for buffer_size=0 in a separate patch/issue I think that's fine. But in that case I would not add a buffer_size parameter now at all. IMO, not having it is better as having it but not supporting zero (even if it's documented that's

[issue23697] Module level map submit for concurrent.futures

2015-03-17 Thread Nick Coghlan
New submission from Nick Coghlan: Currently, concurrent.futures requires you to explicitly create and manage the lifecycle of a dedicated executor to handle multithreaded and multiprocess dispatch of concurrent activities. It may be beneficial to provide module level tmap(), pmap(), tsubmit()

[issue23458] [2.7] random: make the file descriptor non-inheritable (on POSIX)

2015-03-17 Thread Roundup Robot
Roundup Robot added the comment: New changeset 730bbd1499ba by Ned Deily in branch '2.7': Issue #23458: Skip test_urandom_fd_non_inheritable on OS X 10.4 since https://hg.python.org/cpython/rev/730bbd1499ba -- ___ Python tracker

[issue6422] timeit called from within Python should allow autoranging

2015-03-17 Thread Robert Collins
Robert Collins added the comment: I'm confused by the feedback on the patch. It adds a single new function, doesn't alter the public interface for any existing functions, and seems fit for purpose. Could someone help me understand how its deficient? --

[issue19495] context manager for measuring duration of blocks of code

2015-03-17 Thread Robert Collins
Changes by Robert Collins robe...@robertcollins.net: -- nosy: +rbcollins title: Enhancement for timeit: measure time to run blocks of code using 'with' - context manager for measuring duration of blocks of code ___ Python tracker

[issue23648] PEP 475 meta issue

2015-03-17 Thread STINNER Victor
STINNER Victor added the comment: In msg196555, Charles-François Natali wrote: From a cursory look, the main files affected would be: Modules/fcntlmodule.c Modules/ossaudiodev.c Modules/posixmodule.c Modules/selectmodule.c Modules/selectmodule.c Modules/signalmodule.c Modules/socketmodule.c

[issue23694] PEP 475: handle EINTR in fileutils.c

2015-03-17 Thread Roundup Robot
Roundup Robot added the comment: New changeset cfe541c694f3 by Victor Stinner in branch 'default': Issue #23694: Enhance _Py_fopen(), it now raises an exception on error https://hg.python.org/cpython/rev/cfe541c694f3 -- ___ Python tracker

[issue23552] Have timeit warn about runs that are not independent of each other

2015-03-17 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Here is a patch that emits a warning using the warnings module. The warning is output to stderr and can be suppressed with the -Wignore option, as all other warnings. $ ./python -m timeit -n1 -r 10 -s import time, random -- time.sleep(random.random()) 1

[issue23552] Have timeit warn about runs that are not independent of each other

2015-03-17 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: Removed file: http://bugs.python.org/file38532/timeit_python_warning.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23552 ___

[issue23552] Have timeit warn about runs that are not independent of each other

2015-03-17 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Implemented Robert's suggestion. $ ./python -m timeit -n1 -r 10 -s import time, random -- time.sleep(random.random()) 1 loops, best of 10: 30.2 msec per loop :0: UserWarning: The test results are likely unreliable. The worst time (946 msec) was more than

[issue23683] allow timeit to run expensive reset code per repeats

2015-03-17 Thread Robert Collins
Robert Collins added the comment: bah, nevermind - I failed to get that setup is called once per loop regardless - I might consider this a doc issue, or perhaps I was just fuzzy brained. -- resolution: - not a bug status: open - closed ___ Python

[issue23694] PEP 475: handle EINTR in fileutils.c

2015-03-17 Thread Roundup Robot
Roundup Robot added the comment: New changeset 0b99d7043a99 by Victor Stinner in branch 'default': Issue #23694: Enhance _Py_open(), it now raises exceptions https://hg.python.org/cpython/rev/0b99d7043a99 -- nosy: +python-dev ___ Python tracker

[issue18828] urljoin behaves differently with custom and standard schemas

2015-03-17 Thread Demian Brecht
Changes by Demian Brecht demianbre...@gmail.com: -- stage: - patch review versions: +Python 3.5 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18828 ___

[issue6422] timeit called from within Python should allow autoranging

2015-03-17 Thread Robert Collins
Robert Collins added the comment: Filed #23693 for the accuracy thing. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6422 ___ ___

[issue23693] timeit accuracy could be better

2015-03-17 Thread Robert Collins
New submission from Robert Collins: In #6422 Haypo suggested making the timeit reports much better. This is a new ticket just for that. See https://bitbucket.org/haypo/misc/src/tip/python/benchmark.py and

[issue23694] PEP 475: handle EINTR in fileutils.c

2015-03-17 Thread STINNER Victor
New submission from STINNER Victor: fileutils.c must be modified to retry when a function fails with EINTR: see the PEP 475. I'm working on a patch. -- messages: 238358 nosy: haypo priority: normal severity: normal status: open title: PEP 475: handle EINTR in fileutils.c versions:

[issue23677] Mention dict and set comps in library reference

2015-03-17 Thread Mark Lawrence
Mark Lawrence added the comment: That was embarrassing, hopefully this is rather better. -- nosy: +BreamoreBoy Added file: http://bugs.python.org/file38534/issue23677_v2.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23677

[issue23688] unnecessary copying of memoryview in gzip.GzipFile.write?

2015-03-17 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: With and without the patch, write() accepts bytes, bytearray and memoryview. Which other byte-like types do you know? The bytes-like object term is used as an alias of an instance of type that supports buffer protocol. Besides bytes, bytearray and

[issue23693] timeit accuracy could be better

2015-03-17 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: See also issue21988. -- nosy: +serhiy.storchaka ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23693 ___ ___

[issue18828] urljoin behaves differently with custom and standard schemas

2015-03-17 Thread Demian Brecht
Demian Brecht added the comment: I haven’t heard any arguments against this option yet, and it didn’t break any tests. Pre patch: urljoin('mailto:foo@', 'bar.com') 'bar.com' Post patch: urljoin('mailto:foo@', 'bar.com') 'mailto:bar.com/bar.com' I'm taking an educated guess here based

[issue23693] timeit accuracy could be better

2015-03-17 Thread STINNER Victor
STINNER Victor added the comment: Not only I'm too lazy to compute manually the number of loops and repeat, but also I don't trust myself. It's even worse when someone publishs results of a micro-benchmark. I don't trust how the benchmark was calibrated. In my experience, micro-benchmark are

[issue23695] idiom for clustering a data series into n-length groups

2015-03-17 Thread Paddy McCarthy
New submission from Paddy McCarthy: In the zip section of the documentation, e.g. https://docs.python.org/3/library/functions.html#zip There is mention of an idiom for clustering a data series into n-length groups that I seem to only come across when people are explaining how it works on blog

[issue23689] Memory leak in Modules/sre_lib.h

2015-03-17 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: May be this patch helps. -- keywords: +patch stage: - patch review versions: +Python 2.7, Python 3.5 Added file: http://bugs.python.org/file38529/sre_clean_repeat_data.patch ___ Python tracker

[issue23644] g++ module compile fails with ‘_Atomic’ does not name a type

2015-03-17 Thread Joshua J Cogliati
Joshua J Cogliati added the comment: Once this is fixed, maybe issue 8027 can be fixed as well in 3.5.0. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23644 ___

[issue23631] 3.5 (a2) traceback regression snarls Idle

2015-03-17 Thread Robert Collins
Robert Collins added the comment: Closing, though ideally Terry can confirm it is fully fixed for him. -- resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23631

[issue23644] g++ module compile fails with ‘_Atomic’ does not name a type

2015-03-17 Thread Joshua J Cogliati
Joshua J Cogliati added the comment: @Joshua: Can you please try to compile your extension with Py_LIMITED_API defined? Ex: #define Py_LIMITED_API 0x0303 at the top of your C file, or g++ -DPy_LIMITED_API=0x0303. It fails in that case, because SWIG is using functions that are not

[issue8027] distutils fail to determine c++ linker with unixcompiler if using ccache

2015-03-17 Thread Joshua J Cogliati
Joshua J Cogliati added the comment: This bug is still in Python 3.5.0a2 (but first issue 23644 needs to be fixed before g++ can be used at all) Attached is a patch for Python 3.5.0. -- versions: +Python 3.5 Added file: http://bugs.python.org/file38530/fix-distutils-350.patch

[issue23644] g++ module compile fails with ‘_Atomic’ does not name a type

2015-03-17 Thread STINNER Victor
STINNER Victor added the comment: For third-party code, pyatomic.h is only needed by PyThreadState_GET() in pystate.h. Maybe we should hide completly pyatomic.h. Currently, pyatomic.h is not really used if Py_LIMITED_API is defined. pystate_cplusplus.patch: disable completly pyatomic.h on

[issue23686] Upgrade copy of OpenSSL bundled with Python

2015-03-17 Thread Alex Gaynor
New submission from Alex Gaynor: On Thursday OpenSSL will disclose some security issues and issue new releases: https://mta.openssl.org/pipermail/openssl-announce/2015-March/20.html When that happens, Python's that bundle an OpenSSL should be upgraded. -- keywords: security_issue

[issue23458] [2.7] random: make the file descriptor non-inheritable (on POSIX)

2015-03-17 Thread Ned Deily
Ned Deily added the comment: $ sw_vers ProductName:Mac OS X ProductVersion: 10.4.11 BuildVersion: 8S165 $ ./python Python 3.4.3+ (3.4:910a7a540a31, Mar 17 2015, 03:33:01) [GCC 4.0.1 (Apple Computer, Inc. build 5370)] on darwin Type help, copyright, credits or license for more information.

[issue23686] Update Windows and OS X installer OpenSSL to 1.0.2a

2015-03-17 Thread Ned Deily
Changes by Ned Deily n...@acm.org: -- title: Upgrade copy of OpenSSL bundled with Python - Update Windows and OS X installer OpenSSL to 1.0.2a ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23686

[issue1553375] Add traceback.print_full_exception()

2015-03-17 Thread Nick Coghlan
Nick Coghlan added the comment: Adding Robert Collins to the nosy list to see if the recent traceback changes make it easier to implement this one correctly. Robert, for context, the general idea here is to be able to stitch the traceback for a caught exception together with the stack trace

[issue23644] g++ module compile fails with ‘_Atomic’ does not name a type

2015-03-17 Thread STINNER Victor
STINNER Victor added the comment: Hum, I'm lost with the problem with C++ :-( What is your use case? Do you want to compile CPython with C++? Or compile a third-party extension with C++ and this extension includes Python.h which includes pyatomic.h. For third-party code, pyatomic.h is only

[issue18814] Add codecs.convert_surrogateescape to clean surrogate escaped strings

2015-03-17 Thread Nick Coghlan
Nick Coghlan added the comment: Oh, and yes, I agree a python-dev discussion would be a good idea. From my perspective, rehandle_surrogateescape is the key function for making it easier to check for malformed input data from operating system interfaces. The other items I don't personally have

  1   2   >