David Barnett added the comment:
I guess it must be more complicated than it looks, because I thought checking
for unicode strings and doing .encode('utf-8') would help at least some cases
without making anything worse.
Anyways, if it's too hard or not worth fixing correctly, couldn't we at
Serhiy Storchaka added the comment:
The patch is too optimistic, it gives different results depending on the
alignment of the memory buffer:
So this method is not applicable for a byte. Here is a patch only for strings.
If a fast hash for bytes/memoryview is desirable, I can write a fast
Gregory P. Smith added the comment:
To remove the double close fd-reuse-window race condition you describe in 3.2.3
and later I don't think you even need to add that code snippet. Just get rid
of the for loop calling os.close on those three fd's all together. self.stdin,
self.stdout and
Serhiy Storchaka added the comment:
Here is a test case for the hash/alignment issue.
I think here should be a test for a shifted data. Something like
hash(b'abcd...') == hash(memoryview(b'xabcd...')[1:]).
--
___
Python tracker
Serhiy Storchaka added the comment:
Oh, I see, it's already here.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16427
___
___
Python-bugs-list
Serhiy Storchaka added the comment:
LGTM.
--
nosy: +nadeem.vawda, serhiy.storchaka
stage: needs patch - commit review
versions: +Python 3.4
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15677
Roundup Robot added the comment:
New changeset 6ebfdfe74c04 by Gregory P. Smith in branch '3.2':
Fixes issue #16140: The subprocess module no longer double closes its
http://hg.python.org/cpython/rev/6ebfdfe74c04
New changeset 9f8b0444c8a6 by Gregory P. Smith in branch '3.3':
Fixes issue
Serhiy Storchaka added the comment:
I see you much adjusted the patch. It looks good, thanks you.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16350
___
New submission from Simon Feltman:
This is a feature request to include a WeakMethod or similar object to the
weakref module. The object decomposes a bound method and holds a weakref to the
object and unbound function. This can be a very useful utility in signal and ui
based programming.
The
Mark Dickinson added the comment:
Duplicate of http://bugs.python.org/issue14631 ?
--
nosy: +mark.dickinson
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16452
___
Changes by Mark Dickinson dicki...@gmail.com:
--
stage: - needs patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16452
___
___
Changes by Mark Dickinson dicki...@gmail.com:
--
components: +Library (Lib) -None
versions: +Python 3.4
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16452
___
Roundup Robot added the comment:
New changeset 2bdd984a55ac by Gregory P. Smith in branch '2.7':
Fix issue #16140 bug that the fix to issue #16327 added - don't double
http://hg.python.org/cpython/rev/2bdd984a55ac
--
___
Python tracker
Roundup Robot added the comment:
New changeset 2bdd984a55ac by Gregory P. Smith in branch '2.7':
Fix issue #16140 bug that the fix to issue #16327 added - don't double
http://hg.python.org/cpython/rev/2bdd984a55ac
--
___
Python tracker
Changes by Gregory P. Smith g...@krypto.org:
--
resolution: - fixed
status: open - closed
versions: +Python 2.7
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16140
___
Changes by Gregory P. Smith g...@krypto.org:
--
stage: test needed - committed/rejected
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16140
___
Simon Feltman added the comment:
Indeed a duplicate of: http://bugs.python.org/issue14631
--
resolution: - duplicate
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16452
STINNER Victor added the comment:
Did qomeone start to write a PEP?
Le 11 nov. 2012 05:56, Chris Rebert rep...@bugs.python.org a écrit :
Chris Rebert added the comment:
What about CityHash? (http://code.google.com/p/cityhash/ ; unofficial C
port: http://code.google.com/p/cityhash-c/ )
Changes by Serhiy Storchaka storch...@gmail.com:
--
stage: - needs patch
versions: +Python 3.4 -Python 3.1
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5784
___
Mark Dickinson added the comment:
Adding some useful links from Simon Feltman in issue 16452.
See also:
http://bugs.python.org/issue813299
http://bugs.python.org/issue7464
This is the recipes:
http://code.activestate.com/recipes/81253/
http://mindtrove.info/python-weak-references/
--
Changes by Mark Dickinson dicki...@gmail.com:
--
superseder: - Instance methods and WeakRefs don't mix.
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16452
___
Simon Feltman added the comment:
Just a note this is also referred to as a WeakMethod by some folks (so this
ticket shows up in those searches). See also:
http://bugs.python.org/issue813299
http://bugs.python.org/issue7464
http://bugs.python.org/issue16452
--
Changes by Mark Dickinson dicki...@gmail.com:
--
versions: +Python 3.4 -Python 3.3
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14631
___
___
Giovanni Bajo added the comment:
Il giorno 11/nov/2012, alle ore 05:56, Chris Rebert rep...@bugs.python.org ha
scritto:
Chris Rebert added the comment:
What about CityHash? (http://code.google.com/p/cityhash/ ; unofficial C port:
http://code.google.com/p/cityhash-c/ )
It's good enough
Mark Dickinson added the comment:
test_gc and test_csv seem to be failing on some of the buildbots as a result of
these checkins. It looks as though the new test_subprocess test creates some
uncollectable garbage.
--
nosy: +mark.dickinson
___
Mark Dickinson added the comment:
Adding 'del p' at the end of the test method fixes this for me.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16140
___
Garrett Cooper added the comment:
Yes. Submitting a patch to fix this based on hg master shortly..
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16124
___
Antoine Pitrou added the comment:
If a fast hash for bytes/memoryview is desirable, I can write a fast
robust implementation for nonaligned data. But this will be more
cumbersome and a bit slower.
Unaligned accesses are not a problem on x86(-64), but they will segfault
(bus error, IIRC) on
Vinay Sajip added the comment:
Thanks for the patch, but I'm closing this as 'wontfix', as per the points made
by Antoine and David. If you need logging from an embedded system, please
consider using one of the socket-based logging handlers, if that's feasible in
the specific situation.
Stefan Krah added the comment:
FWIW, on x86/x64 gcc often generates identical code for x = y and
memcpy(x, y, 8). See e.g. the PACK_SINGLE and UNPACK_SINGLE macros in
Objects/memoryobject.c.
I didn't look at the patch yet, just an idea.
--
___
Serhiy Storchaka added the comment:
What about the rotator attribute.
--
nosy: +serhiy.storchaka
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16449
___
Serhiy Storchaka added the comment:
Unaligned accesses are not a problem on x86(-64), but they will segfault
(bus error, IIRC) on other architectures such as SPARC, unfortunately.
On x86(-64) this kills performance and makes the optimization be senseless.
FWIW, on x86/x64 gcc often generates
Garrett Cooper added the comment:
$ uname -a
FreeBSD bayonetta.local 9.1-PRERELEASE FreeBSD 9.1-PRERELEASE #0 r240836M: Sat
Sep 22 12:30:11 PDT 2012
gcooper@bayonetta.local:/usr/obj/store/freebsd/stable/9/sys/BAYONETTA amd64
$ ./configure --prefix=/scratch/python-bin/3k/
...
$ make all;
Garrett Cooper added the comment:
Sorry; previous patch is not applicable to this issue. This one is.
--
Added file: http://bugs.python.org/file27952/python-issue16124.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16124
Changes by Garrett Cooper yaneg...@gmail.com:
Removed file: http://bugs.python.org/file27951/python-issue13500-test.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16124
___
Garrett Cooper added the comment:
And I missed the int - unsigned int part. Resubmitting one last time for
tonight..
--
Added file: http://bugs.python.org/file27953/python-issue16124.patch
___
Python tracker rep...@bugs.python.org
Changes by Garrett Cooper yaneg...@gmail.com:
Removed file: http://bugs.python.org/file27953/python-issue16124.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16124
___
Garrett Cooper added the comment:
Grr... Let's try again.
--
Added file: http://bugs.python.org/file27954/python-issue16124.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16124
___
Garrett Cooper added the comment:
... g'night.
--
Added file: http://bugs.python.org/file27955/python-issue16124.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16124
___
Phil Connell added the comment:
I'm not convinced that it matters whether the rename or move is atomic. Can
anyone come up with a quick concrete example?
I see two scenarios:
1. The process crashes during a copy in shutils.move(). In this case, some logs
will be duplicated across the files
Phil Connell added the comment:
Serhiy, there are also calls to os.rename in RotatingFileHandler.doRollover
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16449
___
Stefan Krah added the comment:
The code can be identical, but the time will differ significantly for
aligned and non-aligned data.
Of course, but in most cases the data *is* aligned, so only code that does
something quite special pays the performance penalty.
--
Vinay Sajip added the comment:
The current implementation was written with an expectation of working rename
functionality in the stdlib. As such, while this issue might be categorised as
being of type enhancement, I don't see how you can categorise it as being of
type behaviour.
What's the
Roundup Robot added the comment:
New changeset 735ef27fa231 by Nadeem Vawda in branch '2.7':
Issue #15677: Document that zlib and gzip accept a compression level of 0 to
mean 'no compression'.
http://hg.python.org/cpython/rev/735ef27fa231
New changeset f6c4c178da56 by Nadeem Vawda in branch
Nadeem Vawda added the comment:
Committed. Thanks for the patch!
--
resolution: - fixed
stage: commit review - committed/rejected
status: open - closed
type: - enhancement
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15677
Phil Connell added the comment:
I've updated the type to enhancement (it seems like a grey area to me - it's a
behavioural fix for a niche use case).
I suggested a patch rather than simply subclassing RotatingFileHandler since:
- The subclass would just have a copy of RotatingFileHandler's
Antoine Pitrou added the comment:
I've updated the type to enhancement (it seems like a grey area to me
- it's a behavioural fix for a niche use case).
I suggested a patch rather than simply subclassing RotatingFileHandler
since:
- The subclass would just have a copy of
Serhiy Storchaka added the comment:
Stefan, thank you for the suggestion. The test showed that, in fact, at least
under some x86 there is no performance decrease when using memcpy on nonaligned
data. This is good news. The code can left simple and even some doubtful
potential undefined
Serhiy Storchaka added the comment:
Doesn't the rotator attribute break atomicity? A careful rotator should
first rename the source to the temporary file, process the data and save it to
other temporary file, and then rename the result to the destination and remove
the first temporary file.
Changes by Antoine Pitrou pit...@free.fr:
--
nosy: +skrah, trent
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16124
___
___
Python-bugs-list
Georg Brandl added the comment:
Fixed with commit 11779150cf87 in the peps repo. May need a PEP addition or
PEP title change to trigger, but it's too minor to force that right now.
--
nosy: +georg.brandl
resolution: - fixed
status: open - closed
Georg Brandl added the comment:
@ Nick/Ezio: the catch was that the /dev/peps/ directory is handled in addition
to /dev/peps/pep-/, which always had a nice title.
For all PEPs, four files are generated (although it seems sufficient to have
two), while for /dev/peps/, only body.html was
Changes by Serhiy Storchaka storch...@gmail.com:
--
stage: needs patch - patch review
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15861
___
___
Vinay Sajip added the comment:
Doesn't the rotator attribute break atomicity?
Which rotator do you mean? The default rotator is None, which leads to
os.rename being called. If you're referring to the example in the documentation
(cookbook) - it was intended purely as an example, and the
Changes by Antoine Pitrou pit...@free.fr:
--
nosy: +serhiy.storchaka
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8865
___
___
Python-bugs-list
Antoine Pitrou added the comment:
WeakMethod sounds like a good name to me. However, instead of acting as a
proxy, I think it should act as a regular weakref (i.e. you have to call it to
get the actual method object).
--
nosy: +pitrou
___
Python
Changes by Terry J. Reedy tjre...@udel.edu:
--
nosy: +amaury.forgeotdarc, belopolsky, meador.inge
versions: -Python 3.1
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16396
___
Terry J. Reedy added the comment:
Jorge, can we close this or do you still have a specific suggestion.
Also, if you reply by mail, please snip previous messages as they are already
posted.
--
nosy: +terry.reedy
type: behavior - enhancement
___
Terry J. Reedy added the comment:
I would be helped by such an explanation in the devguide.
--
nosy: +terry.reedy
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16405
___
Jorge Cardona added the comment:
Hi, this can be closed.
Thanks.
--
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16397
___
Gregory P. Smith added the comment:
That test is gross... it creates a nasty cycle of an instance back to itself
via a stubbed out nested function's enclosing scope.
I'm sanitizing it now to simplify the code and not have any cycles.
--
___
Python
Terry J. Reedy added the comment:
Juraj: Is the example behavior from Py2 or Py3? The meaning of 'range' changed.
In Py2, xrange would be the correct choice for 'choice'.
Does argparse actually convert (x)range objects to a list or set (the help
indicates the latter) for internal use? That
New submission from Antoine Pitrou:
Dead weakrefs to a given object happen to be equal if they don't have a
callback, but unequal if they do. However, they are always equal when alive:
class O: pass
...
o = O()
def cb(_): pass
...
q = weakref.ref(o)
r = weakref.ref(o)
s =
Antoine Pitrou added the comment:
Aha, it is even worse:
o = O()
q = weakref.ref(o)
r = weakref.ref(o)
del o
q() is None
True
q == r
True
q != r
True
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16453
Changes by Terry J. Reedy tjre...@udel.edu:
--
resolution: - works for me
stage: - committed/rejected
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16397
___
Roundup Robot added the comment:
New changeset 590f1b55abea by Antoine Pitrou in branch '3.2':
Issue #16453: Fix equality testing of dead weakref objects.
http://hg.python.org/cpython/rev/590f1b55abea
New changeset c00e2c1cb3a7 by Antoine Pitrou in branch '3.3':
Issue #16453: Fix equality
Roundup Robot added the comment:
New changeset 13b74c0b040c by Antoine Pitrou in branch '2.7':
Issue #16453: Fix equality testing of dead weakref objects.
http://hg.python.org/cpython/rev/13b74c0b040c
--
___
Python tracker rep...@bugs.python.org
Serhiy Storchaka added the comment:
If we will considered it's important enough to fix, here are patches.
--
keywords: +patch
Added file: http://bugs.python.org/file27957/sre_code_ucs4-2.7.patch
___
Python tracker rep...@bugs.python.org
Changes by Serhiy Storchaka storch...@gmail.com:
Added file: http://bugs.python.org/file27958/sre_code_ucs4-3.2.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1160
___
Antoine Pitrou added the comment:
Now fixed.
--
resolution: - fixed
stage: - committed/rejected
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16453
___
Changes by Serhiy Storchaka storch...@gmail.com:
--
stage: test needed - patch review
Added file: http://bugs.python.org/file27959/sre_code_ucs4_test.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1160
Antoine Pitrou added the comment:
Here is a patch adding a WeakMethod class. It still lacks docs, I'll add some
if people agree on the principle.
--
keywords: +patch
Added file: http://bugs.python.org/file27960/weakmethod.patch
___
Python tracker
Roundup Robot added the comment:
New changeset 797de1864fd9 by Antoine Pitrou in branch '3.3':
Add a test for hashing of unaligned memory buffers (from issue #16427).
http://hg.python.org/cpython/rev/797de1864fd9
New changeset 9cb1366b251b by Antoine Pitrou in branch 'default':
Add a test for
Juraj Variny added the comment:
It was Python 2.7 . But if range shouldn't be used for large number of options,
arguing whether it's O(1) is splitting hairs, no?
I'll remove the choices from my code. Adding new type for port is overkill,
users should know what legal TCP port numbers are.
Serhiy Storchaka added the comment:
I was unable to apply the patch automatically, so I had to do it manually.
Here is an updated patch for review. I did not consider it in detail yet, but
it seems to correct these errors.
--
type: behavior - crash
versions: +Python 3.3, Python 3.4
Terry J. Reedy added the comment:
I am arguing that (x)range *should* be usable for large numbers of options
*because* the containment test is O(1). What happens is you *do* use xrange
instead of range in 2.7 or 3.x instead of 2.7?
In 2.x, range(n) *is* a list so that is a bad choice for
Gregory P. Smith added the comment:
i'm looking at getting this in.
--
assignee: - gregory.p.smith
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8865
___
Changes by Daniel Urban urban.dani...@gmail.com:
--
nosy: +daniel.urban
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14631
___
___
Gregory P. Smith added the comment:
Christian Schubert (apexo) - Would you please submit a PSF contributor
agreement form?
http://www.python.org/psf/contrib/
http://www.python.org/psf/contrib/contrib-form-python/
thanks!
--
___
Python tracker
Simon Feltman added the comment:
The WeakCallableRef that was attached seemed to support regular functions (or
anything callable) which is nice. The naming also leaves room for a
WeakCallableProxy.
--
___
Python tracker rep...@bugs.python.org
Simon Feltman added the comment:
Some more complex examples from various libraries:
https://github.com/django/django/blob/master/django/dispatch/saferef.py
https://github.com/11craft/louie/blob/master/louie/saferef.py
I think both of these originated in pydispatcher.
--
New submission from Ray Donnelly:
I'm submitting this patch as it was suggested I do so by Antoine Pitrou on
#python-dev. As such, it's more a point of discussion than a patch I'm trying
to get merged (for one thing, my build is a MinGW GCC compiled and I've not
considered the MSVC Windows
Serhiy Storchaka added the comment:
In general the patch looks good to me. I only get rid of non-needed macros.
--
stage: - test needed
Added file: http://bugs.python.org/file27963/select_concurrent_poll.patch
___
Python tracker
Gregory P. Smith added the comment:
here's an updated patch.
it strikes me that this should not be a very common problem. how many
applications are going to share the same poll object _across_ multiple threads?
if they do and the file descriptor they'll be spending a lot of time mallocing
STINNER Victor added the comment:
TESTFN_UNDECODABLE is not detected for cp1250, cp1251, cp1252, cp1254, cp1257
and cp1258.
The Python encoding and the real codec used by Windows are different: Python
fails to decode bytes 0x80-0x9f, but Windows does decode them. I prefer to
avoid these
Gregory P. Smith added the comment:
our patches are similar. i updated it to use long long and Py_ssize_t and
Py_CLEAR and Py_RETURN_NONE in a few places and added comments.
getting rid of the CLEAR_UFDS macro as you did is a good idea.
--
___
Serhiy Storchaka added the comment:
LGTM.
--
stage: - commit review
versions: +Python 3.4
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11981
___
Serhiy Storchaka added the comment:
These encodings used not only on Windows.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16444
___
___
Antoine Pitrou added the comment:
it strikes me that this should not be a very common problem. how many
applications are going to share the same poll object _across_ multiple
threads?
Indeed that doesn't sound very likely. How about raising an error on concurrent
modification, instead of
New submission from STINNER Victor:
On FreeBSD and OpenIndiana, sys.getfilesystemencoding() is 'ascii' when the
locale is not set, whereas the locale encoding is ISO-8859-1.
This inconsistency causes different issue. For example,
os.fsencode(sys.argv[1]) fails if the argument is not ASCII
STINNER Victor added the comment:
I suppose you noticed you broke a bunch of buildbots :)
Failures occur on FreeBSD, OpenIndiana and some other buildbots which don't set
a locale and so use the C locale. main() decodes command line arguments from
the locale encoding using _Py_char2wchar().
Andreas Stührk added the comment:
See also issue #11349.
--
nosy: +Trundle
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15667
___
___
New submission from Wojtek Szymilowski:
UnicodeDecodeError exception is reported for encode operation on strings.
This issue does not surface for the same operation on unicode string
(UnicodeEncodeError exception is correctly reported).
string:
'AB\xff'.encode('ascii')
Traceback (most
Richard Oudkerk added the comment:
The patch does not apply correctly against vanilla Python 3.3. I would guess
that you are using a version of Python which has been patched to add mingw
support. Where did you get it from?
(In vanilla Python 3.3, setup.py does not contain any mention of
STINNER Victor added the comment:
These encodings used not only on Windows.
You can uses cpXXX encodings explictly to read or write a file, but these
encodings are not used for sys.getfilesystemencoding() (or sys.stdout.encoding).
--
___
Python
Ray Donnelly added the comment:
I should have checked the situation better, it is indeed towards the back end
of a series of patches to enable MinGW compilation, so the issue is irrelevant
without the preceding patches.
Sorry for the noise.
--
resolution: - invalid
STINNER Victor added the comment:
Attached patch works around the CODESET issue on OpenIndiana and FreeBSD. If
the LC_CTYPE locale is C and nl_langinfo(CODESET) returns ASCII (or an alias
of this encoding), b\xE9 is decoded from the locale encoding: if the result
is U+00E9, the patch Python
Christian Schubert added the comment:
How about raising an error on concurrent modification, instead of trying to
make it thread-safe?
That's totally fine with me.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8865
STINNER Victor added the comment:
Some tests are failing with the patch:
==
FAIL: test_undecodable_env (test.test_subprocess.POSIXProcessTestCase)
--
Traceback
STINNER Victor added the comment:
'AB\xff'.encode('ascii') raises a UnicodeDecodeError because the byte string
'AB\xff' is decoded from the default encoding (sys.getdefaultencoding(), which
is 'ASCII' in most cases), before the .encode() method is called.
This is not a Python bug, but it is
1 - 100 of 115 matches
Mail list logo