New submission from STINNER Victor:
set_result/set_exception methods of an asyncio.Future raise an exception if the
future is cancelled.
Attached patch adds the check in 3 remaining places.
--
components: asyncio
files: asyncio.patch
keywords: patch
messages: 233699
nosy: gvanrossum,
New submission from Martin Panter:
This simple patch documents that max_length has to be non-zero. The
implementation actually uses zero as a special value to indicate max_length was
not specified.
Also, I wonder what the point of the Decompressor.flush() method is. Reading
the module code
Changes by Brian Thorne hardb...@gmail.com:
--
nosy: -Thorney, chris.jerdonek, eric.araujo, ezio.melotti, georg.brandl
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16192
Terry J. Reedy added the comment:
I believe I explained above the logical and technical factors that make the
Idle shell inherently different from the console shell in this regard. As the
title says, this issue is about not using tabs and not about mixing tabs and
spaces. As I already said,
STINNER Victor added the comment:
atomicv3.patch is wrong for GCC builtin atomic operations: the parenthesis is
not closed. I fixed this typo in the commit.
Vitor Gustavo: Thanks for the patch, it's now applied to Python 3.5.
I tested it on Fedora 21 (x86_64). I disabled manually
Devin Jeanpierre added the comment:
Yes, also, it is documented:
https://docs.python.org/3/library/decimal.html#decimal.InvalidOperation
Still, the status quo is bad. At the very least there should be clear
documentation on how Decimal differs in behavior from floats and ints. (Other
than
STINNER Victor added the comment:
For STARTTLS, see also this issue:
https://code.google.com/p/tulip/issues/detail?id=79
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22560
___
STINNER Victor added the comment:
Oh, I forgot that the change in subprocess.py (check if waiter is cancelled
before setting its result) is already part of the issue #23197 which comes with
an unit test.
The changes on the SSL handshake are still needed.
--
STINNER Victor added the comment:
To be clear: rand.diff looks good to me, go ahead.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23025
___
Devin Jeanpierre added the comment:
I'm going to add a test case that changes the sequence length during .index(),
and just do whatever list does in that case.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23086
New submission from Zach Welch:
I tried to link a program against the libpython27.a provided by the latest
2.7.9 amd64 installer, only to discover that the provided library is a 32-bit
version. I had to go through the gendef/dlltool dance in order to produce a
useable 64-bit library from the
Nathaniel Smith added the comment:
I hereby invoke the one month ping rule! Patch, be pinged!
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22986
___
New submission from Devin Jeanpierre:
import decimal
x = 0
y = float(x)
z = decimal.Decimal(x)
x == y == z == x
True
x ** x
1
y**y
1.0
z**z
Traceback (most recent call last):
File stdin, line 1, in module
File /usr/lib/python2.7/decimal.py, line 2216, in __pow__
return
Changes by Devin Jeanpierre jeanpierr...@gmail.com:
--
type: - behavior
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23201
___
___
Ezio Melotti added the comment:
In the code there is this comment:
# 0**0 = NaN (!), x**0 = 1 for nonzero x (including +/-Infinity)
and raising the error for this specific case seems intentional.
--
nosy: +ezio.melotti, facundobatista, mark.dickinson, rhettinger, skrah
versions:
Josh Rosenberg added the comment:
Intentional, but really hard to justify from a consistency perspective. There
appear to be several reasonable arguments to treat it as 1 regardless of the
mathematical impurity (
https://www.math.hmc.edu/funfacts/ffiles/10005.3-5.shtml ), and since we
Chris Rebert added the comment:
This behavior seems to be required by the General Decimal Arithmetic
Specification (http://speleotrove.com/decimal/daexcep.html ):
The following exceptional conditions can occur:
[...]
Invalid operation
This occurs and signals
New submission from Florian Bruhin:
https://docs.python.org/3/library/venv.html says:
If the target directory already exists an error will be raised, unless the
--clear or --upgrade option was provided.
However, that doesn't seem to be the case:
[florian@ginny ~]$ python --version
Python
Devin Jeanpierre added the comment:
I take it back, I don't want to copy what the list type does, because it's
wrong: http://bugs.python.org/issue23204
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23086
Changes by Ezio Melotti ezio.melo...@gmail.com:
--
nosy: +brett.cannon, eric.snow, ezio.melotti, ncoghlan
type: - behavior
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23203
___
Serhiy Storchaka added the comment:
May be make math.inf and math.nan special objects so that for all x (except inf
and nan):
x math.inf
x -math.inf
not (x math.nan)
not (x math.nan)
--
___
Python tracker rep...@bugs.python.org
Al Sweigart added the comment:
*more transparent, that is. Not opaque.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23184
___
___
Al Sweigart added the comment:
I've updated the patch.
I've removed the EditorWindow deletion. Importing that and using it as a class
variable instead of using an assignment statement wasn't picked up. (Is there a
more opaque way to do this import?)
I've left the RemoteDebugger.py change in.
New submission from Franck Michea:
Hi, for those of you that prefer to read an example, you can read that
commented demonstration of the bug[1].
Today I discovered what I think is a bug in the import system. Here is the
basic setup:
We have three nested packages: foo - bar - baz. The bar
New submission from Devin Jeanpierre:
class AppendOnUnequal(object):
... def __init__(self, append_to):
... self.append_to = append_to
... def __eq__(self, other):
... if self is other:
... return True
... self.append_to.append(self)
...
New submission from STINNER Victor:
Attached patch refactors the asyncio.StreamReader class:
- use the value None instead of True or False to wake up the waiter
- add a new _wakeup_waiter() method
- replace _create_waiter() method with a _wait_for_data() coroutine function
The change adds a
Roundup Robot added the comment:
New changeset fbe87fb071a6 by Victor Stinner in branch 'default':
Issue #22038: pyatomic.h now uses stdatomic.h or GCC built-in functions for
https://hg.python.org/cpython/rev/fbe87fb071a6
--
nosy: +python-dev
___
R. David Murray added the comment:
This appears to be a duplicate of issue 23196 (the strxfrm issue).
--
nosy: +r.david.murray
resolution: - duplicate
stage: - resolved
status: open - closed
superseder: - Greek letters not sorted properly
___
R. David Murray added the comment:
Oops, I meant issue 23195.
--
superseder: Greek letters not sorted properly - Sorting with locale (strxfrm)
does not work properly with Python3 on Macos
___
Python tracker rep...@bugs.python.org
Changes by R. David Murray rdmur...@bitdance.com:
--
nosy: +r.david.murray
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23195
___
___
Changes by R. David Murray rdmur...@bitdance.com:
--
title: Sorting with locale does not work properly with Python3 on Macos -
Sorting with locale (strxfrm) does not work properly with Python3 on Macos
___
Python tracker rep...@bugs.python.org
Al Sweigart added the comment:
There are three pieces of user-specified configuration: (1) the number of
spaces for a tab set in IDLE's config, (2) the sys.ps1 value, and (3) the
sys.ps2 value.
Currently IDLE's shell is ignoring (1) while the editor is not. IDLE's shell is
ignoring (3) while
Martin Panter added the comment:
The processing of unconsumed_tail in flush() was introduced via Issue 16411.
Before that I suspect flush() was assumed to only be called when max_length was
not used.
The decompress() method changed from Z_NO_FLUSH to Z_SYNC_FLUSH in Feb 2001;
see revision
Ned Deily added the comment:
The initial difference appears to be a long-standing BSD (including OS X)
versus GNU/Linux platform difference. See, for example:
http://www.postgresql.org/message-id/18c8a481-33a6-4483-8c24-b8ce70db7...@eggerapps.at
Why there is no difference between en and fr
Changes by Ned Deily n...@acm.org:
--
title: Sorting with locale (strxfrm) does not work properly with Python3 on
Macos - Sorting with locale (strxfrm) does not work properly with Python3 on
BSD or OS X
___
Python tracker rep...@bugs.python.org
STINNER Victor added the comment:
The postresq discussion and some earlier Python issues suggest using ICU to
properly implement Unicode functions like collation across all platforms.
In my experience, the locale module is error-prone and not reliable, especially
if you want portability. It
STINNER Victor added the comment:
Except of my small suggestion on the doc (see the review), math_inf_nan4.patch
looks good to me.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23185
___
Josh Rosenberg added the comment:
I think it avoids len because the length might change during iteration due to
side-effects of other code. Since a shrinking sequence would raise an
IndexError anyway when you overran the end, it may as well not assume the
length is static and just keep
STINNER Victor added the comment:
I don't like the idea of ignoring exceptions (CancelledError). An option may be
to store the latest exception and reraise it when the condition is acquired.
I'm not sure that it's safe or correct to retry to acquire the condition.
I don't know what I should
Josh Rosenberg added the comment:
Note: index returns without the caller having a chance to execute code that
would change the sequence length directly. But other threads could change it,
as could a custom __eq__ on an object stored in the sequence (or a poorly
implemented __getitem__ or
STINNER Victor added the comment:
threading.Condition.wait() implementation is very similar to
asyncio.Condition.wait(), and the threading code only call acquire() once, it
doesn't loop or ignore exceptions.
Does it mean that threading.Condition.wait() has the same issue?
--
STINNER Victor added the comment:
Visual Studio 2013 Professional works fine under Windows 7 SP1 here.
Ok, good to know. But is it correct that the free version of VS 2013
(community) requires Windows 8.1 or newer? It's not cool to require to upgrade
Windows to being able to freely compile
New submission from Antoine Pitrou:
With PCbuild\build.bat -d -e, OpenSSL fails building:
nasm: fatal: unable to open input file `Z:\cpython\default\externals\openssl-
1.0.1j\tmp32\aes-586.asm'
Detailed build log is:
Z:\cpython\default\PCbuild\libeay.vcxproj (default target) (32:3) -
Antoine Pitrou added the comment:
Z:\cpython\defaultdir Z:\cpython\default\externals\openssl-1.0.1j\
Volume in drive Z is antoine
Volume Serial Number is 2FA8-F31C
Directory of Z:\cpython\default\externals\openssl-1.0.1j
01/08/2015 11:59 AMDIR .
01/08/2015 12:10 PMDIR
Mark Lawrence added the comment:
@Victor I don't know what version you need for Windows 7 or earlier but I can
tell you that VS 2013 Community edition is *NOT* free, I fell into that trap
myself, you need the Express edition.
--
___
Python tracker
Changes by Al Sweigart asweig...@gmail.com:
--
nosy: +Al.Sweigart
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7676
___
___
Python-bugs-list
Antoine Pitrou added the comment:
Visual Studio 2013 Professional works fine under Windows 7 SP1 here.
--
nosy: +pitrou
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22919
___
Chris Angelico added the comment:
Nick, any particular reason for pointing to
https://hg.python.org/cpython/annotate/bbf16fd024df/Lib/__future__.py rather
than https://hg.python.org/cpython/annotate/tip/Lib/__future__.py ? I'm looking
at both, anyhow.
--
Changes by Antoine Pitrou pit...@free.fr:
--
resolution: - rejected
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23190
___
Antoine Pitrou added the comment:
Hmm, probably the svn export had failed for some reason. I deleted the OpenSSL
directory, re-ran get_externals.bat and then everything went fine.
--
___
Python tracker rep...@bugs.python.org
New submission from M. Schmitzer:
The way the fnmatch module uses its regex cache is not threadsafe. When
multiple threads use the module in parallel, a race condition between
retrieving a - presumed present - item from the cache and clearing the cache
(because the maximum size has been
STINNER Victor added the comment:
I guess that a lot of stdlib modules are not thread safe :-/ A workaround is to
protect calls to fnmatch with your own lock.
--
nosy: +haypo
___
Python tracker rep...@bugs.python.org
Steve Dower added the comment:
You will need Windows 7 *SP1*, as I don't think VS will run without the
updates. There is also a service pack for VS 2010 that may enable opening the
newer solution - it certainly worked for me.
We decided not to keep the old project files as they weren't being
Nick Coghlan added the comment:
The documentation of PyErr_SetObject, PyErr_SetString et al should also be
updated to mention exception chaining.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23188
Bernard Spil added the comment:
LibreSSL defines in opensslv.h
#define LIBRESSL_VERSION_NUMBER 0x2000L
#define OPENSSL_VERSION_NUMBER 0x2000L
And FreeBSD replaces
#define OPENSSL_VERSION_NUMBER 0x1000107fL
Proper way would be to check for LIBRESSL_VERSION_NUMBER string, FreeBSD
Vjacheslav Fyodorov added the comment:
Now in 3.4 Fedora 21
--
nosy: +Vjacheslav.Fyodorov
versions: +Python 3.4 -3rd party, Python 3.2, Python 3.3
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13307
Mark Dickinson added the comment:
I have an updated patch taking into account the most recent review comments
(for which thanks!), but it's at home; I'll upload it this evening (UTC+00:00).
--
___
Python tracker rep...@bugs.python.org
Changes by STINNER Victor victor.stin...@gmail.com:
Removed file: http://bugs.python.org/file37637/sslproto-4.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22560
___
STINNER Victor added the comment:
Oh, I wrote the patch for Tulip. Patch regenerated to use Python paths.
--
Added file: http://bugs.python.org/file37638/sslproto-4.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22560
STINNER Victor added the comment:
Proper way would be to check for LIBRESSL_VERSION_NUMBER string, FreeBSD
modifies the OpenSSL version number to indicate its compatibility level (as
stated in commit log)
Please see the unit test: it checks that the version number and version string
are
Nick Coghlan added the comment:
After looking into this further, PyErr_SetObject (and other APIs like
PyErr_SetString which call that internally) aim to handle the chaining
automatically, but they don't handle exceptions which haven't been normalized
yet.
PyErr_SetObject should probably
Nick Coghlan added the comment:
Thinking about it a bit further, I suspect implicit normalisation of chained
exceptions could cause problems when we only want to set __cause__ without
setting __context__ (e.g. codec exception chaining).
I'm going to ponder this one for a while, but happy to
Nick Coghlan added the comment:
Looking more closely at the patch:
* for the missing tracebacks, you're probably hitting the note in
https://docs.python.org/3/c-api/exceptions.html#c.PyErr_NormalizeException and
need an explicit call to PyErr_SetTraceback (My recollection is that I made
this
New submission from Jarle Selvåg:
Python code byte-compiled with -OO has doc-strings stripped out.
This creates problems when compiling different packages which changes the
doc-strings by doing something like this:
__doc__ += additional text
(when the docstring is 'None', this will
STINNER Victor added the comment:
Hi, I'm no more able to compile Python 3.5 on Windows. I have Visual Studio
2008 Express, Visual Studio 2010 Express. VS 2010 is unable to open
PCbuild/pcbuild.sln: it says that the file was created on a more recent Visual
Studio version and it is unable to
STINNER Victor added the comment:
Here is a patch adding a new _Py_fstat() function which uses signed 64-bit
integer to store the file size and so is not limited to 2 GB files. I just
moved the code from posixmodule.c to fileutils.c.
The patch replaces calls to fstat() with _Py_stat() (and
STINNER Victor added the comment:
Oh by the way, 2 Windows buildbot slaves are no more able to compile Python. I
don't know if it's related to this issue or not.
Builder AMD64 Windows7 SP1 3.x, owned by Jeremy Kloth:
http://buildbot.python.org/all/builders/AMD64%20Windows7%20SP1%203.x
2LINK
Jarle Selvåg added the comment:
This issue is only relevant for classes that have this construct:
class MyClass(object):
__doc__ += '''Some more text'''
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23189
STINNER Victor added the comment:
#define fstat _fstati64
This change (alone) is not safe because _fstati64() doesn't use struct stat
but struct __stat64.
I don't like such global define, I may have unexpected side effect. I prefer to
modify directly calls to fstat() in .c files (like the
Al Sweigart added the comment:
Since tabnanny is also a module in the standard library (it is imported by the
idle code), wouldn't moving it to lib/test/test_tools make it un-importable?
This would be a good case for leaving it where it is.
--
nosy: +Al.Sweigart
Raymond Hettinger added the comment:
Try something like this:
if start 0:
start += len(self)
if stop is None:
stop = len(self)
elif stop 0:
stop += len(self)
for i in range(max(start, 0), min(stop, len(self))):
if
Chris Angelico added the comment:
PyErr_Restore doesn't seem to trigger exception chaining. But thanks for the
tip about explicitly setting the traceback; not sure how I missed that, but now
the StopIteration traceback is visible.
Minor point: The previous patch was setting the __context__ of
Changes by Chris Angelico ros...@gmail.com:
Added file: http://bugs.python.org/file37641/stopiter.py
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22906
___
Steve Dower added the comment:
I prefer your patch too. (I've posted on the other thread about the build
problems, and I'll test this when I get a chance.)
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23152
M. Schmitzer added the comment:
Ok, if that is the attitude in such cases, feel free to close this.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23191
___
STINNER Victor added the comment:
It would be nice to fix the issue, but I don't know how it is handled in other
stdlib modules.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23191
___
Serhiy Storchaka added the comment:
It is easy to make fnmatch caching thread safe without locks. Here is a patch.
The problem with fnmatch is that the caching is implicit and a user don't know
that any lock are needed. So either the need of the lock should be explicitly
documented, or
Serhiy Storchaka added the comment:
_PyErr_ChainExceptions() was added because exceptions raised in C code are not
implicitly chained. The code for explicit chaining is error prone, so it was
extracted in separate function. Even with _PyErr_ChainExceptions() chaining
exceptions look complex.
Serhiy Storchaka added the comment:
+1 for removing unicode specialization. Dictionaries with string keys is a part
of the language, but sets of strings are not special.
--
nosy: +serhiy.storchaka
___
Python tracker rep...@bugs.python.org
M. Schmitzer added the comment:
@serhiy.storchaka: My thoughts exactly, especially regarding the caching being
implicit. From the outside, fnmatch really doesn't look like it could have
threading issues.
The patch also looks exactly like what I had in mind.
--
Mark Dickinson added the comment:
New patch, addressing review comments.
--
Added file: http://bugs.python.org/file37647/math_inf_nan4.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23185
Chris Angelico added the comment:
I'm not sure what to look for in the code generation. In compile.c lines 3456
and following, there's a LOAD_CONST None coming through, in the else branch of
if (e-v.Yield.value), but nothing talking about lambda functions. There are
constants
Changes by Rickard Englund gefle.rick...@gmail.com:
--
nosy: +r-englund
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23187
___
___
Rickard Englund added the comment:
I have also had this problem.
The way I solved it was to undef _DEBUG before including python and then
redefine it again:
#undef _DEBUG //Prevent linking debug build of python
#include Python.h
#define _DEBUG 1
This is just a hack though and it
Changes by Antoine Pitrou pit...@free.fr:
--
nosy: +steve.dower, tim.golden, zach.ware
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22411
___
___
Martin Panter added the comment:
It turns out that GzipFile.read(size) etc is also susceptible to
decompression bombing. Here is a patch to test and fix that, making use of the
existing “max_length” parameter in the “zlib” module.
--
Added file:
Changes by Serhiy Storchaka storch...@gmail.com:
--
nosy: +lars.gustaebel, serhiy.storchaka
stage: - patch review
versions: +Python 3.5
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23193
Chris Angelico added the comment:
Okay! I think I have something here. DEFINITELY needs more eyeballs, but all
tests pass, including a new one that tests StopIteration leakage both with and
without the __future__ directive. Some docs changes have been made (I grepped
for 'stopiteration' and
Marc-Andre Lemburg added the comment:
On 08.01.2015 15:46, Serhiy Storchaka wrote:
Sets of strings are very common when trying to create a unique set of
strings or optimizing name in set_of_names lookups.
This is not nearly so common as attributes or globals access, or passing
keyword
Barry A. Warsaw added the comment:
That's a backward compatibility break since existing code may be expecting
None. At least it needs to be carefully considered, and should have no
possibility of be applied to anything before Python 3.5.
--
nosy: +barry
versions: -Python 2.7, Python
Changes by Ezio Melotti ezio.melo...@gmail.com:
--
nosy: +ezio.melotti
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23119
___
___
Changes by Serhiy Storchaka storch...@gmail.com:
--
nosy: +benjamin.peterson, gvanrossum, serhiy.storchaka
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23192
___
Marc-Andre Lemburg added the comment:
I'm not sure I follow:
Sets of strings are very common when trying to create a unique set of strings
or optimizing name in set_of_names lookups.
Regarding your benchmark numbers: I have a hard time following how they work. A
simply word in
Serhiy Storchaka added the comment:
Sets of strings are very common when trying to create a unique set of strings
or optimizing name in set_of_names lookups.
This is not nearly so common as attributes or globals access, or passing
keyword arguments.
--
Steve Dower added the comment:
Just emailed Jeremy about the buildbot. It looks like the last time tests were
run something didn't clean up properly and left the build output locked.
There's nothing wrong with the project files.
--
___
Python
STINNER Victor added the comment:
(...) if there is a chance that this patch goes in I'm happy to write the
required test (mocking os.chown()) for this to go in.
We don't accept changes without test. So you must write a test.
Implementing the feature in Python makes sense.
--
nosy:
Changes by Chris Angelico ros...@gmail.com:
--
type: - behavior
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23192
___
___
Python-bugs-list
New submission from Chris Angelico:
As yield is an expression, it's legal in a lambda function, which then
means you have a generator function. But it's not quite the same as
the equivalent function made with def:
$ python3
Python 3.5.0a0 (default:1c51f1650c42+, Dec 29 2014, 02:29:06)
[GCC
New submission from Michael Vogt:
Please consider adding a option to extract a tarfile with the uid/gid instead
of the lookup for uname/gname in the tarheader (i.e. what tar --numeric-owner
provides).
One use-case is if you unpack a chroot tarfile that contains a
/etc/{passwd,group} file
Changes by STINNER Victor victor.stin...@gmail.com:
--
nosy: +haypo
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23192
___
___
Python-bugs-list
1 - 100 of 116 matches
Mail list logo