[issue23698] Fix documentation for multiprocessing.Manager

2015-03-17 Thread Anand B Pillai
New submission from Anand B Pillai: multiprocessing.Manager seems to have an inconsistency in behaviour/documentation or both. The behaviour inconsistency is documented in the attached test script which should run for both Python2 and Python3. Briefly, multiprocessing.managers.BaseManager cl

[issue23677] Mention dict and set comps in library reference

2015-03-17 Thread Frank Millman
Frank Millman added the comment: Lists and tuples are described like this - class list([iterable]) Lists may be constructed in several ways: [...] class tuple([iterable]) Tuples may be constructed in a number of ways: [...] I think a similar approach to Dicts and Sets could make sense - cla

[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 th

[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. -- _

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

2015-03-17 Thread Martin Panter
Changes by Martin Panter : -- nosy: +vadmium ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pytho

[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

[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 Raymond Hettinger
Changes by Raymond Hettinger : -- assignee: docs@python -> rhettinger nosy: +rhettinger ___ Python tracker ___ ___ Python-bugs-list ma

[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 fil

[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()

[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 pr

[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 ___

[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

[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

[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

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

2015-03-17 Thread STINNER Victor
Changes by STINNER Victor : -- nosy: +neologix ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pyt

[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 P

[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

[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

[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 p

[issue18828] urljoin behaves differently with custom and standard schemas

2015-03-17 Thread Demian Brecht
Changes by Demian Brecht : -- stage: -> patch review versions: +Python 3.5 ___ Python tracker ___ ___ Python-bugs-list mailing list U

[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

[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

[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 ___ ___ Python-bugs-list mailin

[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

[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: Pyth

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

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

[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

[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

[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

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

2015-03-17 Thread Robert Collins
Changes by Robert Collins : -- 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 ___

[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 ___ ___ Python-bugs-list mailing list Unsu

[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 http://bugs.python.org/issue6422?@ok_message=issue%206422%20nosy%2C%20nosy_count%2C%20sta

[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? --

[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

[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 mem

[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 redirect,

[issue22038] Implement atomic operations on non-x86 platforms

2015-03-17 Thread STINNER Victor
STINNER Victor added the comment: 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

[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++

[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 ___ ___ Python-bugs-list mailing

[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

[issue6422] timeit called from within Python should allow autoranging

2015-03-17 Thread Robert Collins
Changes by Robert Collins : -- nosy: +rbcollins stage: needs patch -> patch review ___ Python tracker ___ ___ Python-bugs-list mailing

[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 module

[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! -- _

[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 no

[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'a

[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

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

2015-03-17 Thread Robert Collins
Changes by Robert Collins : -- stage: -> patch review ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://

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

2015-03-17 Thread Robert Collins
Changes by Robert Collins : -- nosy: +rbcollins ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.py

[issue2211] Cookie.Morsel interface needs update

2015-03-17 Thread Demian Brecht
Changes by Demian Brecht : -- stage: patch review -> commit review ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe

[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 over

[issue23631] 3.5 (a2) traceback regression snarls Idle

2015-03-17 Thread Berker Peksag
Changes by Berker Peksag : -- stage: needs patch -> resolved ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: ht

[issue18983] Specify time unit for timeit CLI

2015-03-17 Thread Robert Collins
Changes by Robert Collins : -- nosy: +rbcollins resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___ __

[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 ___

[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

[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 ___

[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 it

[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 ___ ___

[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 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

[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 ___ ___ Python-bugs-list mai

[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 i

[issue9134] sre bug: lastmark_save/restore

2015-03-17 Thread Evgeny Kapun
Changes by Evgeny Kapun : -- nosy: +abacabadabacaba ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail

[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 = memoryview(d

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

2015-03-17 Thread Evgeny Kapun
Changes by Evgeny Kapun : -- nosy: +abacabadabacaba ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://ma

[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

[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 importan

[issue23689] Memory leak in Modules/sre_lib.h

2015-03-17 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- nosy: +serhiy.storchaka ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https:

[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 = tracemalloc.take_snapsho

[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? -- __

[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 _

[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 corrupt

[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 i

[issue23690] re functions never release GIL

2015-03-17 Thread STINNER Victor
STINNER Victor added the comment: Supporting to release the GIL would require to redesign the _sre module. For example, the getstring() gets a "view" of a Python string, it doesn't copy the string. So we must hold the GIL, otherwise the Python string can be modified by other threads. Copying a

[issue23689] Memory leak in Modules/sre_lib.h

2015-03-17 Thread STINNER Victor
STINNER Victor added the comment: There is maybe a bug. Can you show an example of regex and a text where the memory leak occurs? You can use the tracemalloc module to check if there is a memory leak. Or use sys.getcounts() if you compiled Python in debug mode. sre_lib.h is very complex, it us

[issue23690] re functions never release GIL

2015-03-17 Thread Evgeny Kapun
New submission from Evgeny Kapun: Looks like function in re module (match, fullmatch and so on) don't release GIL, even though these operations can take much time. As a result, other threads can't run while a pattern is being matched, and thread switching doesn't happen as well. -- co

[issue23685] Fix usage of PyMODINIT_FUNC

2015-03-17 Thread Steve Dower
Steve Dower added the comment: Sounds good. Wasn't quite sure if you were after any effect or just consistency :) -- ___ Python tracker ___ _

[issue21076] Turn signal.SIG* constants into enums

2015-03-17 Thread Ethan Furman
Ethan Furman added the comment: Removing the 'enum_to_int' function would also take care of the accepting inappropriate types problem. -- ___ Python tracker ___

[issue21076] Turn signal.SIG* constants into enums

2015-03-17 Thread Ethan Furman
Ethan Furman added the comment: Working on issue23673 I saw this in the new signal.py: +def _enum_to_int(value): +"""Convert an IntEnum member to a numeric value. +If it's not a IntEnum member return the value itself. +""" +try: +return int(value) +except (ValueError,

[issue12319] [http.client] HTTPConnection.putrequest not support "chunked" Transfer-Encodings to send data

2015-03-17 Thread Demian Brecht
Demian Brecht added the comment: Updated patch changes the following: + Removes support for trailers in requests as they're not supported + If Transfer-Encoding is explicitly set by the client, it's assumed that the caller will handle all encoding (backwards compatibility) + Fixed a bug where c

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

2015-03-17 Thread STINNER Victor
STINNER Victor added the comment: > Are tests and code patches supposed to go in one file or separate ones ? It's more convinient to have a single patch with both changes. -- ___ Python tracker ___

[issue23689] Memory leak in Modules/sre_lib.h

2015-03-17 Thread Evgeny Kapun
New submission from Evgeny Kapun: In Modules/sre_lib.h on line 882 [1], a block of memory is allocated. If SRE(match) function later terminates abruptly, either because of a signal or because subsequent memory allocation fails, this block is never released. [1] https://hg.python.org/cpython/fi

[issue23685] Fix usage of PyMODINIT_FUNC

2015-03-17 Thread STINNER Victor
STINNER Victor added the comment: I commited PyMODINIT_FUNC.patch without the useless change on PC/config.c. -- ___ Python tracker ___ ___

[issue23685] Fix usage of PyMODINIT_FUNC

2015-03-17 Thread Roundup Robot
Roundup Robot added the comment: New changeset 22a0c925a7c2 by Victor Stinner in branch 'default': Issue #23685: Fix usage of PyMODINIT_FUNC in _json, _scproxy, nis, pyexpat https://hg.python.org/cpython/rev/22a0c925a7c2 -- nosy: +python-dev ___ Pytho

[issue23685] Fix usage of PyMODINIT_FUNC

2015-03-17 Thread STINNER Victor
STINNER Victor added the comment: builtin_modules.patch: add _PyBUILTIN_MODINIT_FUNC macro and use it on modules which are builtins on POSIX. I checked: it's not necessary to modify Modules/config.c to make the symbol hidden: only the C code in Modules/ need to set the attribute on the functio

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

2015-03-17 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Note that provided Python implementations are rather a proof of concept. After discussion I'll provide more efficient C implementations, that should be 1-2 orders faster (and infinitely fast for common case of ASCII strings). --

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

2015-03-17 Thread Wolfgang Maier
Wolfgang Maier added the comment: > memoryview is converted to bytes because len() for memoryview returns a size > of first dimension (a number of items for one-dimension view), not a number > of bytes. > m = memoryview(array.array('I', [1, 2, 3])) len(m) > 3 len(m.tobytes()) >

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

2015-03-17 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: memoryview is converted to bytes because len() for memoryview returns a size of first dimension (a number of items for one-dimension view), not a number of bytes. >>> m = memoryview(array.array('I', [1, 2, 3])) >>> len(m) 3 >>> len(m.tobytes()) 12 >>> len(m.

[issue23685] Fix usage of PyMODINIT_FUNC

2015-03-17 Thread Steve Dower
Steve Dower added the comment: Just had a look in Include/pyport.h and we're already defining PyMODINIT_FUNC differently for building core, so all your changes should be fine. The redefinition you removed from pyexpat.c was clearly never meant to be used for builtin modules. -- _

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

2015-03-17 Thread Wolfgang Maier
Wolfgang Maier added the comment: @Serhiy: Why would data = data.cast('B') be required ? When would the memoryview not be in 'B' format already ? -- ___ Python tracker ___ _

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

2015-03-17 Thread Wolfgang Maier
Wolfgang Maier added the comment: Here is a patch with memoryview tests. Are tests and code patches supposed to go in one file or separate ones ? -- Added file: http://bugs.python.org/file38526/test_memoryview_write.patch ___ Python tracker

[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: "PyMO

[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 pyth

[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

[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 ___ ___ Python-bugs-list mailing list U

[issue2211] Cookie.Morsel interface needs update

2015-03-17 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Here is a patch with extended and unified tests. Also fixed one bug. I have left comments about some changes on Rietveld. -- Added file: http://bugs.python.org/file38524/issue2211_6.patch ___ Python tracker

[issue22931] cookies with square brackets in value

2015-03-17 Thread Demian Brecht
Changes by Demian Brecht : Added file: http://bugs.python.org/file38525/issue22931_1.patch ___ Python tracker ___ ___ Python-bugs-list mailing

[issue22931] cookies with square brackets in value

2015-03-17 Thread Demian Brecht
Changes by Demian Brecht : Removed file: http://bugs.python.org/file38522/issue22931_1.patch ___ Python tracker ___ ___ Python-bugs-list maili

[issue12855] linebreak sequences should be better documented

2015-03-17 Thread SMRUTI RANJAN SAHOO
SMRUTI RANJAN SAHOO added the comment: i think in this, "line \fone\nline two\n" ,the space after line taking some garbage value or you can say hex value of "\". so that's why that is showing some hex value. if you write "\n " instead of"\" then you can't find that hex value. i attached my id

  1   2   >