Roundup Robot added the comment:
New changeset 75c75d90f3a4 by Serhiy Storchaka in branch '2.7':
Issue #20532: Tests which use _testcapi now are marked as CPython only.
http://hg.python.org/cpython/rev/75c75d90f3a4
New changeset e5a78f7c2dcb by Serhiy Storchaka in branch '3.3':
Issue #20532:
Serhiy Storchaka added the comment:
Aha! It looks as a bug in UTF-7 codec.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20520
___
___
Vajrasky Kok added the comment:
Here is the updated patch for long object. A couple of functions that can not
be converted:
- long_new
It has custom processing before parsing arguments part.
- long_round
Not supported by clinic.
_ __trunc__, __floor__, __ceil__ all are mapped to long_long.
Changes by Vajrasky Kok sky@speaklikeaking.com:
Removed file: http://bugs.python.org/file33587/clinic_longobject.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20185
___
Charles-François Natali added the comment:
How sure are you? Suppose I use poll() with a 0.5 msec timeout. This
presumably gets rounded up to 1 msec. But if the system clock has e.g. a
10
msec resolution, won't this still wait 0 msec? Or will it wait until the
next tick occurs, which could
Vajrasky Kok added the comment:
The culprit:
diff -r b4e99bec0c8a Lib/test/test_codecs.py
--- a/Lib/test/test_codecs.py Fri Feb 07 10:10:55 2014 +0200
+++ b/Lib/test/test_codecs.py Fri Feb 07 17:14:12 2014 +0800
@@ -164,6 +164,8 @@
s = 10*(size*a + lineend + xxx\n)
New submission from Serhiy Storchaka:
UTF-7 incremental decoder can crash in debug build when decodes unfinished
base-64 section. In non-debug build it just produces inconsistent unicode
string. Minimal examples:
$ ./python -c import codecs; codecs.utf_7_decode(b'a+AIA', 'strict')
python:
Serhiy Storchaka added the comment:
Opened separate issue20538 for this bug.
--
dependencies: +Segfault in UTF-7 incremental decoder
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20520
___
Serhiy Storchaka added the comment:
Thank you Vajrasky. I got the same result.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20520
___
___
Kristján Valur Jónsson added the comment:
These macros work as assignment with builtin decref,
i.e. a smart replacement for =
We could resolve this by calling them Py_ASSIGN Py_XASSIGN
and having complementary macros Py_STORE/Py_XSTORE that will incref the new
value.
However, with an added
New submission from Nick Coghlan:
I believe this is mostly a curiousity (since actually calculating a factorial
this big would take an interminable amount of time), but math.factorial can be
provoked into throwing OverflowError by a large enough input:
math.factorial(10**19)
Traceback (most
Changes by Nick Coghlan ncogh...@gmail.com:
--
priority: normal - low
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20539
___
___
Python-bugs-list
Mark Dickinson added the comment:
What behaviour would you suggest instead?
Apart from the time, the result would have over 10**20 digits, so would need
exabytes of memory to represent.
from math import lgamma, log
lgamma(1e19) / log(10)
1.8565705518096748e+20
--
nosy:
STINNER Victor added the comment:
What behaviour would you suggest instead?
Some others Python functions like str * int raises a MemoryError on overflow.
But I don't know if OverflowError or MemoryError is better.
--
nosy: +haypo
priority: low - normal
Mark Dickinson added the comment:
Some others Python functions like str * int raises a MemoryError on overflow.
I have to say that that's always seemed wrong to me: IMO MemoryError should
only be raised when we've really run out of memory, or perhaps where the amount
of memory we're about to
Wolfgang Maier added the comment:
I have written a patch for this issue (I'm uploading the complete new code for
everyone to try it - importing it into Python3.3 works fine; a diff with
additional tests against Oscar's example will follow soon).
Just as Oscar suggested, this new version
Stefan Krah added the comment:
OverflowError seems like a good choice if only values in the range
of a C long are accepted. ValueError would perhaps be more intuitive,
since the user normally only cares about the accepted range of
input values rather than the internal details.
--
nosy:
Nick Coghlan added the comment:
I figured it was some internal storage overflowing, and I don't have an issue
with the error type. The bit that is confusing is the error *message* - what
int doesn't fit into a C long? (especially in the second case of float input
where no user level int is
Mark Dickinson added the comment:
The bit that is confusing is the error *message* - what int doesn't fit into
a C long?
Agreed: it would be nice to intercept this and give a better message.
--
___
Python tracker rep...@bugs.python.org
Stefan Krah added the comment:
We can add a fast Decimal.as_integer_ratio() in C.
That said, why is the sum of Decimals not done in decimal arithmetic
with a very high context precision? It would be exact and with usual exponents
in the range [-384, 383] it should be very fast.
c.prec = 50
New submission from Irvin Probst:
After checking with the kind people of h...@python.org I think I found a bug in
the way connections are handled in the multiprocessing module.
Using python 3.3 I've noticed a performance drop of about 70 times when running
some code performing basic requests
Roundup Robot added the comment:
New changeset 17bea44a9fa7 by Nick Coghlan in branch 'default':
Issue #20053: Actually test relevant assumption
http://hg.python.org/cpython/rev/17bea44a9fa7
--
___
Python tracker rep...@bugs.python.org
Wolfgang Maier added the comment:
We can add a fast Decimal.as_integer_ratio() in C.
That would be a terrific thing to have !! Currently, Decimals perform really
poorly with the statistics functions and this is entirely due to this
bottleneck.
With regard to calculating the sum of Decimals
New submission from Nick Coghlan:
In trying to figure out why my fix for issue 20053 wasn't working on Windows, I
eventually traced it back to the fact that os.path.exists(os.devnull) returns
False on Windows, so pip isn't picking up my config file override in ensurepip,
and reads the global
Vajrasky Kok added the comment:
See also: http://bugs.python.org/issue1311
--
nosy: +vajrasky
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20541
___
Paul Moore added the comment:
Sigh. Yes, I looked at that and wondered if os.devnul would show as existing,
but I similarly misread the test and assumed it was testing what it was meant
to test :-(
os.path.exists(os.devnull) is false on Windows (just checked) so this
assumption *is* what's
Nick Coghlan added the comment:
As Paul noted, I discovered there was a bug in my assumption testing test -
when I tried it directly on Windows, I discovered the culprit here is issue
20541.
So adding that as a dependency, and I'll disable that part of the test on
Windows (and mark the
Charles-François Natali added the comment:
Thanks for the detailed report.
connections.py from multiprocessing has been rewrittend between 3.2
and 3.3 but I can't see what's wrong in the way it has been done,
basic socket options seem to be exactly the same.
Indeed,
Changes by STINNER Victor victor.stin...@gmail.com:
--
nosy: +haypo
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20540
___
___
Python-bugs-list
Antoine Pitrou added the comment:
I would favour reusing the 3.2 heuristic. Joining the header and the payload
may be expensive if the payload is very large.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20540
STINNER Victor added the comment:
Modern operation systems have new functions like writev() to send to
consecutive buffers. Can't we use them, and emulate them if they are missing
(use 3.2 algorithm: join if small, or send separatly)?
--
___
Python
New submission from Nick Coghlan:
test_readline is consistently failing with an assertion failure in debug
builds. I'm going to add a skip for the time being, because I don't know the
UnicodeWriter or UTF7 code well enough to guess where the inconsistency may be
being introduced.
Relevant
Roundup Robot added the comment:
New changeset 2e7c46718b83 by Nick Coghlan in branch 'default':
Issue 20542: Temporarily skip failing test
http://hg.python.org/cpython/rev/2e7c46718b83
--
nosy: +python-dev
___
Python tracker rep...@bugs.python.org
Ned Deily added the comment:
Duplicate of Issue20520
--
nosy: +ned.deily
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20542
___
___
Roundup Robot added the comment:
New changeset f3f92d55f942 by Nick Coghlan in branch 'default':
Issue #20053: Mark as an expected failure for 3.4
http://hg.python.org/cpython/rev/f3f92d55f942
--
___
Python tracker rep...@bugs.python.org
Antoine Pitrou added the comment:
Modern operation systems have new functions like writev() to send to
consecutive buffers. Can't we use them, and emulate them if they are
missing (use 3.2 algorithm: join if small, or send separatly)?
What would the complication bring?
--
Changes by Nick Coghlan ncogh...@gmail.com:
--
resolution: - duplicate
status: open - closed
superseder: - Segfault in UTF-7 incremental decoder
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20542
Nick Coghlan added the comment:
Note that I added a skip for test_readline in issue 20542 before realising this
bug had already been filed.
--
keywords: +3.4regression, buildbot
nosy: +georg.brandl, larry, ncoghlan
priority: high - release blocker
Nick Coghlan added the comment:
The problem is that the assumption of assumption of an exists - open
equivalence is in pip's configuration file loading rather than in ensurepip or
venv - the idea was to pass in an existing but empty file to avoid needing a
change in pip to fix this.
However,
Nick Coghlan added the comment:
As per issue 1311, the exists returns True - stat will work equivalence is
deliberate. We'll have to find a different way to resolve issue 20053 on
Windows.
Due to the special files on Windows, the only reliable cross-platform way to
find out whether or not
Nick Coghlan added the comment:
(Note that the fix on the pip side may be something more direct like just
ignoring all config files and environment variables when ENSUREPIP_OPTIONS is
set, rather than changing the way it reads the config files)
--
Antoine Pitrou added the comment:
I also think OverflowError is better than MemoryError here.
--
nosy: +pitrou
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20539
___
Irvin Probst added the comment:
FWIW, according to your comments I tried a quick and dirty fix in my code as I
can't wait for a new Python release to make it work:
The do_stuff function now does:
def do_stuff():
client=make_client('',, bfoo)
data_proxy=client.get_proxy()
Wolfgang Maier added the comment:
Ok, I finally managed to get the test suite right for this, so here is the
patch diff for everything.
I made a few final changes to the module itself (mostly to please the test
suite), so I'll edited the complete code as well.
--
keywords: +patch
Gareth Rees added the comment:
It's not a case of internal storage overflowing. The error is from
Modules/mathmodule.c:1426 and it's the input 10**19 that's too large
to convert to a C long. You get the same kind of error in other
places where PyLong_AsLong or PyLong_AsInt is called on a
Roundup Robot added the comment:
New changeset 77082b818676 by R David Murray in branch 'default':
#20476: use EmailMessage as factory if non-compat32 policy is used.
http://hg.python.org/cpython/rev/77082b818676
--
nosy: +python-dev
___
Python
R. David Murray added the comment:
I'm leaving this open and changing the version to 3.5 to remind myself to fix
this right once default is open for 3.5 changes.
--
stage: commit review - needs patch
versions: +Python 3.5 -Python 3.4
___
Python
Guido van Rossum added the comment:
OK, this sounds like rounding up is important to avoid busy-wait (but maybe
only when rounding down would give us zero), and we shouldn't have to worry
about a courser timer, it will just make us late and that's always
acceptable.
On Fri, Feb 7, 2014 at 1:13
R. David Murray added the comment:
There being no objections, I have committed these. Now we'll see if Antoine or
someone corrects my google-translated French in post review...
--
resolution: - fixed
stage: commit review - committed/rejected
status: open - closed
STINNER Victor added the comment:
About Windows, it looks like select() and GetQueuedCompletionStatus() (poll
function the IocpProactor) round the timeout away from zero (the timeout is a
number of milliseconds, an integer).
Examples with GetQueuedCompletionStatus():
- 2 ms (timeout) = 15 ms
STINNER Victor added the comment:
If you want to keep the current approach, nothing prevents from using a
fixed slack value, independant of the selector (e.g. 1ms seems
reasonable).
select() and kqueue() are able to sleep less than 1 ms. Using a slack of 1 ms
would reduce the accuracy. I don't
Ethan Furman added the comment:
Because I didn't know how to make it work with 0 and 1. Thank you! I'll get
that in today.
--
stage: committed/rejected - patch review
status: closed - open
___
Python tracker rep...@bugs.python.org
R. David Murray added the comment:
What is returning a field dictionary containing None instead of an empty string?
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18857
___
STINNER Victor added the comment:
Let me state this last point once again: no busy loop can occur now that
timeouts are rounded up.
Agreed. The busy loop issue was solved by rounding the timeout away from zero
in select and selectors module.
Sure, some syscalls, on some OS, can sometimes
Roundup Robot added the comment:
New changeset 3b94a4ef244e by Victor Stinner in branch 'default':
Issue #20505: add debug info
http://hg.python.org/cpython/rev/3b94a4ef244e
--
nosy: +python-dev
___
Python tracker rep...@bugs.python.org
Stefan Krah added the comment:
Oscar Benjamin rep...@bugs.python.org wrote:
If you're going to use decimals though then you can trap inexact and
keep increasing the precision until it becomes exact.
For sums that is not necessary. Create a context with MAX_EMAX, MIN_EMIN and
MAX_PREC and
Changes by Mark Dickinson dicki...@gmail.com:
--
components: +Extension Modules
type: - behavior
versions: +Python 3.4
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20539
___
STINNER Victor added the comment:
OverflowError makes sense because math.factorial(10**19) will overflow in
CPython on common platforms, even if it didn't overflowed yet.
On a supercomputer with a different Python implementation, you may be able to
compute it.
IMO An OverflowError is
Joshua Johnston added the comment:
In this exact example it would be an empty string. It was a fake setup to
illustrate a real problem.
This is the important part:
params = dict(screen_name=None,count=300)
url = https://api.twitter.com/1.1/friends/ids.json?; + urllib.urlencode(params)
print
R. David Murray added the comment:
None of those problems exist if you correctly use the empty string to indicate
an empty string value instead of trying to use None.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18857
Eric Snow added the comment:
As per issue 1311, the exists returns True - stat will work equivalence
is deliberate. We'll have to find a different way to resolve issue 20053 on
Windows.
I was going t say we should note this design/impl. detail in the
os.path.exists() docs. However, it already
Changes by Wolfgang Maier wolfgang.ma...@biologie.uni-freiburg.de:
Added file: http://bugs.python.org/file33959/statistics.py
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20499
___
Zachary Ware added the comment:
New patch still gives an assertion failure at line 153 of typeobject.c when
trying to get __text_signature__ from anything that should have one (on
Windows, at least).
Python 3.4.0b3+ (default, Feb 7 2014, 11:43:04) [MSC v.1600 32 bit (Intel)] on
win32
Type
Changes by Serhiy Storchaka storch...@gmail.com:
--
stage: needs patch - patch review
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20538
___
___
Serhiy Storchaka added the comment:
Here are patches for 3.3 and 3.4 (this is 3.3+ only bug).
--
keywords: +patch
Added file: http://bugs.python.org/file33962/issue20538-3.3.patch
Added file: http://bugs.python.org/file33963/issue20538-3.4.patch
___
Donald Stufft added the comment:
I'm not sure I grasp what the problem is
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20053
___
___
Roundup Robot added the comment:
New changeset f942f1eddfea by R David Murray in branch 'default':
#20531: Revert e20f98a8ed71, the 3.4 version of the #19063 fix.
http://hg.python.org/cpython/rev/f942f1eddfea
New changeset ef8aaace85ca by R David Murray in branch 'default':
#20531: Apply the
Roundup Robot added the comment:
New changeset 4daf3cec9419 by R David Murray in branch '3.3':
#19063: the unicode-in-set_payload problem isn't getting fixed in 3.4.
http://hg.python.org/cpython/rev/4daf3cec9419
New changeset f942f1eddfea by R David Murray in branch 'default':
#20531: Revert
R. David Murray added the comment:
OK, backward compatibility is restored. Hopefully I can fix the underlying
problem right in 3.5 as part of issue 8489.
--
resolution: - fixed
stage: - committed/rejected
status: open - closed
type: - behavior
Wolfgang Maier added the comment:
In principle, your approach using itertools.groupby, the existing _sum, your
decimalsum, and my _ExactRatio class could be combined.
You could call decimalsum for Decimal and subclasses, the current _sum for
everything else.
_sum would return an _ExactRatio
STINNER Victor added the comment:
New changeset 3b94a4ef244e by Victor Stinner in branch 'default':
Issue #20505: add debug info
Some results.
AMD64 Windows7 SP1 3.x:
== Windows-7-6.1.7601-SP1 little-endian
SelectSelector.select(156.001 ms) took 156.000 ms (granularity=15.600 ms,
Jason R. Coombs added the comment:
Thanks David. I've confirmed the fix works (copying 'email' package over Python
3.4.0b3).
--
resolution: fixed -
stage: committed/rejected -
type: behavior -
___
Python tracker rep...@bugs.python.org
Serhiy Storchaka added the comment:
Thank you Ezio for your review.
--
resolution: - fixed
stage: patch review - committed/rejected
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20532
Mark Dickinson added the comment:
Okay; OverflowError seems to have the majority vote. I'll change it to that.
Any strong opinions on the message?
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20539
Antoine Pitrou added the comment:
Outrageously sounds like the argument is immoral, but do we have an objective
test for that? :-)
(nitpicking a bit: negative values should probably raise a proper ValueError,
no?)
--
___
Python tracker
Mark Dickinson added the comment:
nitpicking a bit: negative values should probably raise a proper ValueError,
no?
I think they do, with this patch. Or maybe I'm misunderstanding?
With the current form of the patch:
math.factorial(10**20)
Traceback (most recent call last):
File stdin,
Antoine Pitrou added the comment:
Ah, well, my bad. I just wanted to have a good argument :-)
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20539
___
Changes by R. David Murray rdmur...@bitdance.com:
--
resolution: - fixed
stage: - committed/rejected
type: - behavior
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20531
___
Paul Moore added the comment:
In ensurepip, _disable_pip_configuration_settings has the line:
os.environ['PIP_CONFIG_FILE'] = os.devnull
On Windows, os.devnull does not behave like a real file in that
os.path.exists(os.devnull) is False even though opening it works fine. So that
line of
R. David Murray added the comment:
This check has been reverted in issue 20531.
--
resolution: - fixed
stage: - committed/rejected
status: open - closed
superseder: - TypeError in e-mail.parser when non-ASCII is present
type: - behavior
___
Donald Stufft added the comment:
The proper fix is an isolated mode, but we could special case devnull in pip
for 1.5.3 and make a proper isolated solution in 1.6.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20053
New submission from Keith Randall:
1e200*1e200
inf
1e200**2
Traceback (most recent call last):
File stdin, line 1, in module
OverflowError: (34, 'Numerical result out of range')
Shouldn't floating-point operations overflow to inf, not generate exceptions?
--
components: Interpreter
Donald Stufft added the comment:
I'd remove it in 1.6 with a proper isolated mode. I'm purely thinking of
minimal changes to make it easier to to get it into 3.4.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20053
Mark Dickinson added the comment:
Shouldn't floating-point operations overflow to inf, not generate exceptions?
This has been discussed a few times before (I'll try to find the references).
But to answer you question: actually, no. I think they *should* generate
exceptions. That is, if I
Yury Selivanov added the comment:
Larry,
I'm attaching a revised version of the patch --
larry.even.newerer.signature.syntax.3.diff.
Changes:
1. test_signature_on_class_without_init was fixed,
inspect.signature was fixed as well. Now, for
class Meta(type): pass
inspect.signature(Meta)
Mark Dickinson added the comment:
Issue #3222 is related.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20543
___
___
Python-bugs-list mailing
Mark Dickinson added the comment:
And here's a link to the middle of a related discussion under the heading Turn
off ZeroDivisionError? on python-list, Feb 2008.
https://mail.python.org/pipermail/python-list/2008-February/473302.html
You'd have to read up- and down-thread to get the entire
Mark Dickinson added the comment:
See also #18570.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20543
___
___
Python-bugs-list mailing list
Changes by Serhiy Storchaka storch...@gmail.com:
--
status: open - pending
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20529
___
___
Antoine Pitrou added the comment:
Updated patch with the 3.2 heuristic for deciding when to concatenate.
--
keywords: +3.3regression -patch
priority: normal - high
stage: - patch review
Added file: http://bugs.python.org/file33967/multi_nagle_2.patch
Joshua Johnston added the comment:
If this was a function to encode a dict into something then I would see your
point and agree. urlencode is specifically designed to work within the domain
or URIs. In this domain, it is acceptable to have an empty value for a key in a
query string. None is a
Charles-François Natali added the comment:
select() and kqueue() are able to sleep less than 1 ms. Using a slack of
1 ms would reduce the accuracy. I don't see why we should limit the
accuracy. Why 1 ms? Because of poll/epoll? What about Windows and its
resolution of 15.6 ms?
Well, under 1
Ethan Furman added the comment:
Okay, I went with __reduce__ since we don't ever use the pickle protocol
information.
I added a test for class-nested Enums since protocol 4 supports it.
I left the test for test_subclasses_without_getnewargs alone as the point of
that test is to make sure
Roundup Robot added the comment:
New changeset a24f7d195b8f by R David Murray in branch 'default':
#20013: don't raise socket error when selected mailbox deleted.
http://hg.python.org/cpython/rev/a24f7d195b8f
--
nosy: +python-dev
___
Python tracker
R. David Murray added the comment:
While the copy solution seems reasonable, unfortunately it looks like the
solution isn't that simple.
Your test method didn't start with 'test_', so it didn't get run. Your fix
doesn't fix the problem, since other parts of the code are holding on to a
Ethan Furman added the comment:
I also removed the protocol 2 warning from the docs, and added this note:
.. note::
With pickle protocol version 4 it is possible to easily pickle enums
nested in other classes.
--
___
Python tracker
Charles-François Natali added the comment:
Updated patch with the 3.2 heuristic for deciding when to concatenate.
LGTM.
For posterity, a quick benchmark performing 100 trivial remote calls:
Before:
$ ./python ~/test_manager.py
8.202659845352173
After:
$ ./python ~/test_manager.py
R. David Murray added the comment:
No, the domain of URIs does not have *any* concept of a null value. It only
has the concept of a string being empty or not empty (or the key not existing
at all...ie: it doesn't exist in your params dict).
You are trying to map a Python concept (the
Roundup Robot added the comment:
New changeset 63f8ea0eeb6d by R David Murray in branch '3.3':
#17369: Improve handling of broken RFC2231 values in get_filename.
http://hg.python.org/cpython/rev/63f8ea0eeb6d
New changeset e0a90b1c4cdf by R David Murray in branch 'default':
Merge: #17369:
R. David Murray added the comment:
I've applied the first fix. I'll leave the issue open until I make the
equivalent fix for the new header parsing code.
--
stage: patch review - needs patch
versions: -Python 3.2
___
Python tracker
1 - 100 of 167 matches
Mail list logo