New submission from Serhiy Storchaka:
There is a leak of fetched exception in _PyTraceback_Add()
(Python/traceback.c:146).
--
messages: 239319
nosy: georg.brandl, haypo, serhiy.storchaka
priority: normal
severity: normal
status: open
title: Leak in _PyTraceback_Add
type: resource usage
Boštjan Mejak (Pikec) added the comment:
Using Python 3.4.3 on Windows 7 Home Premium 64 bit, Service Pack 1:
import os
os.path.join([1, 2, 3])
Traceback (most recent call last):
File stdin, line 1, in module
File C:\Program Files\Python 3.4\lib\ntpath.py, line 108, in join
Roundup Robot added the comment:
New changeset b742c1c5c0bf by Victor Stinner in branch 'default':
PEP 490: add issue 18408
https://hg.python.org/peps/rev/b742c1c5c0bf
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18408
STINNER Victor added the comment:
FIY I'm working on a draft of new PEP to chain exceptions at C level: PEP 490.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23781
___
New submission from Serhiy Storchaka:
Proposed patch adds internal private function _PyErr_ReplaceException() in 2.7.
This functions is like _PyErr_ChainExceptions() in 3.x, but doesn't set the
context. It makes the code of 2.x simpler and more similar to 3.x and makes the
backporting from
Changes by Boštjan Mejak bostjan.xpe...@gmail.com:
--
versions: +Python 3.5
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23780
___
___
STINNER Victor added the comment:
If a new exception is raised by _PyTraceback_Add(), the original exception is
lost. It's sad because _PyTraceback_Add() is supposed to enhance the current
exception, not to drop it.
In the draft of my PEP 490, I propose to chain the two exceptions.
Martin Panter added the comment:
The current behaviour when no scheme is present is fairly sensible to me and
should not be changed to do string concatenation nor raise an exception:
urljoin(//netloc/old/path, new/path)
'//netloc/old/new/path'
I am posting urljoin-non-hier.patch as an
New submission from David Marks:
On 432 in tokenize.py there is an assignment
_builtin_open = open
Followed in 434 with a redefinition of open
def open(filename):
If the module is reloaded, _builtin_open gets reassigned to the new function
and subsequent calls to _builtin_open fail.
New submission from Serhiy Storchaka:
If restore_error == 1 in PyObject_ClearWeakRefs() (Objects/weakrefobject.c:883)
and PyTuple_New() fails in Objects/weakrefobject.c:923, PyErr_Fetch is called
twice and both exceptions leak.
--
components: Extension Modules
messages: 239320
nosy:
Serhiy Storchaka added the comment:
Fixed in issue23615.
--
nosy: +serhiy.storchaka
resolution: - out of date
stage: - resolved
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23784
Masayuki Yamamoto added the comment:
similar issue #23338: PyErr_Format in ctypes uses invalid parameter
--
nosy: +masamoto
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23663
___
Serhiy Storchaka added the comment:
Proposed patch should fix the issue.
--
keywords: +patch
stage: - patch review
versions: +Python 2.7, Python 3.4, Python 3.5
Added file: http://bugs.python.org/file38700/issue23783.patch
___
Python tracker
Changes by STINNER Victor victor.stin...@gmail.com:
--
resolution: out of date - fixed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23784
___
___
New submission from Serhiy Storchaka:
If an exception was raised in TextIOWrapper.tell() and then restoring state is
failed, original exception is lost and leaked.
--
components: Extension Modules
messages: 239327
nosy: benjamin.peterson, haypo, pitrou, serhiy.storchaka, stutzbach
David Macek added the comment:
Yeah, looks like exactly the same issue. Sorry for the duplicate.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23663
___
Changes by Serhiy Storchaka storch...@gmail.com:
--
keywords: +patch
Added file: http://bugs.python.org/file38699/issue23785.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23785
___
Serhiy Storchaka added the comment:
Proposed patch chain original exception to the exception raised by
setstate(saved_state). This matches the behavior of Python implementation.
--
stage: - patch review
___
Python tracker rep...@bugs.python.org
Ben Hoyt added the comment:
Victor, great work on pushing this out, especially with the modifying the
directories fix. (And thanks Serhiy for pushing on correctness here.)
Couple of comments/questions about your new os.walk() implementation.
1) The new implementation is more complex. Of
eryksun added the comment:
Emil,
Your example child process opens the file with only read sharing, which fails
with a sharing violation if some other process inherits the file handle with
write access. The `with` block only prevents this in a single-threaded
environment. When you spawn 10
STINNER Victor added the comment:
Could you please use a define like SIGINFO_HAS_SI_BAND?
Something like:
#if defined(HAVE_SIGINFO) !defined(__CYGWIN__)
/* Issue #21085: In Cygwin, siginfo_t does not have si_band field. */
# define SIGINFO_HAS_SI_BAND
#endif
And please generate patches
STINNER Victor added the comment:
A new failure test_subprocess.test_double_close_on_error:
http://buildbot.python.org/all/builders/x86%20Ubuntu%20Shared%203.x/builds/11411/steps/test/logs/stdio
---
Timeout (1:00:00)!
Thread 0x55aafdc0 (most recent call first):
File
Peter added the comment:
I went and recompiled with:
$ ./configure --prefix=/usr/local --enable-shared
--with-hash-algorithm=siphash24
But this crashed as well.
test_unaligned_buffers (test.test_hash.HashEqualityTestCase) ... Fatal Python
error: Bus error
Current thread 0x0001 (most
STINNER Victor added the comment:
In that case, May I edit configure script to generate the HAVE_* defines?
I'd like to add a statement to check the si_band to configure.ac.
Does Cygwin use configure? If yes, go for configure.
You can copy/paste my recent change for dirent.d_type field.
I
Masayuki Yamamoto added the comment:
Victor,
In that case, May I edit configure script to generate the HAVE_* defines?
I'd like to add a statement to check the si_band to configure.ac.
And please generate patches not the git format. Otherwise, Rietveld is unable
to generated the review
Serhiy Storchaka added the comment:
Siphash24 implementation is not designed to work on platforms that require
aligned access. But I'm surprised that fnv implementation crashes. I don't see
anything wrong. May be gcc needs some special options to produce correct
binaries on this platform?
STINNER Victor added the comment:
Is msg234811 the result of set_faster_copy_3.patch? If yes, I see no reason to
not apply the patch: the patch is short and looks always fast, and sometimes
*much* faster.
I just leaved a small comment on the review.
--
nosy: +haypo
STINNER Victor added the comment:
It is used in multiprocessing and this is not configurable.
Oh, it would be nice to switch to version 4 by default, or make it
configurable. I read that the version 4 is faster.
--
___
Python tracker
Antoine Pitrou added the comment:
Is it still work-in-progress or are you looking for a review?
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23529
___
Nikolaus Rath added the comment:
I believe Martin's patch (v8) is ready for a core committer review. At least I
can't find anything to criticize anymore :-).
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23529
New submission from Peter:
I compiled Python 3.4.3 on Solaris 11, and when I ran the regression test, I
get a core dump when the hash() function was being used. I went through the bug
database looking for something similar but couldn't find anything.
Tests like:
test_unaligned_buffers
Changes by Serhiy Storchaka storch...@gmail.com:
--
nosy: +christian.heimes, jcea
versions: +Python 3.5
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23786
___
Benjamin Peterson added the comment:
lgtm with a test
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23785
___
___
Python-bugs-list mailing list
Serhiy Storchaka added the comment:
It would be not easy to reproduce without special broken decoder.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23785
___
Benjamin Peterson added the comment:
How did you notice it, btw?
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23785
___
___
Python-bugs-list
STINNER Victor added the comment:
I'm sorry, I don't understand this issue. Could you please elaborate the use
case? Why do you want to support more error handlers? str.translate() calls
_PyUnicode_TranslateCharmap() with errors=ignore, it's not possible to choose
the error handler.
Many
Peter added the comment:
That's not a valid option on SPARC, (see
https://gcc.gnu.org/onlinedocs/gcc/SPARC-Options.html ) the flag is only
available on ARM it seems.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23786
Peter added the comment:
I've compiled Python 3.3.6 using the same options (./configure
--prefix=/usr/local --enable-shared) and build system and that passes almost
all the tests (test_uuid fails for an ignorable reason).
Specifically test_hash passes fully:
$
Changes by STINNER Victor victor.stin...@gmail.com:
--
nosy: +haypo
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23786
___
___
Python-bugs-list
Serhiy Storchaka added the comment:
Yes, 3.3 uses less efficient implementation.
Try to compile Python with gcc option -mno-unaligned-access.
--
nosy: +mark.dickinson
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23786
Josiah Carlson added the comment:
Non-blocking IO returning a None on no data currently available is new to me.
It is new to me simply because I don't recall it ever happening in Python 2.x
with any socket IO that I ever dealt with, and socket IO is my primary source
for non-blocking IO
Hammerite added the comment:
Here is a new patch. This version addresses several issues raised in review by
Ezio Melotti and Berker Peksag. Where I have not (yet) addressed an issue, I
have explained why not in my previous post.
I attempted to preview my changes to the documentation that are
STINNER Victor added the comment:
Serhiy Storchaka added the comment:
str.encode, bytes.decode and str.translate are unrelated to
UnicodeTranslateError. But str.transform could be.
Can you please give an example of Python code to show your change?
--
Roundup Robot added the comment:
New changeset b7c0137cccbe by Victor Stinner in branch 'default':
Issue #23648: Document the PEP 475 in the Porting to Python 3.5 section and
https://hg.python.org/cpython/rev/b7c0137cccbe
--
nosy: +python-dev
___
Christian Heimes added the comment:
I'm puzzled about the segfault. I'm pretty sure that I've compiled and tested
the code on big endian machines as well as a SPARC machines that doesn't allow
unaligned memory access. The FNV code copies the blocks to an aligned buffer to
prevent exactly this
Serhiy Storchaka added the comment:
Pickle is backward compatible and Python 2 usually is able to unpickle data
pickled by Python 3 with protocol 3. The patch doesn't break compatibility.
Current default protocol is 3 for compatibility with older Python 3 versions.
It is used in
Serhiy Storchaka added the comment:
str.encode, bytes.decode and str.translate are unrelated to
UnicodeTranslateError. But str.transform could be.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23676
Serhiy Storchaka added the comment:
issue18814
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23676
___
___
Python-bugs-list mailing list
STINNER Victor added the comment:
Only thing required to make this work is add u in front of the message so
it is unicode.
The warnings module works with non-ASCII characters if you only use bytes
strings. I'm not sure that we should enhance it to support the unicode type in
some fields,
Martin Panter added the comment:
If necessary, we can add a new non_relative list, rather than changing
non_hierarchical. The repository history shows that “non_hierarchical” was
updated with new schemes once or twice, but has never been used since it was
added to Python as “urlparse.py”.
STINNER Victor added the comment:
Hum, I don't know well the pickle module. Is it backward compatible? Should
Python 2 be able to unserialize data serialized by Python 3? If yes, can you
patch break this compatibility?
It is unclear to me if it makes sense to even modify protocols different
Serhiy Storchaka added the comment:
The problem is that the warnings module works with unicode message almost all
time except rare circumstances. So for sure this feature is used in many
programs and it works for authors and most of users. An exception can be
considered as a bug.
--
Martin Panter added the comment:
See also Issue 1191964, discussing inconsistencies and how to differentiate the
four non-blocking special results in a new API:
* read signals permanent EOF
* read signals no data temporarily available
* write signals a permanently broken pipe or connection
*
Martin Panter added the comment:
Yes, I think the special return value of None is only standard to the “io”
module, which was added in Python 2.6 and 3. And even there it is inconsistent.
For what it’s worth, don’t have strong opinions on the special non-blocking and
broken pipe cases, as
Emil Styrke added the comment:
I have experienced this issue with Python 2.7.8 and 2.7.9. It is almost the
same issue as the OP experiences as far as I can tell: spawn some Python
threads that each create a file, flush, fsync, close, then start a subprocess
which uses the file through the
Roundup Robot added the comment:
New changeset bf570ff87c60 by Serhiy Storchaka in branch 'default':
Issue #23776: Removed asserts from pprint.PrettyPrinter constructor.
https://hg.python.org/cpython/rev/bf570ff87c60
--
nosy: +python-dev
___
Python
Roundup Robot added the comment:
New changeset afc21da5935f by Serhiy Storchaka in branch 'default':
Issue #23775: pprint() of OrderedDict now outputs the same representation
https://hg.python.org/cpython/rev/afc21da5935f
--
nosy: +python-dev
___
Changes by Serhiy Storchaka storch...@gmail.com:
--
resolution: - fixed
stage: commit review - resolved
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23776
___
Changes by Serhiy Storchaka storch...@gmail.com:
--
versions: -Python 2.7, Python 3.4
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23776
___
___
Serhiy Storchaka added the comment:
Thank you for your review Berker.
--
resolution: - fixed
stage: commit review - resolved
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23775
Changes by Serhiy Storchaka storch...@gmail.com:
--
assignee: - serhiy.storchaka
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15133
___
___
Serhiy Storchaka added the comment:
What are your thoughts about the patch Terry?
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15133
___
___
Serhiy Storchaka added the comment:
Updated to the tip, added whatsnew entry and fixed the documentation.
What parts of this patch besides tests are worth to be applied to maintained
releases?
--
Added file: http://bugs.python.org/file38696/sax_character_stream_3.patch
Serhiy Storchaka added the comment:
Issue2175 has a patch that covers all three issues: issue1483, issue2174 and
issue2175. I hesitate what parts of the patch are worth to be applied to
maintained releases.
--
nosy: +serhiy.storchaka
___
Python
Serhiy Storchaka added the comment:
Ping.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22721
___
___
Python-bugs-list mailing list
New submission from Florian Bruhin:
I just accidentally passed a list (instead of unpacking it) to os.path.join. I
was surprised when it just returned the list unmodified:
os.path.join([1, 2, 3])
[1, 2, 3]
Looking at the source, it simply returns the first argument (path = a; ...;
return
Davin Potts added the comment:
Attaching patches for 3.5/default, 3.4, and 2.7 which update the documentation
on multiprocessing.Lock, RLock, Semaphore, and BoundedSemaphore to describe
their actual implemented behavior, replacing the existing, misleading claim
that they are clones of
Serhiy Storchaka added the comment:
Error message for ntpath is improved in 3.5.
import ntpath
ntpath.join([1, 2, 3])
Traceback (most recent call last):
File stdin, line 1, in module
File /home/serhiy/py/cpython/Lib/ntpath.py, line 111, in join
genericpath._check_arg_types('join',
R. David Murray added the comment:
No, I'm not going to write tests...my goal is to commit other people's patches,
and I haven't even found time for that lately. And like you, I'm not convinced
the fix is needed. There is one argument I can think of in favor, though:
currently code that
Changes by SpaceOne pyt...@florianbest.de:
--
nosy: +spaceone
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9698
___
___
Python-bugs-list mailing
Wolfgang Maier added the comment:
Decimal formatting intentionally differs from float formatting, see #23460.
I see. Thanks for the pointer. What about the missing zero in the exponent ?
--
___
Python tracker rep...@bugs.python.org
Changes by Davin Potts pyt...@discontinuity.net:
--
nosy: +rhettinger
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18620
___
___
Python-bugs-list
Masayuki Yamamoto added the comment:
I wrote improved patch to remove the 'si_band'. This patch modifies the
'n_in_sequence' to conform to the number of structure members.
And I tested manually for struct_siginfo. struct_siginfo objects builds well.
That's all for now.
$ python3.4.exe
Python
Demian Brecht added the comment:
The current behaviour when no scheme is present is fairly sensible to me and
should not be changed to do string concatenation nor raise an exception
Agreed. Defaulting to relative behaviour makes sense as I imagine that'll be
the general use case.
I
Serhiy Storchaka added the comment:
Just reading the code that uses PyErr_Restore(). I found 3 issues and may be
the fourth in sqlite (it is more complicate than other 3).
--
___
Python tracker rep...@bugs.python.org
Stefan Krah added the comment:
The zero isn't missing. :) We are following
http://speleotrove.com/decimal/decarith.html, with thousands of test cases.
We could decide to do something special for g, but there are good reasons not
to do that.
--
R. David Murray added the comment:
Python's philosophy is one of duck typing, which means that in general we just
let the functions fail with whatever error they produce when the in put
datatype is wrong. The error message in this case is fairly straightforward:
you passed a list and it says
Stefan Krah added the comment:
Decimal formatting intentionally differs from float formatting, see #23460.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23602
___
Changes by Davin Potts pyt...@discontinuity.net:
--
nosy: +rhettinger
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23484
___
___
Python-bugs-list
Changes by R. David Murray rdmur...@bitdance.com:
--
resolution: fixed - duplicate
superseder: - Reloading tokenize breaks tokenize.open()
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23784
Changes by Davin Potts pyt...@discontinuity.net:
Added file: http://bugs.python.org/file38703/issue_23484_doc_locks_py27.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23484
___
Wolfgang Maier added the comment:
actually, I'm not sure whether formatting Decimals gives correct output under
all conditions (correctly rounded yes, but maybe not formatted correctly?).
compare:
format(float('1.481e-6'),'.3g')
'1.48e-06'
format(Decimal('1.481e-6'),'.3g')
'0.0148'
82 matches
Mail list logo