Changes by Eric Snow ericsnowcurren...@gmail.com:
--
nosy: +eric.snow
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1475692
___
___
Francisco Martín Brugué added the comment:
Hi,
sorry if it's trivial but shouldn't we add a 'shifted_true' test
some were to make sure that this behavior change gets noticed next time?
def test_shifted_true(self):
self.assertEqual(True 0, 1)
self.assertEqual(True 1, 2)
--
Changes by Antoine Pitrou pit...@free.fr:
--
dependencies: +Allow IPNetwork to take a tuple
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21486
___
New submission from Antoine Pitrou:
Here is a patch to optimize ipv4 netmask parsing by maintaining a cache (there
are not many valid ipv4 netmask representations). This should be especially
useful with #16531.
--
components: Library (Lib)
files: v4_netmask.patch
keywords: patch
pmoody added the comment:
fine by me. this has been on my todo list forever by $payingjob and $family
have prevented me from devoting any time.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16531
Roundup Robot added the comment:
New changeset 4e33c343a264 by Antoine Pitrou in branch 'default':
Issue #16531: ipaddress.IPv4Network and ipaddress.IPv6Network now accept an
(address, netmask) tuple argument, so as to easily construct network objects
from existing addresses.
Antoine Pitrou added the comment:
Thanks for the approval, Peter!
--
resolution: - fixed
stage: patch review - resolved
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16531
R. David Murray added the comment:
Francisco: I'd say that was a good idea. Would you like to propose a patch?
(ie: figure out where it should go)
--
nosy: +r.david.murray
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21422
Antoine Pitrou added the comment:
Updated patch, also optimizing v6 netmask parsing (same principle).
Before patch:
$ ./python -m timeit -s import ipaddress net =
ipaddress.IPv6Network(('2001:db8::', 96))
1 loops, best of 3: 26.1 usec per loop
$ ./python -m timeit -s import ipaddress net
Arfrever Frehtes Taifersar Arahesis added the comment:
Use assertIs, since True == 1, but True is not 1.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21422
___
Charles-François Natali added the comment:
From a cursory inspection, we only check the size for regular files. What
exception are you seeing exactly?
What does stat return on this file?
--
___
Python tracker rep...@bugs.python.org
Joe Chan added the comment:
To prevent system crashes, I have to exclude msvc runtime library
$ diff -rupN cygwinccompiler.py.original cygwinccompiler.py
--- cygwinccompiler.py.original 2014-05-12 23:54:01.296303800 +0800
+++ cygwinccompiler.py 2014-05-13 02:59:37.870414900 +0800
@@ -341,7
Changes by Barry A. Warsaw ba...@python.org:
--
nosy: +barry
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7776
___
___
Python-bugs-list mailing
Changes by Berker Peksag berker.pek...@gmail.com:
--
nosy: +giampaolo.rodola, gvanrossum, haypo, pitrou, yselivanov
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21485
___
Charles-François Natali added the comment:
Scratch that.
I'll try to work on a patch that doesn't break guarantees for regular
files (we try to limit the possibilities of segfault).
--
___
Python tracker rep...@bugs.python.org
Antoine Pitrou added the comment:
Updated patch, a bit faster yet. After issue16531 is committed, it is now ~15x
faster than 3.4.
--
Added file: http://bugs.python.org/file35233/faster_collapse2.patch
___
Python tracker rep...@bugs.python.org
Donald Stufft added the comment:
Just an update, the issue is fixed in urllib3 and that has been pulled into
requests. Requests is currently prepping to release a new version which I'll
pull into pip and issue a pip 1.5.6 release which can be pulled into CPython
which should fix this.
Skip Montanaro added the comment:
Can this change be (easily) tested? If so, a test case akin to your original
example would be nice.
--
nosy: +skip.montanaro
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21469
New submission from Antoine Pitrou:
Now that issue #16531 has been committed, it becomes possible to make some
operations faster. Attached patch makes summarize_address_range() ~2x faster
and Network.subnets() ~4x faster.
--
components: Library (Lib)
files: ipaddr_perf.patch
keywords:
Roundup Robot added the comment:
New changeset ef49aaad3812 by Victor Stinner in branch '3.4':
Issue #21422: Add a test to check that bool int and bool int return an int
http://hg.python.org/cpython/rev/ef49aaad3812
New changeset 3da4aed1d18a by Victor Stinner in branch 'default':
(Merge 3.4)
STINNER Victor added the comment:
Ok, 3 core dev are opposed to the change, I close the issue.
I added a test on bool int and bool int to ensure that the result is an
int.
--
resolution: - rejected
status: open - closed
___
Python tracker
Changes by Ned Deily n...@acm.org:
--
nosy: +michael.foord
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21478
___
___
Python-bugs-list mailing
STINNER Victor added the comment:
My main motivation was to use calloc() (issue #21419) for 2**n. It looks like
using calloc() for this is only useful for very rare cases (very large value of
n: result larger than 1 MB). I close the issue.
--
resolution: - rejected
status: open -
STINNER Victor added the comment:
The optimization of 2**n looks to be only useful for very large value of n,
result larger than 1 MB. This use case is very rare, and you should probably
use another library (GMP, numpy, or something else) for such large numbers. I
close the issue.
--
Michael Foord added the comment:
Mock objects detect when another mock is added as a child, but they don't
currently detect that a function created by autospec has been added. It should
be a fairly easy fix.
--
assignee: - michael.foord
___
Python
Changes by Michael Foord mich...@voidspace.org.uk:
--
nosy: +kushal.das
stage: - needs patch
versions: +Python 3.5
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21478
___
Francisco Martín Brugué added the comment:
I Victor you were so fast, I started with one patch also in bool (at least the
place was right). The problem is that I was getting some extrage (for me at
least). As far I hat:
def test_shifted_true(self):
with
STINNER Victor added the comment:
What I was doing wrong?
The is operator should only be used to compare identical objects. Small
integers (range -5..255 if I remember correctly) are singletons. I prefer to
not rely on this implementation detail in a unit test of the Python standard
STINNER Victor added the comment:
For example, hCryptProv in Python/random.c is inheritable or not?
This is not a standard handle. GetHandleInformation() fails with a Windows
error 6 (invalid descriptor).
I listed inheritable handles with a loop on range(0, 0x1001): only handles of
stdin,
Roundup Robot added the comment:
New changeset c0404f0da01a by Victor Stinner in branch '3.4':
Issue #21485: remove unnecesary .flush() calls in the asyncio subprocess code
http://hg.python.org/cpython/rev/c0404f0da01a
New changeset 3c26389d741c by Victor Stinner in branch 'default':
(Merge
STINNER Victor added the comment:
I wrote the example and the first call to buffer.flush() is a mistake. Thanks
for your patch, I applied it.
--
resolution: - fixed
status: open - closed
___
Python tracker rep...@bugs.python.org
STINNER Victor added the comment:
MT is equidistributed. This a major point in its favor but also implies that
there are long stretches of uninteresting sequences. When we seed with only
a subset the state space, there is a risk of systematically landing in those
stretches.
What is an
STINNER Victor added the comment:
Py_MIN(SOMAXCONN, 128)
On Windows, it's not the best choice to use this hardcoded limit.
socket.SOMAXCONN is 2^31-1.
listen() documentation says that Windows chooses a reasonable backlog value for
you if you pass SOMAXCONN:
Tim Peters added the comment:
[haypo]
What is an uninteresting sequence? What are the problem of these
sequences?
A sequence that would greatly surprise a user. For example, if you generate
32-bit ints from the Twister in one obvious way, there are starting places
where you'll get 623
STINNER Victor added the comment:
A sequence that would greatly surprise a user.
No user complained past years. I don't think that we should worry so much,
because it looks like reading more data from /dev/urandom can be a more serious
and concrete issue.
--
R. David Murray added the comment:
Arfrever's advice was misleading...the test would have needed to be
assertIsNot(True 0, 1), but the fact that True is not preserved is not
really what we want to test. What we want to test is that the return value is
of type 'int', which is what Victor's
Tim Peters added the comment:
[haypo]
No user complained past years.
Raymond said We've previously had this problem with MT (since resolved, where
it is was landed in a very non-random zone). Do you believe he was wrong?
I don't think that we should worry so much, because it looks like
STINNER Victor added the comment:
An article suggests to use max(1024, socket.SOMAXCONN) (to listen() backlog as
large as possible) instead of socket.SOMAXCONN because the OS maximum can be
larger than SOMAXCONN (and that it's not possible in Python to get the OS
value):
Antoine Pitrou added the comment:
There is no useful theory that allows us to predict the
characteristics of the produced sequences from a set of possible
seeds, so limiting the set of possible seeds is potentially dangerous.
I still find it difficult to understand where is the said danger.
R. David Murray added the comment:
Arfrever pointed out on irc that I misread. It would indeed be assertIs(True
0, 1), but that wouldn't make a good test because the fact that '1 is 1' is
an implementation detail of CPython and can't be relied upon.
--
Changes by STINNER Victor victor.stin...@gmail.com:
--
nosy: +gvanrossum, haypo, yselivanov
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21437
___
Roundup Robot added the comment:
New changeset cee528d44b1e by Victor Stinner in branch '3.4':
Issue #21418: Fix a crash in the builtin function super() when called without
http://hg.python.org/cpython/rev/cee528d44b1e
New changeset 53cf343c4fff by Victor Stinner in branch 'default':
(Merge
STINNER Victor added the comment:
While embedding the Python interpreter in an application, I have encountered a
crash when the built-in function 'super' is invoked with no arguments.
This is not supported. When super() is invoked with no arguments, the class is
retrieved (indirectly) from
Changes by STINNER Victor victor.stin...@gmail.com:
--
resolution: - fixed
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21418
___
Tim Peters added the comment:
[pitrou]
I still find it difficult to understand where is the said danger.
The theoretical properties that make the Twister so attractive were all proved
based on mathematical analysis of its entire period. The only way to get at
the whole period is to allow
New submission from Brad Aylsworth:
The documentation page for codecs
(https://docs.python.org/2/library/codecs.html) shows keyword arguments for
codecs.encode and codecs.decode, but they throw an error if keyword arguments
are used. codecs.decode.__doc__ reports 'decode(obj,
STINNER Victor added the comment:
Can we now close this issue?
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21088
___
___
Python-bugs-list
Changes by Mark Nottingham m...@mnot.net:
--
nosy: +mnot
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21308
___
___
Python-bugs-list mailing list
Antoine Pitrou added the comment:
The theoretical properties that make the Twister so attractive were
all proved based on mathematical analysis of its entire period. The
only way to get at the whole period is to allow for all possible
seeds.
If the seeds Python can use are drawn from a
STINNER Victor added the comment:
With the development version (Python 3.5), I reproduce the crash when Python is
compiled in debug mode:
$ ./python astlinenotest.py
python: Python/compile.c:3975: assemble_lnotab: Assertion `d_lineno = 0'
failed.
Abandon (core dumped)
The problem is that
Tim Peters added the comment:
Thanks for the explanation. It's much clearer now.
Maybe, but it's also overblown - LOL ;-) That is, no matter what the starting
seed, the user will see a microscopically tiny span of the Twister's entire
period. So all those provably correct properties that
New submission from Matthew Fernandez:
Perhaps others wouldn't consider this a bug, but it was definitely surprising
to me. When switching between optimisation levels -OO (optimise and strip
docstrings) and -O (just optimise), you will find the docstrings are still
stripped. E.g.
$ ls
STINNER Victor added the comment:
Victor: sure; see attached.
Ok, so the error occurs when Python tries to import the _heapq dynamic module:
PyModule_Create2() calls PyThreadState_Get() to retrieve to current thread, but
it fails. There is a current thread because PyModule_Create2() is
Antoine Pitrou added the comment:
Not really intentional, it's just a limitation of the current implementation
(where the same .pyo files are used for both -O and -OO). Already reported as
issue1538778 (which was closed as won't fix).
--
nosy: +barry, pitrou
superseder: - pyo's are
Roundup Robot added the comment:
New changeset 89a29e92416f by Victor Stinner in branch '3.4':
Issue #21398: Fix an unicode error in the pydoc pager when the documentation
http://hg.python.org/cpython/rev/89a29e92416f
New changeset 3424d65ad5ce by Victor Stinner in branch 'default':
(Merge 3.4)
STINNER Victor added the comment:
I fixed the initial bug and so I close the issue.
Open a new issue if you have an idea to restore the terminal state when the
pager breaks the terminal. I don't think that it's possible to save/restore the
terminal state in a portable way.
--
Matthew Fernandez added the comment:
Ah thanks, Antoine. Sorry, failed to find that issue in my prior searching.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21489
___
Roundup Robot added the comment:
New changeset 7d20e30bd540 by Eric Snow in branch '3.4':
Issue #21226: Set all attrs in PyImport_ExecCodeModuleObject.
http://hg.python.org/cpython/rev/7d20e30bd540
New changeset bc324a49d0fc by Eric Snow in branch 'default':
Merge from 3.4 (for #21226).
Changes by Eric Snow ericsnowcurren...@gmail.com:
--
resolution: - fixed
stage: patch review - resolved
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21226
___
Changes by Boris Dayma koush...@gmail.com:
--
nosy: +Borisd13
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21436
___
___
Python-bugs-list mailing
Eric Snow added the comment:
FYI, __new__() is a staticmethod to accommodate subclassing. Several things
that happen at instantiation-time (when __new__() is called), including memory
allocation, are tied to the class that is passed in and may be different for
subclasses. For example:
STINNER Victor added the comment:
Attached py2_warn_cmp_bytes_text.patch adds BytesWarning for bytes == unicode,
bytes != unicode, unicode == bytes, unicode != bytes and similar comparisons
with bytearray. The new warnings are added when -b or -bb command line options
are used.
As a
STINNER Victor added the comment:
The title of the issue is python2 -3 does not warn about str/unicode to bytes
conversions and comparisons.
IMO it would be insane to emit BytesWarning on unicode(str). It would break
most code using unicode. six.u() function is based on this feature. For
paul j3 added the comment:
An alternative to passing a Formatter instance to the parser is to use a
wrapper function. `HelpFormatter.__init__` takes several keyword args.
'_get_formatter' does not use those. However we could define:
def format_wrapper(**kwargs):
# class
John Beck added the comment:
Victor:
* This is not a SPARC-specific issue; the exact same failure occurs
on x86.
* I had built Python 3.3 (some time ago) but only --without-pymalloc.
But I tried just now rebuilt Python 3.3 --with-pymalloc, and it
failed in the exact same way.
--
paul j3 added the comment:
An alternative to adding a 'ParagraphFormatter' class to 'argparse', is to
format the individual text blocks PRIOR to passing them to the 'parser', and
use the 'RawTextHelpFormatter'.
In the attached script I use a simple function that applies 'textwrap' to each
Changes by Raymond Hettinger raymond.hettin...@gmail.com:
--
assignee: rhettinger -
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16099
___
___
Alexey added the comment:
Please document this method.
I'm developing xmpp client using python 3.4 and it's ssl module. Stuck with
this same issue for a few days just because of a lack of documentation.
I'm asking you: why should I know about this method not from python
documentation, but
Raymond Hettinger added the comment:
Changes LGTM.
Thanks for the review :-)
This module could certainly use some cleanup and updates.
Yes, the API is a mess, but I would like to be very conservative with API
modifications (preferably none at all) so we don't break the code of very few
Charles-François Natali added the comment:
Tim, any idea why openssl, openssh Co get away with just 32 bytes of
seed read from /dev/urandom?
Is it because of a much smaller state space of the underlying CSPRNG?
--
___
Python tracker
Charles-François Natali added the comment:
Py_MIN(SOMAXCONN, 128)
On Windows, it's not the best choice to use this hardcoded limit.
socket.SOMAXCONN is 2^31-1.
I don't see what this would bring: 128 *is* a reasonable limit.
listen() documentation says that Windows chooses a reasonable
Roundup Robot added the comment:
New changeset 4ea86cd87f95 by Raymond Hettinger in branch '3.4':
Issue 21469: Mitigate risk of false positives with robotparser.
http://hg.python.org/cpython/rev/4ea86cd87f95
--
nosy: +python-dev
___
Python tracker
Roundup Robot added the comment:
New changeset f67cf5747a26 by Raymond Hettinger in branch '3.4':
Issue 21469: Add missing news item
http://hg.python.org/cpython/rev/f67cf5747a26
--
___
Python tracker rep...@bugs.python.org
Roundup Robot added the comment:
New changeset d4fd55278cec by Raymond Hettinger in branch '2.7':
Issue 21469: Mitigate risk of false positives with robotparser.
http://hg.python.org/cpython/rev/d4fd55278cec
--
___
Python tracker
Roundup Robot added the comment:
New changeset 560320c10564 by Raymond Hettinger in branch 'default':
Issue 21469: Minor code modernization (convert and/or expression to an if/else
expression).
http://hg.python.org/cpython/rev/560320c10564
--
___
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com:
--
nosy: +Arfrever
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21401
___
Changes by Raymond Hettinger raymond.hettin...@gmail.com:
--
resolution: - fixed
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21469
___
Bas Wijnen added the comment:
The documentation about non-blocking is clear enough, thank you for pointing it
out.
However, I would ask to write anything in there that contains the word
pending. The reason is that I didn't find anything in the documentation,
looked in the source, found the
101 - 178 of 178 matches
Mail list logo