paul j3 added the comment:
One usage option is to make a subclass of HelpFormatter (the accepted way of
customizing a formatter), and write a function that formats each group
independently. For the example case, the resulting format might be:
usage: PROG [-h] [-b] [-a | -c] [-a | -d]
-h
New submission from Ivan Johansen:
In Python/importdl.c around line 99 in the function
_PyImport_LoadDynamicModule() you can find the code:
def = PyModule_GetDef(m);
def-m_base.m_init = p;
If the module m, which is returned from a newly imported extension, is not
created by
Raymond Hettinger added the comment:
After more thought, I'm changing this to Py3.4 only. For prior versions, I'm
content to document that there is no support for NotImplemented, and if that is
needed, then people should write-out all six rich comparisons without using the
total ordering
Raymond Hettinger added the comment:
I concur with Antoine. A list comprehension is the standard, obvious idiom for
making a list from repeated function calls.
Putting sampling without replacement in its own method makes the operation more
opaque than a plain list comprehension (which
Raymond Hettinger added the comment:
Closing for the reasons lists above.
--
resolution: - rejected
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11908
___
Changes by Raymond Hettinger raymond.hettin...@gmail.com:
--
resolution: - rejected
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18386
___
Raymond Hettinger added the comment:
Unassigning until another patch arrives that moves this forward.
The basic idea is well established: Get the structseq API to match the named
tuple API as much as possible.
--
assignee: rhettinger -
components: +Extension Modules -Interpreter
Raymond Hettinger added the comment:
I think this should be closed. AFAICT it is of interest to a very tiny subset
of the human species and as near as I can tell that subset doesn't include
people in the numeric and statistics community (the ones who actually use NaNs
as placeholders for
Sébastien Sablé added the comment:
This issue has been fixed as part of issue 941346 and should be closed in my
opinion.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6742
___
Roundup Robot added the comment:
New changeset 4343dfaca8e2 by Christian Heimes in branch '3.3':
Issue #18426: Fix NULL pointer dereference in C extension import when
http://hg.python.org/cpython/rev/4343dfaca8e2
New changeset 9fb3656b178a by Christian Heimes in branch 'default':
Issue #18426:
Christian Heimes added the comment:
I used a slightly different patch:
if (def == NULL)
goto error;
--
nosy: +christian.heimes
resolution: - fixed
stage: - committed/rejected
status: open - closed
versions: -Python 3.1, Python 3.2, Python 3.5
Amaury Forgeot d'Arc added the comment:
I'm not sure the fix is correct: PyModule_GetDef() can return NULL without
setting an error, for example when the init function returns a regular Python
module.
I'm OK to require the init function to return a module created with
PyModule_Create(), and
Changes by Amaury Forgeot d'Arc amaur...@gmail.com:
--
status: closed - open
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18426
___
___
New submission from Tobias Marschall:
Running the following two lines of code causes a segfault:
s = 'A' * 3142044943
t = s.replace('\n','')
My setup:
Python 2.7.5 (default, Jul 11 2013, 11:17:50)
[GCC 4.6.3] on linux2
Linux 3.2.0-45-generic #70-Ubuntu SMP Wed May 29 20:12:06 UTC 2013 x86_64
Christian Heimes added the comment:
In theory you are right. m-md_def could be NULL, too. But in practice it's
only going to happen when you have a faulty C extension. The code tries to load
a dynamic module (ELF shared library, Windows DLL, ...) with
_PyImport_GetDynLoadFunc() a couple of
Changes by Christian Heimes li...@cheimes.de:
--
assignee: - christian.heimes
resolution: fixed -
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18426
___
Changes by Serhiy Storchaka storch...@gmail.com:
--
nosy: +serhiy.storchaka
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18427
___
___
Amaury Forgeot d'Arc added the comment:
I was thinking of a message similar to the one above.
The eventual exception set by PyModule_GetDef(m) is less explicit.
if (def == NULL) {
PyErr_Format(PyExc_SystemError,
initialization of %s did not return an extension module,
Christian Heimes added the comment:
#0 memchr () at ../sysdeps/x86_64/memchr.S:155
#1 0x00467ca4 in countchar (maxcount=optimized out, c=10 '\n',
target_len=-1152922353, target=0x7fff3b196034 'A' repeats 200 times...)
at Objects/stringobject.c:2341
#2
Christian Heimes added the comment:
PS: The test case no longer segfaults with Py_ssize_t.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18427
___
Christian Heimes added the comment:
You have convinced me. It's not worth yet another API method.
--
resolution: - rejected
stage: patch review - committed/rejected
status: open - closed
___
Python tracker rep...@bugs.python.org
Ronald Oussoren added the comment:
I agree: target_len should have type Py_ssize_t.
It's probably worthwhile to check other functions as well.
--
nosy: +ronaldoussoren
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18427
Ronald Oussoren added the comment:
There is also this one in string_print:
fwrite(data, 1, (int)size, fp);
size is a Py_ssize_t variable with the length of the string, and is casted to
int which looses information. The exected argument to fwrite is size_t...
These two appear to be
Ronald Oussoren added the comment:
The attached patch should fix both issues (but doesn't contain a test, not sure
if its worthwhile to add a testcase that uses more than 4 GByte of memory)
FWIW: the corresponding code in Objects/bytesobject.c in the 3.3 and default
branches is already
Roundup Robot added the comment:
New changeset fce581643cb6 by Christian Heimes in branch '3.3':
Issue #18426: improve exception message. Courtesy of Amaury
http://hg.python.org/cpython/rev/fce581643cb6
New changeset 7a50d3c0aa61 by Christian Heimes in branch 'default':
Issue #18426: improve
Christian Heimes added the comment:
LGTM!
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18427
___
___
Python-bugs-list mailing list
Ronald Oussoren added the comment:
Great. I'll apply after running the full testsuite, and after rebooting my
machine as it doesn't really like using that much additional memory and pushed
some applications to disk :-(
--
___
Python tracker
Roundup Robot added the comment:
New changeset 2921f6c2009e by Ronald Oussoren in branch '2.7':
Issue #18427: str.replace could crash the interpreter with huge strings.
http://hg.python.org/cpython/rev/2921f6c2009e
--
nosy: +python-dev
___
Python
Changes by Ronald Oussoren ronaldousso...@mac.com:
--
resolution: - fixed
stage: patch review - committed/rejected
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18427
New submission from Mike:
Python used to run smoothly on my macbook, but since I opened the debugger
yesterday, the IDLE window cannot be opened anymore. It shows an error message
IDLE's subprocess didn't make connection.
I tried to uninstall everything and download it again from the
Nick Coghlan added the comment:
Agreed.
I had actually assumed this would be 3.4 only, otherwise I wouldn't have
suggested using the new subtest feature in the test case.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10042
Ivan Johansen added the comment:
If possible it would be nice if any module could be returned from a C
extension. Specifically I was trying to subclass module (PyModule_Type) and use
that.
But an error message is better than a crash.
--
___
Python
Changes by Serhiy Storchaka storch...@gmail.com:
--
nosy: +serhiy.storchaka
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17535
___
___
Amaury Forgeot d'Arc added the comment:
Returning another kind of module can be dangerous here, because extension
modules are handled specially (see _PyImport_FixupExtensionObject),
and it's not obvious what this does to normal modules.
But I agree that _imp.load_dynamic() could be extended to
Serhiy Storchaka added the comment:
Here is an updated patch. It includes a fix for OrderedDict.copy(). Counter's
copy() and __reduce__() are simplified. Added tests for OrderedDict which
checks that OrderedDict copying and pickling preserves dynamic attributes.
--
Added file:
Oscar Benjamin added the comment:
This optimisation is a semantic change. It breaks backward compatibility in
cases where a = a + b and a += b do not result in the name a having the same
value. In particular this breaks backward compatibility for numpy users.
Numpy arrays treat += differently
Ethan Furman added the comment:
So making this a speed-up for generic objects using __iadd__ is out.
The only question remaining is: is it worth special casing a few specific
objects (list, tuple, str) to optimise performance?
The str question has already been answered: it's special cased to
Roundup Robot added the comment:
New changeset 7e186bb1642c by Serhiy Storchaka in branch '2.7':
Issue #18336. Fix a link to StreamReader's read() method.
http://hg.python.org/cpython/rev/7e186bb1642c
New changeset 8dd67c20cab7 by Serhiy Storchaka in branch '3.3':
Issue #18336. Fix a link to
Serhiy Storchaka added the comment:
Actually it should be a link to the read() method.
--
resolution: - fixed
stage: needs patch - committed/rejected
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18336
Oscar Benjamin added the comment:
I'm attaching three new patches following on from Eric and Christian's
suggestions:
check_mno_cywin_py27_1.patch (for Python 2.7)
check_mno_cywin_py3_1.patch (for Python 3.2 and 3.3)
check_mno_cywin_py34_1.patch (for Python 3.4)
The py27 patch now uses
Changes by Serhiy Storchaka storch...@gmail.com:
--
resolution: - fixed
stage: needs patch - commit review
status: open - pending
versions: -Python 3.2
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5308
Roundup Robot added the comment:
New changeset 1cf2c42af815 by Serhiy Storchaka in branch '2.7':
Fix reference leaks introduced by the patch for issue #5308.
http://hg.python.org/cpython/rev/1cf2c42af815
New changeset 8b99f2224c3a by Serhiy Storchaka in branch '3.3':
Fix reference leaks
Roundup Robot added the comment:
New changeset af2416c2e27c by R David Murray in branch '3.3':
#17987: properly document support.captured_xxx.
http://hg.python.org/cpython/rev/af2416c2e27c
New changeset d0f7f1996001 by R David Murray in branch 'default':
Merge #17987: properly document
R. David Murray added the comment:
Thanks, Dmi.
--
nosy: +r.david.murray
resolution: - fixed
stage: needs patch - committed/rejected
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17987
Roundup Robot added the comment:
New changeset e6384b8b2325 by Serhiy Storchaka in branch 'default':
Issue #18338: `python --version` now prints version string to stdout, and
http://hg.python.org/cpython/rev/e6384b8b2325
--
nosy: +python-dev
___
Changes by Serhiy Storchaka storch...@gmail.com:
--
assignee: - serhiy.storchaka
resolution: - fixed
stage: patch review - committed/rejected
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18338
Roundup Robot added the comment:
New changeset f53cdd4e2689 by Serhiy Storchaka in branch '2.7':
Issue #18101: Tcl.split() now process Unicode strings nested in a tuple as it
http://hg.python.org/cpython/rev/f53cdd4e2689
New changeset 9486c07929a1 by Serhiy Storchaka in branch '3.3':
Issue
Changes by Serhiy Storchaka storch...@gmail.com:
--
resolution: - fixed
stage: patch review - committed/rejected
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18101
New submission from Todd Rovito:
While working on a test case for Format Paragraph
(http://bugs.python.org/issue18226) I noted that format paragraph doesn't work
with comment blocks when a comment block is selected. The fix is very simple
by changing one line:
if first and last:
data =
Changes by Todd Rovito rovit...@gmail.com:
--
keywords: +patch
nosy: +JayKrish, philwebster, roger.serwy, terry.reedy
Added file: http://bugs.python.org/file30891/18429FormatParagraphFor3.4.patch
___
Python tracker rep...@bugs.python.org
Madison May added the comment:
Patch for 3.4 added. I tried to keep things short and sweet.
--
Added file: http://bugs.python.org/file30892/Issue18389_3-4.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18389
Roundup Robot added the comment:
New changeset ffe24e3e7a2a by Serhiy Storchaka in branch '3.3':
Issue #18085: Add missed const modifier for some entries in refcounts.dat.
http://hg.python.org/cpython/rev/ffe24e3e7a2a
New changeset 6587fd3d89ae by Serhiy Storchaka in branch 'default':
Issue
Serhiy Storchaka added the comment:
If there are no objections I'm going to commit the patch soon.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17944
___
Madison May added the comment:
Patch using all single quotes for string literals, except for 3 cases of double
quoted strings that contain single quotes (I thought it was probably preferable
to escaping the single quotes).
--
keywords: +patch
nosy: +madison.may
Added file:
Madison May added the comment:
Patch using all double quotes. Take your pick :)
--
Added file: http://bugs.python.org/file30894/all_double_quotes.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18415
Roundup Robot added the comment:
New changeset fc7bab8a8618 by Serhiy Storchaka in branch '3.3':
Issue #17872: Fix a segfault in marshal.load() when input stream returns
http://hg.python.org/cpython/rev/fc7bab8a8618
New changeset 5fa793ae36cc by Serhiy Storchaka in branch 'default':
Issue
New submission from Nick Bargnesi:
Using existing file objects as arguments to the open functions in the gzip,
bz2, and lzma libraries can cause the underlying fileobj position to get
changed - and not quite in ways one would expect.
Calling peek against the returned file objects --
Changes by Serhiy Storchaka storch...@gmail.com:
--
resolution: - fixed
stage: patch review - commit review
status: open - pending
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17872
___
Brett Cannon added the comment:
I prefer single quotes (easier to type =) and yes, using double quotes instead
of escaping is preferred.
When I have a chance I will take a look at the patch.
--
stage: needs patch - commit review
___
Python tracker
Serhiy Storchaka added the comment:
I think NEWS entry for this issue should be in the Core and Builtins section.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18427
___
Serhiy Storchaka added the comment:
I guess this issue can't be fixed.
--
nosy: +nadeem.vawda, serhiy.storchaka
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18430
___
Roundup Robot added the comment:
New changeset 4acb822f4c43 by R David Murray in branch '3.3':
#18044: Fix parsing of encoded words of the form =?utf8?q?=XX...?=
http://hg.python.org/cpython/rev/4acb822f4c43
New changeset 32c6cfffbddd by R David Murray in branch 'default':
Merge: #18044: Fix
R. David Murray added the comment:
This is actually two separate bugs, both a bit embarrassing. The first one
(that I just fixed) is that when parsing an encoded word I was only checking
for decimal digits after an '=' (instead of the correct hex digits) when trying
to do robust detection of
Madison May added the comment:
Why would something like the following work?
#At the beginning of peek()
#keep track of prior offset
position = self.fileobj.tell()
#immediately before return statement
#restore previous fileobj offset
self.fileobj.seek(position)
--
nosy: +madison.may
Madison May added the comment:
*wouldn't
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18430
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from R. David Murray:
The subject says it all, but here is an example (from issue 18044):
msg = message_from_string('To: =?utf-8?q?Eric?= f...@example.com\n\n',
policy=default)
msg['To']
'=?utf-8?q?Eric?= f...@example.com'
--
components: email
messages:
R. David Murray added the comment:
The issue for the second bug is issue 18431.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18044
___
___
R. David Murray added the comment:
Regardless of whether or not it *can* be fixed, I personally would not expect
the file position to be either unchanged or predictable. The file object is
being passed to something that is going to read and/or write from it, after
all. If the calling
Zachary Ware added the comment:
No complaints here.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17944
___
___
Python-bugs-list mailing list
Roundup Robot added the comment:
New changeset 01a46dc00fc8 by Victor Stinner in branch 'default':
Issue #18408: slot_tp_str() must not fallback on slot_tp_repr() on error
http://hg.python.org/cpython/rev/01a46dc00fc8
--
___
Python tracker
Dmi Baranov added the comment:
Yeah, my first patch applied :) thanks, David
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17987
___
___
Nick Bargnesi added the comment:
In that the underlying file position is not deterministic when used like this,
I'm inclined to agree.
Though faced with documentation stating it does not advance the file
position, it certainly is less than explicit about it.
--
Ned Deily added the comment:
To help see what the problem is open a Terminal shell window and type:
cd $HOME
ls -l .idlerc/*
cat .idlerc/*
Then try typing:
/usr/local/bin/idle3.3
If that fails, try:
/usr/local/bin/idle3.3 -n
For all of the above, please update this issue with a copy and paste
R. David Murray added the comment:
Hmm, yes. Perhaps it should say does not advance the gzip read position?
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18430
___
Roundup Robot added the comment:
New changeset 39eb1ce5f377 by Victor Stinner in branch 'default':
Issue #18408: ste_new() initialize all attributes before handling error
http://hg.python.org/cpython/rev/39eb1ce5f377
New changeset aaa6e8b8a5c9 by Victor Stinner in branch 'default':
Issue
Zachary Ware added the comment:
I'm not sure that moving the tcltk output dir into PCbuild is the right way to
go about making different versions of Tcl/Tk available to different Python
versions. For one, because it's not true if you're working out of a single
checkout for multiple versions.
Björn Sandberg Lynch added the comment:
After thinking about it, I decided to defer instead of suppress line fetching.
Suppressing would still give a traceback later, but not the same as the
original.
extract_exception is where the meat is. There's a slight quirk in how context
works - if
Nick Bargnesi added the comment:
That's an improvement.
Using wording similar to the constructor's:
Calling a GzipFile object’s peek() method does not advance its position, but
the fileobj may be affected. The caller may wish to save the fileobj position
prior to calling peek() and resetting
Madison May added the comment:
Sounds good to me.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18430
___
___
Python-bugs-list mailing list
Terry J. Reedy added the comment:
Upon further review and tests, I notice that ._decode
* is a partial implementation of Text.index,
* so it should be renamed index and tested against Text.index,
* and it currently returns the wrong values for 'end' and high out-of-bounds
indexes.
Tests with
Roundup Robot added the comment:
New changeset 51eddca9dd6f by Victor Stinner in branch 'default':
Issue #18408: parsetok() must not write into stderr on memory allocation error
http://hg.python.org/cpython/rev/51eddca9dd6f
New changeset 5e50f1a0c985 by Victor Stinner in branch 'default':
Issue
Nick Bargnesi added the comment:
Proposed documentation change to gzip, bz2, and lzma modules, in patch form.
--
keywords: +patch
Added file: http://bugs.python.org/file30896/issue18430.patch
___
Python tracker rep...@bugs.python.org
Terry J. Reedy added the comment:
Whoops, I got that partly wrong in that index returns a 'r.c' string after
doing what _decode is supposed to do, which is to decode the input according to
the current text. The mock index should just return '%s.%s' %
_decode(position). There is still the
Phil Webster added the comment:
Thanks Terry, I will start PEP8-checking my code before I submit (as well as
testing more thoroughly). I was thinking the same thing about the logic behind
_decode and index functions needing to be combined.
How would you recommend adding functionality to the
Roundup Robot added the comment:
New changeset 4975bcd67aa7 by Victor Stinner in branch 'default':
Issue #18408: normalizestring() now raises MemoryError on memory allocation
failure
http://hg.python.org/cpython/rev/4975bcd67aa7
New changeset 1eac89af9acf by Victor Stinner in branch 'default':
Roundup Robot added the comment:
New changeset 89c6495d1ff2 by Victor Stinner in branch 'default':
Issue #18408: Fix parser.sequence2st() and parser.tuple2st(): raise MemoryError
http://hg.python.org/cpython/rev/89c6495d1ff2
New changeset c80a9705803a by Victor Stinner in branch 'default':
Changes by Christian Heimes li...@cheimes.de:
--
versions: +Python 3.4
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6926
___
___
Python-bugs-list
Sergey added the comment:
Steven D'Aprano noticed that there's an obscure case of:
class A(list):
... def __add__(self, other):
... return A(super(A,self).__add__(other))
... def __radd__(self, other):
... return A(other) + self
...
Where:
type( [1] + A([2]) )
class
Roundup Robot added the comment:
New changeset 60b1d7967ef8 by Victor Stinner in branch 'default':
Issue #18408: Fix create_extra() of _elementtree.c, raise MemoryError on memory
http://hg.python.org/cpython/rev/60b1d7967ef8
New changeset 1e0afd558ba3 by Victor Stinner in branch 'default':
Terry J. Reedy added the comment:
The real problem with 'end' and 'big.m' is that there are three proper
decodings, depending on the method asking. I think this patch mostly solves the
problems mentioned before. All tests, including many new ones, pass.
--
Added file:
90 matches
Mail list logo