[issue13583] sqlite3.Row doesn't support slice indexes

2014-04-28 Thread Jessica McKellar
Jessica McKellar added the comment: Thanks for the ticket and patch, xapple! I updated the patch to address the compiler warning and use assertEqual. While testing, I noticed that slicing with steps wasn't supported, so I expanded the sqlite3.Row slicing code to support steps, and added some

[issue13583] sqlite3.Row doesn't support slice indexes

2014-04-28 Thread Jessica McKellar
Jessica McKellar added the comment: I've also uploaded a short script that sets up an in-memory sqlite database that fetches Rows, for easy manual testing. -- Added file: http://bugs.python.org/file35071/sqlite3_slicing_demo.py ___ Python tracker

[issue21369] Extended modes for tarfile.TarFile()

2014-04-28 Thread Lars Gustäbel
Lars Gustäbel added the comment: That was a design decision. What would be the advantage of having the TarFile class offer the compression itself? -- assignee: - lars.gustaebel ___ Python tracker rep...@bugs.python.org

[issue18472] Update PEP 8 to encourage modern conventions

2014-04-28 Thread Florent Xicluna
Changes by Florent Xicluna florent.xicl...@gmail.com: -- nosy: +flox ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18472 ___ ___ Python-bugs-list

[issue21233] Add *Calloc functions to CPython memory allocation API

2014-04-28 Thread STINNER Victor
STINNER Victor added the comment: It looks like Windows supports also lazy initialization of memory pages initialized to zero. According to my microbenchmark on Linux and Windows, only bytes(n) and bytearray(n) are really faster with use_calloc.patch. Most changes of use_calloc.patch are

[issue21372] multiprocessing.util.register_after_fork inconsistency

2014-04-28 Thread Marc Schlaich
New submission from Marc Schlaich: multiprocessing.util.register_after_fork does not behave consistently on Windows because the `_afterfork_registry` is not transferred to the subprocess. The following example fails on Windows while it works perfectly on Linux: import multiprocessing.util

[issue21233] Add *Calloc functions to CPython memory allocation API

2014-04-28 Thread STINNER Victor
STINNER Victor added the comment: Changes on the pickle module don't look like an interesting optimization. It even looks slower. $ python perf.py -b fastpickle,fastunpickle,pickle,pickle_dict,pickle_list,slowpickle,slowunpickle,unpickle ../default/python.orig ../default/python.calloc ...

[issue21233] Add *Calloc functions to CPython memory allocation API

2014-04-28 Thread STINNER Victor
STINNER Victor added the comment: Patch version 5. This patch is ready for a review. Summary of calloc-5.patch: - add the following functions: * void* PyMem_RawCalloc(size_t nelem, size_t elsize) * void* PyMem_Calloc(size_t nelem, size_t elsize) * void* PyObject_Calloc(size_t nelem,

[issue20305] Android's incomplete locale.h implementation prevents cross-compilation

2014-04-28 Thread Stefan Krah
Changes by Stefan Krah stefan-use...@bytereef.org: -- nosy: +lizhenhua ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20305 ___ ___

[issue21371] struct lconv does not have decimal_point on android platform

2014-04-28 Thread Stefan Krah
Stefan Krah added the comment: This looks like a duplicate. -- nosy: +skrah resolution: - duplicate stage: - resolved status: open - closed superseder: - Android's incomplete locale.h implementation prevents cross-compilation ___ Python tracker

[issue21233] Add *Calloc functions to CPython memory allocation API

2014-04-28 Thread STINNER Victor
STINNER Victor added the comment: Demo of calloc-5.patch on Linux. Thanks to calloc(), bytes(50 * 1024 * 1024) doesn't allocate memory for null bytes and so the RSS memory is unchanged (+148 kB, not +50 MB), but tracemalloc says that 50 MB were allocated. $ ./python -X tracemalloc Python

[issue5404] Cross-compiling Python

2014-04-28 Thread Stefan Krah
Stefan Krah added the comment: Ping. Is this still an issue for anyone in 3.4? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5404 ___ ___

[issue21220] Enhance obmalloc allocation strategy

2014-04-28 Thread Kristján Valur Jónsson
Kristján Valur Jónsson added the comment: This significantly helps fragmentation in programs with dynamic memory usage, e.g. long running programs. On which programs? The fragmentation of the memory depends a lot on how the program allocates memory. For example, if a program has no

[issue20188] ALPN support for TLS

2014-04-28 Thread Cory Benfield
Changes by Cory Benfield c...@lukasa.co.uk: -- nosy: +Lukasa ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20188 ___ ___ Python-bugs-list mailing

[issue21369] Extended modes for tarfile.TarFile()

2014-04-28 Thread Sworddragon
Sworddragon added the comment: The TarFile class provides more options. Alternatively a file object could be used but this means additional code (and maybe IO overhead). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21369

[issue19977] Use surrogateescape error handler for sys.stdin and sys.stdout on UNIX for the C locale

2014-04-28 Thread Antoine Pitrou
Antoine Pitrou added the comment: We should not overcomplicate this. I suggest that we simply use utf-8 under the C locale. Do you mean utf8/strict or utf8/surrogateescape? utf8/strict doesn't work (os.listdir raises an unicode error) if your system is configured to use latin1 (ex:

[issue13559] Use sendfile where possible in httplib

2014-04-28 Thread Giampaolo Rodola'
Changes by Giampaolo Rodola' g.rod...@gmail.com: -- dependencies: +Add a new socket.sendfile() method versions: +Python 3.5 -Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13559

[issue20306] Lack of pw_gecos field in Android's struct passwd causes cross-compilation for the pwd module to fail

2014-04-28 Thread Antoine Pitrou
Antoine Pitrou added the comment: Interesting. It seems pw_gecos isn't mandated by POSIX: http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/pwd.h.html I wonder if there's a better way to do this (autoconf check?) than an Android-specific #ifdef, though. -- nosy: +pitrou

[issue21233] Add *Calloc functions to CPython memory allocation API

2014-04-28 Thread Stefan Krah
Stefan Krah added the comment: With the latest patch the decimal benchmark with a lot of small allocations is consistently 2% slower. Large factorials (where the operands are initialized to zero for the number-theoretic transform) have the same performance with and without the patch. It would

[issue21369] Extended modes for tarfile.TarFile()

2014-04-28 Thread Lars Gustäbel
Lars Gustäbel added the comment: You can pass keyword arguments to tarfile.open(), which will be passed to the TarFile constructor. You can also use pass fileobj arguments to tarfile.open(). -- ___ Python tracker rep...@bugs.python.org

[issue13204] sys.flags.__new__ crashes

2014-04-28 Thread Antoine Pitrou
Antoine Pitrou added the comment: Thanks for the patch, Jessica. It seems to work under Windows here. -- versions: +Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13204 ___

[issue13204] sys.flags.__new__ crashes

2014-04-28 Thread Roundup Robot
Roundup Robot added the comment: New changeset 7052fdd90a11 by Antoine Pitrou in branch '3.4': Issue #13204: Calling sys.flags.__new__ would crash the interpreter, now it raises a TypeError. http://hg.python.org/cpython/rev/7052fdd90a11 New changeset a14012352f65 by Antoine Pitrou in branch

[issue21369] Extended modes for tarfile.TarFile()

2014-04-28 Thread Sworddragon
Sworddragon added the comment: Interesting, after reading the documentation again I would now assume that is what **kwargs is for. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21369 ___

[issue13204] sys.flags.__new__ crashes

2014-04-28 Thread Antoine Pitrou
Antoine Pitrou added the comment: I've committed the patch to 3.4 and 3.5. I'm closing the issue, I don't think fixing 2.7 is important at this point. -- resolution: - fixed stage: patch review - resolved status: open - closed ___ Python tracker

[issue21369] Extended modes for tarfile.TarFile()

2014-04-28 Thread Lars Gustäbel
Lars Gustäbel added the comment: Jup. That's it. -- priority: normal - low resolution: - not a bug stage: - resolved status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21369

[issue21305] PEP 466: update os.urandom

2014-04-28 Thread Donald Stufft
Donald Stufft added the comment: Depleting /dev/urandom isn't actually a thing. /dev/urandom on all modern *nix OSs uses a fast PRNG which is secure as long as it has received enough bytes of initial entropy. -- ___ Python tracker

[issue21305] PEP 466: update os.urandom

2014-04-28 Thread Charles-François Natali
Charles-François Natali added the comment: Depleting /dev/urandom isn't actually a thing. /dev/urandom on all modern *nix OSs uses a fast PRNG which is secure as long as it has received enough bytes of initial entropy. I didn't say deplete /dev/urandom, I said that when reading from

[issue1820] Enhance Object/structseq.c to match namedtuple and tuple api

2014-04-28 Thread Stefan Krah
Stefan Krah added the comment: Is accessing _fields a common operation? Personally I'd use a PyGetSetDef and generate the tuple on access (perhaps cache the result). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1820

[issue13096] ctypes: segfault with large POINTER type names

2014-04-28 Thread Meador Inge
Meador Inge added the comment: Thanks for the review and reminder about this issue, jesstess. I will apply the patch later today. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13096 ___

[issue20306] Lack of pw_gecos field in Android's struct passwd causes cross-compilation for the pwd module to fail

2014-04-28 Thread Shiz
Shiz added the comment: Ah, yes, if it's not actually mandated by POSIX, something like HAVE_PASSWD_PW_GECOS would be more appropriate. I'll rework the patch into something more generic. -- ___ Python tracker rep...@bugs.python.org

[issue21305] PEP 466: update os.urandom

2014-04-28 Thread Donald Stufft
Donald Stufft added the comment: I don't think what you're worrying about here is something that has a high chance of happening, if it even occurs in the wild at all. To be clear in order for that to matter at all in the context of this ticket, some software would need to be reading from

[issue21373] robotparser: Automatically call modified function in read()

2014-04-28 Thread Maxime Lorant
New submission from Maxime Lorant: For the moment, RobotFileParser (on both Python 2.x and 3.x) has a method modified, but it is never called in the class itself, hence the last_checked attribute is always at 0 if the user doesn't call modified() explicitly. I would suggest to add a call to

[issue20962] Rather modest chunk size in gzip.GzipFile

2014-04-28 Thread William Tisäter
William Tisäter added the comment: That makes sense. I proceeded and updated `Lib/gzip.py` to use `io.DEFAULT_BUFFER_SIZE` instead. This will change the existing behaviour in two ways: * Start using 1024 * 8 as buffer size instead of 1024. * Add one more kwarg (`buffer_size`) to

[issue21305] PEP 466: update os.urandom

2014-04-28 Thread Charles-François Natali
Charles-François Natali added the comment: Using os.urandom is the *right* thing to do for getting random in an application, but the current implementation effectively punishes people who use it if their application is highly concurrent. And I argue that this scenario is almost as likely

[issue19940] ssl.cert_time_to_seconds() returns wrong results if local timezone is not UTC

2014-04-28 Thread akira
akira added the comment: I've updated the patch: - fixed the code example in the documentation to use int instead of float result - removed assertion on the int returned type (float won't lose precision for the practical dates but guaranteeing an integer would be nice) - reworded the scary

[issue21305] PEP 466: update os.urandom

2014-04-28 Thread Donald Stufft
Donald Stufft added the comment: But backporting always has a risk, which has to be balanced. Sure, which is why a PEP was written, discussed and accepted to find that balance. -- ___ Python tracker rep...@bugs.python.org

[issue21233] Add *Calloc functions to CPython memory allocation API

2014-04-28 Thread STINNER Victor
STINNER Victor added the comment: With the latest patch the decimal benchmark with a lot of small allocations is consistently 2% slower. Does your benchmark use bytes(int) or bytearray(int)? If not, I guess that your benchmark is not reliable because only these two functions are changed by

[issue21362] concurrent.futures does not validate that max_workers is proper

2014-04-28 Thread Jim Jewett
Jim Jewett added the comment: I confirm the bug. The patch looks good. -- nosy: +Jim.Jewett ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21362 ___

[issue8776] Bytes version of sys.argv

2014-04-28 Thread Nick Coghlan
Nick Coghlan added the comment: I'd like to revisit this after PEP 432 is in place, since having to do this dance for arg processing when running on Linux in the POSIX locale is somewhat lame: argv = sys.argv encoding = locale.getpreferredencoding() # Hope nobody changed the locale!

[issue1599254] mailbox: other programs' messages can vanish without trace

2014-04-28 Thread Jim Jewett
Jim Jewett added the comment: pinging David Watson: What is the status? If I understand correctly, (and I may well not), you have already opened other issues for parts of this, and (only) the final patch is ready for patch (and hopefully) commit review. Is this correct? --

[issue20974] email module docs say not compatible with current python version

2014-04-28 Thread Jim Jewett
Jim Jewett added the comment: I don't know for sure if the compatibility claims are correct, but the patch looks good. -- stage: - commit review ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20974

[issue21233] Add *Calloc functions to CPython memory allocation API

2014-04-28 Thread Stefan Krah
Stefan Krah added the comment: Hmm, obmalloc.c changed as well, so already the gcc optimizer can take different paths and produce different results. Also I did set mpd_callocfunc to PyMem_Calloc(). 2% slowdown is far from being a tragic result, so I guess we can ignore that. The bytes()

[issue21374] DecimalTuple.__module__ is set to _frozen_importlib

2014-04-28 Thread Stefan Krah
New submission from Stefan Krah: x = Decimal(9).as_tuple() import pickle pickle.dumps(x) Traceback (most recent call last): File stdin, line 1, in module _pickle.PicklingError: Can't pickle class '_frozen_importlib.DecimalTuple': attribute lookup DecimalTuple on _frozen_importlib failed

[issue21233] Add *Calloc functions to CPython memory allocation API

2014-04-28 Thread Charles-François Natali
Charles-François Natali added the comment: Also I did set mpd_callocfunc to PyMem_Calloc(). 2% slowdown is far from being a tragic result, so I guess we can ignore that. Agreed. The bytes() speedup is very nice. Allocations that took one second are practically instant now. Indeed. Victor,

[issue19354] test_format fails on RHEL-6

2014-04-28 Thread Stefan Krah
Changes by Stefan Krah stefan-use...@bytereef.org: -- resolution: - out of date stage: - resolved status: pending - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19354 ___

[issue21370] segfault from simple traceback.format_exc call

2014-04-28 Thread Stefan Krah
Stefan Krah added the comment: I cannot reproduce this. Which platform? Does it happen with Python 3.4? -- nosy: +skrah ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21370 ___

[issue21354] PyCFunction_New no longer exposed by python DLL breaking bdist_wininst installers

2014-04-28 Thread Andrew Svetlov
Andrew Svetlov added the comment: Ok, I'll take a look. Sorry, probably I've missed python3.def file. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21354 ___

[issue19977] Use surrogateescape error handler for sys.stdin and sys.stdout on UNIX for the C locale

2014-04-28 Thread Nick Coghlan
Nick Coghlan added the comment: Victor was referring to code like print(os.listdir()). Those are the motivating cases for ensuring round trips from system APIs to the standard streams work correctly. There's also the problem that sys.argv currently relies on the locale encoding directly,

[issue19977] Use surrogateescape error handler for sys.stdin and sys.stdout on UNIX for the C locale

2014-04-28 Thread Antoine Pitrou
Antoine Pitrou added the comment: The conclusion I have come to is that any further decoupling of Python 3 from the locale encoding will actually depend on getting the PEP 432 bootstrapping changes implemented, reviewed and the PEP approved, so we have more interpreter infrastructure in

[issue19977] Use surrogateescape error handler for sys.stdin and sys.stdout on UNIX for the C locale

2014-04-28 Thread Nick Coghlan
Nick Coghlan added the comment: Antoine Pitrou added the comment: Yeah. My proposal had more to do with the fact that we should some day switch to utf-8 by default on all POSIX systems, regardless of what the system advertises as best encoding. Yeah, that seems like a plausible future to me

[issue1533105] NetBSD build with --with-pydebug causes SIGSEGV

2014-04-28 Thread Stefan Krah
Stefan Krah added the comment: Given msg84518 and msg118909 I think this can be closed. -- resolution: - out of date stage: patch review - resolved status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1533105

[issue21375] Fix and test overflow behavior in the C version of heapq

2014-04-28 Thread Raymond Hettinger
New submission from Raymond Hettinger: The Py_ssizet indexes can overflow the childpos variable: childpos = 2*pos + 1;/* leftmost child position */ while (childpos endpos) ... http://googleresearch.blogspot.com/2006/06/extra-extra-read-all-about-it-nearly.html --

[issue21376] asyncio docs refer to wrong TimeoutError

2014-04-28 Thread Philip Sequeira
New submission from Philip Sequeira: Example: https://docs.python.org/3.4/library/asyncio-task.html TimeoutError is mentioned several times, and links to the OSError subclass. However, the actual TimeoutError raised by asyncio stuff is the one from concurrent.futures, which is not compatible.

[issue20962] Rather modest chunk size in gzip.GzipFile

2014-04-28 Thread Antoine Pitrou
Antoine Pitrou added the comment: So I'd suggest, instead of using an hardcoded value, to simply reuse io.DEFAULT_BUFFER_SIZE. That way, if some day we decide to change it, all user code wil benefit from the change. I don't think io.DEFAULT_BUFFER_SIZE makes much sense as a heuristic for

[issue1284316] Win32: Security problem with default installation directory

2014-04-28 Thread Steve Dower
Changes by Steve Dower steve.do...@microsoft.com: -- nosy: +steve.dower ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1284316 ___ ___

[issue19940] ssl.cert_time_to_seconds() returns wrong results if local timezone is not UTC

2014-04-28 Thread Antoine Pitrou
Antoine Pitrou added the comment: Thanks for the updated patch, Akira! I'm gonna take a look right now. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19940 ___

[issue20962] Rather modest chunk size in gzip.GzipFile

2014-04-28 Thread Charles-François Natali
Charles-François Natali added the comment: I don't think io.DEFAULT_BUFFER_SIZE makes much sense as a heuristic for the gzip module (or compressed files in general). Perhaps gzip should get its own DEFAULT_BUFFER_SIZE? Do you mean from a namespace point of vue, or from a performance point

[issue19940] ssl.cert_time_to_seconds() returns wrong results if local timezone is not UTC

2014-04-28 Thread Antoine Pitrou
Antoine Pitrou added the comment: I've committed the patch. Thank you very much for contributing! -- resolution: - fixed stage: patch review - resolved status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19940

[issue20962] Rather modest chunk size in gzip.GzipFile

2014-04-28 Thread Antoine Pitrou
Antoine Pitrou added the comment: Sure, it might not be optimal for compressed files, but I gues that the optimal value is function of the compression-level block size and many other factors which are just too varied to come up with a reasonable heuristic. Well, I think that compressed

[issue19940] ssl.cert_time_to_seconds() returns wrong results if local timezone is not UTC

2014-04-28 Thread Roundup Robot
Roundup Robot added the comment: New changeset 7191c37238d5 by Antoine Pitrou in branch 'default': Issue #19940: ssl.cert_time_to_seconds() now interprets the given time string in the UTC timezone (as specified in RFC 5280), not the local timezone. http://hg.python.org/cpython/rev/7191c37238d5

[issue21312] Update thread_foobar.h to include timed locking and TLS support

2014-04-28 Thread Antoine Pitrou
Antoine Pitrou added the comment: Ok, noone chimed in, so I committed the patch :-) Thank you very much for your contribution! -- resolution: - fixed stage: patch review - resolved status: open - closed ___ Python tracker rep...@bugs.python.org

[issue21312] Update thread_foobar.h to include timed locking and TLS support

2014-04-28 Thread Roundup Robot
Roundup Robot added the comment: New changeset 7bb1bda5dcef by Antoine Pitrou in branch 'default': Issue #21312: Update the thread_foobar.h template file to include newer threading APIs. Patch by Jack McCracken. http://hg.python.org/cpython/rev/7bb1bda5dcef -- nosy: +python-dev

[issue16104] Compileall script: add option to use multiple cores

2014-04-28 Thread Jim Jewett
Jim Jewett added the comment: Trying to put bounds on the disagreements. Does anyone disagree with any of the following: (1) compileall currently runs single-threaded in a single process. (2) This enhancement intends to allow parallelization by process. (3) Users MAY need to express

[issue21376] asyncio docs refer to wrong TimeoutError

2014-04-28 Thread Antoine Pitrou
Antoine Pitrou added the comment: Gasp. Perhaps concurrent.futures.TimeoutError can inherit from the standard TimeoutError? The following patch doesn't seem to disrupt the test suite: diff --git a/Lib/concurrent/futures/_base.py b/Lib/concurrent/futures/_base.py ---

[issue16104] Compileall script: add option to use multiple cores

2014-04-28 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: -- nosy: -pitrou ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16104 ___ ___ Python-bugs-list mailing

[issue20962] Rather modest chunk size in gzip.GzipFile

2014-04-28 Thread Skip Montanaro
Skip Montanaro added the comment: On Mon, Apr 28, 2014 at 1:59 PM, Antoine Pitrou rep...@bugs.python.org wrote: Well, I think that compressed files in general would benefit from a larger buffer size than plain binary I/O, but that's just a hunch. I agree. When writing my patch, my (perhaps

[issue21376] asyncio docs refer to wrong TimeoutError

2014-04-28 Thread Guido van Rossum
Guido van Rossum added the comment: I considered this, and decided against unifying the two TimeoutErrors. First the builtin TimeoutError is specifically a subclass of OSError representing the case where errno is ETIMEDOUT. But asyncio.TimeoutError means nothing of the sort. Second, the

[issue5404] Cross-compiling Python

2014-04-28 Thread Gregory P. Smith
Gregory P. Smith added the comment: I haven't tried a cross compile in ages. If nothing else I don't think this issue should be closed until we have at least one buildbot setup to cross compile it and run it on the target platform. That's on my long todo for python wish list but I haven't

[issue18314] Have os.unlink remove junction points

2014-04-28 Thread Tim Golden
Tim Golden added the comment: I'm just pinging #python-dev to see if there's a way to request a buildbot build from a specific server-side clone. Meanwhile, though, I definitely introduced a change into your code which I thought I had reverted, but clearly hadn't! The code, as committed,

[issue21372] multiprocessing.util.register_after_fork inconsistency

2014-04-28 Thread Ned Deily
Changes by Ned Deily n...@acm.org: -- nosy: +sbt ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21372 ___ ___ Python-bugs-list mailing list

[issue21057] TextIOWrapper does not support reading bytearrays or memoryviews

2014-04-28 Thread Antoine Pitrou
Antoine Pitrou added the comment: My usecase is that I have a binary stream class that internally uses memoryviews. Ok, I think it is a reasonable use case. I'm gonna look at your patch and give it a review. -- stage: - patch review ___ Python

[issue21377] PyBytes_Concat could try to concat in-place

2014-04-28 Thread Antoine Pitrou
New submission from Antoine Pitrou: Currently, PyBytes_Concat always creates a new bytes object for the result. However, when Py_REFCNT(*pv) == 1, it could instead call _PyBytes_Resize() and then concat the second argument in place. (like e.g. _PyUnicode_Append does) -- components:

[issue21321] itertools.islice() doesn't release reference to the source iterator when the slice is exhausted

2014-04-28 Thread Anton Afanasyev
Anton Afanasyev added the comment: Hi Antoine, I have no found a way to check resource usage in test infrastructure and I don't think it could be done carefully. The only method I found to test issue is straightforward: just to check source iterator is not referenced from itertools.islice()

[issue21321] itertools.islice() doesn't release reference to the source iterator when the slice is exhausted

2014-04-28 Thread Anton Afanasyev
Changes by Anton Afanasyev fun@gmail.com: Added file: http://bugs.python.org/file35077/issue21321_3.4_8c8315bac6a8_3.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21321 ___

[issue8776] Bytes version of sys.argv

2014-04-28 Thread Raymond Hettinger
Raymond Hettinger added the comment: Without commenting on this specific proposal, I would like to make an overall observation that Python is impairing its usability by adding too-many-ways-to-it in a number of categories (file descriptor variants of file methods, multiple versions of

[issue17861] put opcode information in one place

2014-04-28 Thread David Bolen
David Bolen added the comment: This generator script breaks the daily OSX DMG builds on my bolen-dmg buildslave for the 3.x branch. The issue is with the use of with as the slave uses Python 2.5 to build the installer. Now, that's old, and I'm not even sure how necessary the daily builds

[issue21321] itertools.islice() doesn't release reference to the source iterator when the slice is exhausted

2014-04-28 Thread Antoine Pitrou
Antoine Pitrou added the comment: Anton, the test is wrong: it is taking a reference to the iterable object (the list), not the iterator. To check the reference to the original iterator is released, something like this would work: import itertools, weakref it = (x for x in (1, 2)) wr =

[issue21321] itertools.islice() doesn't release reference to the source iterator when the slice is exhausted

2014-04-28 Thread Antoine Pitrou
Antoine Pitrou added the comment: (note I haven't looked at the C part of the patch) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21321 ___

[issue20962] Rather modest chunk size in gzip.GzipFile

2014-04-28 Thread Charles-François Natali
Charles-François Natali added the comment: That could make sense, dunno. Note that the bz2 module uses a harcoded 8K value. Note that the buffer size should probably be passed to the open() call. Also, the allocation is quite peculiar: it uses an exponential buffer size, starting at a tiny

[issue20962] Rather modest chunk size in gzip.GzipFile

2014-04-28 Thread Skip Montanaro
Skip Montanaro added the comment: On Mon, Apr 28, 2014 at 3:08 PM, Charles-François Natali rep...@bugs.python.org wrote: In short, I think the overall buffering should be rewritten :-) Perhaps so, but I think we should open a separate ticket for that instead of instituting some feature creep

[issue20962] Rather modest chunk size in gzip.GzipFile

2014-04-28 Thread Charles-François Natali
Charles-François Natali added the comment: Perhaps so, but I think we should open a separate ticket for that instead of instituting some feature creep here (no matter how reasonable the concept or its changes would be). Agreed. The patch looks good to me, so feel free to commit! (FWIW, gzip

[issue8776] Bytes version of sys.argv

2014-04-28 Thread STINNER Victor
STINNER Victor added the comment: Today I regret os.environb (I added it). If I remember correctly, os.environb was added before the PEP 383 (surrogateescape). This PEP makes os.environb almost useless. In Python 3, Unicode is the natural choice, and thanks to the PEP 383, it's still possible

[issue17861] put opcode information in one place

2014-04-28 Thread Ned Deily
Ned Deily added the comment: Thanks, David. Ideally, the generator script shouldn't run during an installer build since presumably the generated file should be up-to-date in the repo. make touch could handle that but the installer build does use a separate build/object directory and doesn't

[issue17861] put opcode information in one place

2014-04-28 Thread Roundup Robot
Roundup Robot added the comment: New changeset 1fd9c3f6cf68 by Ned Deily in branch 'default': Issue #17861: Allow generate_opcode_h to run with a system Python 2.5. http://hg.python.org/cpython/rev/1fd9c3f6cf68 -- ___ Python tracker

[issue21378] ImportError: No module named 'concurrent.futures'

2014-04-28 Thread Bill Bergmann
New submission from Bill Bergmann: python 3.4 attempting to run example at https://docs.python.org/3/library/concurrent.futures.html 17.4.2.1 $ python3 17_4_2.py Traceback (most recent call last): File frozen importlib._bootstrap, line 2195, in _find_and_load_unlocked AttributeError:

[issue21378] ImportError: No module named 'concurrent.futures'

2014-04-28 Thread Claudiu.Popa
Claudiu.Popa added the comment: Do you have a module/file named concurrent.py in your PATH? -- nosy: +Claudiu.Popa ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21378 ___

[issue21379] StopIteration is silenced when raised by generator within context manager

2014-04-28 Thread Hannan Aharonov
New submission from Hannan Aharonov: If the code that defines a context manager performs some operations on a generator that cause it to raise StopIteration, this exception is propagated to the context manager's __exit__() method and there swallowed by a try..except block. This can cause

[issue21379] StopIteration is silenced when raised by generator within context manager

2014-04-28 Thread Hannan Aharonov
Changes by Hannan Aharonov buffe...@gmail.com: -- type: - behavior ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21379 ___ ___ Python-bugs-list

[issue21378] ImportError: No module named 'concurrent.futures'

2014-04-28 Thread Ned Deily
Ned Deily added the comment: FWIW, works for me using the python.org 3.4 64-bin installer. What is the output of: python3 -c 'import sys;print(sys.version)' As Claudiu suggests, check for a concurrent.py shadowing the standard library version. Also, why are you setting PYTHONPATH to

[issue21233] Add *Calloc functions to CPython memory allocation API

2014-04-28 Thread STINNER Victor
STINNER Victor added the comment: Hmm, obmalloc.c changed as well, so already the gcc optimizer can take different paths and produce different results. If decimal depends on allocator performances, you should maybe try to implement a freelist. Also I did set mpd_callocfunc to

[issue21380] timezone support in strftime methods broken

2014-04-28 Thread Michael P. Soulier
New submission from Michael P. Soulier: msoulier@cappuccino:~$ python Python 2.7.3 (default, Mar 13 2014, 11:03:55) [GCC 4.7.2] on linux2 Type help, copyright, credits or license for more information. from datetime import datetime now = datetime.now() now.strftime(%z) '' import time

[issue21305] PEP 466: update os.urandom

2014-04-28 Thread STINNER Victor
STINNER Victor added the comment: Please don't backport this feature. We had to wait 20 years before someone requested the feature, but only a few months before the first user reported an issue (regression?). IMO it would be much better to use explicitly a random.SystemRandom instance which

[issue7511] msvc9compiler.py: ValueError when trying to compile with VC Express

2014-04-28 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: -- nosy: +brian.curtin, tim.golden ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7511 ___ ___

[issue19217] Calling assertEquals for moderately long list takes too long

2014-04-28 Thread Antoine Pitrou
Antoine Pitrou added the comment: Ezio, do you intend to add a test to your patch? -- nosy: +pitrou ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19217 ___

[issue21225] io.py: Improve docstrings for classes

2014-04-28 Thread Roundup Robot
Roundup Robot added the comment: New changeset 6e23afdee4e4 by Andrew Kuchling in branch '2.7': #21225: copy docstrings from base classes http://hg.python.org/cpython/rev/6e23afdee4e4 -- ___ Python tracker rep...@bugs.python.org

[issue21225] io.py: Improve docstrings for classes

2014-04-28 Thread Antoine Pitrou
Antoine Pitrou added the comment: I've backported Andrew's change. -- nosy: +pitrou resolution: - fixed stage: patch review - resolved status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21225

[issue21305] PEP 466: update os.urandom

2014-04-28 Thread Donald Stufft
Donald Stufft added the comment: Well except random.SystemRandom doesn't keep the file open (At least in 2.7) and actually it just calls os.urandom under the covers, also it doesn't make it very nice to get a glob of random bytes. -- ___ Python

[issue5404] Cross-compiling Python

2014-04-28 Thread Stefan Krah
Stefan Krah added the comment: Here's a cross-compile script for arm-linux-gnueabi. Building 3.4 works on Ubuntu 14.04. I cannot run the tests, since I only have an old Debian-ARM qemu image with the wrong glibc version. For 3.5 we have a regression due to the new matrix operator. --

[issue21353] document Popen.args attribute

2014-04-28 Thread Antoine Pitrou
Antoine Pitrou added the comment: Gregory, do you think this is ok to document? -- nosy: +gregory.p.smith, pitrou stage: - patch review versions: -Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21353

[issue17227] devguide: buggy heading numbers

2014-04-28 Thread Antoine Pitrou
Antoine Pitrou added the comment: I agree with Chris, changing the tocdepth doesn't sound like the right solution. Is this a Sphinx bug? Georg, could you please take a look? -- ___ Python tracker rep...@bugs.python.org

  1   2   >