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
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
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
Changes by Florent Xicluna florent.xicl...@gmail.com:
--
nosy: +flox
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18472
___
___
Python-bugs-list
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
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
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
...
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,
Changes by Stefan Krah stefan-use...@bytereef.org:
--
nosy: +lizhenhua
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20305
___
___
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
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
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
___
___
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
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
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
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:
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
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
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
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
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
___
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
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
___
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
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
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
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
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
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
___
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
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
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
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
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
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
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
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
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
___
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!
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?
--
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
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()
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
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,
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
___
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
___
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
___
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,
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
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
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
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
--
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.
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
Changes by Steve Dower steve.do...@microsoft.com:
--
nosy: +steve.dower
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1284316
___
___
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
___
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
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
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
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
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
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
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
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
---
Changes by Antoine Pitrou pit...@free.fr:
--
nosy: -pitrou
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16104
___
___
Python-bugs-list mailing
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
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
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
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,
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
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
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:
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()
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
___
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
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
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 =
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
___
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
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
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
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
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
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
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:
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
___
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
Changes by Hannan Aharonov buffe...@gmail.com:
--
type: - behavior
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21379
___
___
Python-bugs-list
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
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
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
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
Changes by Antoine Pitrou pit...@free.fr:
--
nosy: +brian.curtin, tim.golden
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7511
___
___
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
___
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
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
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
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.
--
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
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 - 100 of 150 matches
Mail list logo