New submission from Armin Rigo:
In Python 2, a buffered file opened for writing is flushed by the C library
when the process exit. In Python 3, the _pyio and _io modules don't do it
reliably. They rely on __del__ being called, which is not neccesarily the
case. The attached example ends
Serhiy Storchaka added the comment:
I were thinking about framing before looking at your last changes to PEP 3154
and I have two alternative propositions.
1. Pack picked items in blocks of some predefined (or specified at the start
with the BLOCKSIZE opcode) size. Only some large data (long
New submission from Ethan Furman:
In playing with metaclasses for the ongoing Enum saga, I tried having the
metaclass insert an object into the custom dict (aka namespace) returned by
__prepare__; this object has the same name as the to-be-created class.
An example:
class Season(Enum):
Changes by Serhiy Storchaka storch...@gmail.com:
--
superseder: - Add key argument to heapq functions
type: - enhancement
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4424
___
Serhiy Storchaka added the comment:
Related issues: issue4356, issue13742.
See also issue1185383, issue1904 and issue1162363.
--
nosy: +serhiy.storchaka
title: Priority Queue - Add a key parameter to PriorityQueue
type: behavior - enhancement
versions: -Python 3.3
Serhiy Storchaka added the comment:
See also rejected issue1162363.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17834
___
___
Ethan Furman added the comment:
One more data point to truly demonstrate that something is wrong:
-- def test():
... class Season(Enum):
... print(locals())
... Season = locals()['Season']
... print(locals())
...
-- test()
{'Season':
Changes by Daniel Urban urban.dani...@gmail.com:
--
nosy: +daniel.urban
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17853
___
___
Antoine Pitrou added the comment:
1. Pack picked items in blocks of some predefined (or specified at the
start with the BLOCKSIZE opcode) size. Only some large data (long
strings, large integers) can cross the boundary between blocks. In all
other cases the block should be padded with the
Antoine Pitrou added the comment:
Yes, this should probably be done the other way around: wrap the base64
argument in a memoryview, and encode/decode from it.
--
nosy: +pitrou
___
Python tracker rep...@bugs.python.org
Antoine Pitrou added the comment:
There are actually several issues here:
* collection of globals at shutdown is wonky: you should add an explicit del
a,f; gc.collect() at the end of the script
* order of tp_clear calls, or another issue with TextIOWrapper: if you open the
file in binary
New submission from Amit Saha:
The description of the symmetric difference operation implies that it cannot be
applied to more than two sets
(http://docs.python.org/3/library/stdtypes.html#set.symmetric_difference).
However, this is certainly possible:
s={1,2}
t={2,3}
u={3,4}
s^t^u
{1,
Amit Saha added the comment:
On some more thought, perhaps the description should be updated. Since s^t^u is
effectively (s^t)^u and hence the implementation does not violate the
definition.
--
___
Python tracker rep...@bugs.python.org
Georg Brandl added the comment:
Can you suggest a change? I don't see a problem here; giving multiple
operators for the other operations does not imply that they are not treated as
left-associative.
--
nosy: +georg.brandl
___
Python tracker
Amit Saha added the comment:
I think the only change I am suggesting is the description of the ^ operator to
be something like this:
set ^ other ^ ..
Return a new set with elements from the sets which are not present in more than
one set
I do understand that this is not really what the
Charles-François Natali added the comment:
Code relying on garbage collection/shutdown hook to flush files is borked:
- it's never been guaranteed by the Python specification (neither does
Java/C#...)
- even with an implementation based on C stdio streams, streams won't get
flushed in case of
New submission from Vinay Sajip:
Track implementation of logger hierarchy introspection as per
http://plumberjack.blogspot.co.uk/2012/04/introspecting-logger-hierarchy.html
--
assignee: vinay.sajip
components: Library (Lib)
messages: 187904
nosy: vinay.sajip
priority: normal
severity:
Berker Peksag added the comment:
Could you also propose places in the test to use this?
Sure.
- Lib/test/test_py_compile.py
- Lib/test/test_cmd_line.py
- Lib/test/test_faulthandler.py
- Lib/test/test_subprocess.py
- Lib/test/test_fileio.py
- Lib/test/test_io.py
- Lib/test/test_logging.py
-
Changes by Jeremy Kloth jeremy.kloth+python-trac...@gmail.com:
--
nosy: +jkloth
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17846
___
___
Mike Milkin added the comment:
Dave, let me know what you think of the tests, ill fix the rest of your
comments.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9682
___
Ramchandra Apte added the comment:
afaik they don't seem to be grammatical errors
subsequent attempts to acquire it block - block is the verb, don't see
anything wrong
similar example: the crowd blocks me. (present tense)
which one of the waiting threads proceeds is not defined, and may vary
Ramchandra Apte added the comment:
oops, should be the crowd blocks me
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17851
___
___
Andriy Mysyk added the comment:
Ramachandra, if I understand you correctly, I think what you are saying that
both are grammar mistakes and the first one could addressed by adding s to
block.
--
___
Python tracker rep...@bugs.python.org
Nick Coghlan added the comment:
This is only the second case I'm aware of where a particularly interesting
piece of functionality didn't get mentioned in the appropriate What's New doc.
For the other case, the zipfile execution support, we just added it in to the
2.6 What's New long after 2.6
Nick Coghlan added the comment:
As Serhiy and Antoine noted, what I had in mind here was to try to wrap the
input in a memoryview if it wasn't an instance of str, bytes or bytearray.
An existing memoryview will be passed back unmodified, while something like
array.array will provide a view
Georg Brandl added the comment:
I see no problem with both points: block is the correct verb form in this
context (attempts being plural), and the version including comma reads better
to me.
--
nosy: +georg.brandl
resolution: - works for me
status: open - closed
koobs added the comment:
After some sleuthing with Ezio (thank you for the help) and some amateur
debugging, all conditions in expanduser return the the home directory after
stripping trailing slashes.
The assertion in Lib/test/test_posixpath.py:264 compares expanduser(path) with
a path
Changes by Ezio Melotti ezio.melo...@gmail.com:
--
nosy: +ezio.melotti
type: - behavior
versions: -Python 3.2, Python 3.5
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17809
___
Changes by Vinay Sajip vinay_sa...@yahoo.co.uk:
--
hgrepos: +186
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17855
___
___
Python-bugs-list
Changes by Vinay Sajip vinay_sa...@yahoo.co.uk:
--
keywords: +patch
Added file: http://bugs.python.org/file30032/64df448c183d.diff
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17855
___
Vinay Sajip added the comment:
Added Brandon to nosy list, as his logging_tree is what set the ball rolling on
this one. Brandon, your comments on the patch would be very welcome.
--
nosy: +brandon-rhodes
stage: - patch review
___
Python tracker
Changes by Ezio Melotti ezio.melo...@gmail.com:
--
nosy: +eric.araujo, mark.dickinson
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17806
___
___
Ezio Melotti added the comment:
I tried a few different lines that result in a syntax error and the position of
the '^' always seems ok to me, so I'm not sure there's any bug here:
foo:bar
^
from import *
^
try:+
^
try+
^
1?
^
Changes by Ezio Melotti ezio.melo...@gmail.com:
--
nosy: +ezio.melotti
stage: needs patch - patch review
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17826
___
New submission from ProgVal:
In Python 3.3, multiprocessing.Process.join() is not blocking with floats lower
than 1.0 (not included). It works as expected (ie. blocking for the specified
timeout) in Python 2.6-3.2
As you can see in this example, calling join() with 0.99 returns immediately.
Changes by Ezio Melotti ezio.melo...@gmail.com:
--
keywords: +easy
nosy: +ezio.melotti
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17840
___
___
Changes by Ezio Melotti ezio.melo...@gmail.com:
--
keywords: +easy
nosy: +ezio.melotti
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17841
___
___
Charles-François Natali added the comment:
Thanks for the report, but it's a duplicate of #17707 (recently fixed).
--
nosy: +neologix
resolution: - duplicate
stage: - committed/rejected
status: open - closed
superseder: - Multiprocessing queue get method does not block for short
Serhiy Storchaka added the comment:
Padding makes it both less efficient and more annoying to handle, IMO.
Agree. But there is other application for NOPs. UTF-8 decoder (and some other
decoders) works more fast (up to 4x) when input is aligned. By adding several
NOPs before BINUNICODE so
Serhiy Storchaka added the comment:
Note that some functions use bytes/bytearray methods and an argument should
converted to bytes for them. Other functions use C functions which supports the
buffer protocol and do not required any conversion.
--
Serhiy Storchaka added the comment:
There is a regression. The result of getparams() was pickable, but now it is
not.
I have added other comments on Rietveld.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17818
Changes by Terry J. Reedy tjre...@udel.edu:
--
resolution: - works for me
status: open - closed
type: behavior - enhancement
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17825
___
New submission from Marc-Andre Lemburg:
This is essentially the same issue as http://bugs.python.org/issue14572.
The following addition in Python 2.7.4 (compared to 2.7.3) reintroduced the
same problem in a different place:
--- Python-2.7.3/Modules/_sqlite/util.h 2012-04-10 01:07:33.0
Marc-Andre Lemburg added the comment:
Adding the same people to the nosy list as on issue #14572.
--
nosy: +Joakim.Sernbrant, Marc.Abramowitz, dmalcolm, ned.deily, petri.lehtinen,
python-dev
type: - compile error
___
Python tracker
Armin Rigo added the comment:
It used to be a consistently reliable behavior in Python 2 (and we made it so
in PyPy too), provided of course that the process exits normally; but it no
longer is in Python 3. Well I can see the reasons for not flushing files, if
it's clearly documented
Terry J. Reedy added the comment:
Perhaps we should merely comment out the two blocks of text until we decide we
don't ever want a help button. If the expanded doc in progress had a marked
helpful doc on configure, the help button could open the doc to that section.
Guilherme, have you
Florent Xicluna added the comment:
Hello again,
actually, the attached script demonstrates some issues with the computation of
the offset.
In rare cases, the computed offset does not match the position of the caret '^'
in the traceback. It makes it difficult to reuse exc.offset to display
Florent Xicluna added the comment:
And this additional script (test_indenterror.py) demonstrates a different issue
in the traceback module.
--
Added file: http://bugs.python.org/file30034/test_indenterror.py
___
Python tracker rep...@bugs.python.org
Changes by Florent Xicluna florent.xicl...@gmail.com:
--
status: closed - open
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17825
___
___
Éric Araujo added the comment:
Where is the “Approve patch” button :)
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17806
___
___
Serhiy Storchaka added the comment:
Indeed, there is an inconsistence between the traceback module and builtin
exception print function. Behavior of traceback is intentional as noted in
format_exception_only() (if this comment is not misleading).
--
nosy: +georg.brandl,
Serhiy Storchaka added the comment:
Note that adding support of keyword arguments significant slowdown argument
parsing. Please measure time of the function call with and without the patch.
I object to add support for keyword arguments in a quick built-in functions.
Especially if it's the
Serhiy Storchaka added the comment:
The regression was introduced in issue17073.
--
nosy: +serhiy.storchaka
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17857
___
Changes by Marc-Andre Lemburg m...@egenix.com:
--
title: sqlite modules doesn't build on 2.7.4 with Mac OS X 10.4 - sqlite
modules doesn't build with 2.7.4 on Mac OS X 10.4
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17857
Serhiy Storchaka added the comment:
Here is a patch for 2.7. Please test. Should it be fixed on 3.x?
--
keywords: +patch
Added file: http://bugs.python.org/file30035/sqlite_int64.patch
___
Python tracker rep...@bugs.python.org
Florent Xicluna added the comment:
The proposed patch deals with the case of the IndentationError in the traceback
module.
--
keywords: +patch
resolution: works for me -
Added file: http://bugs.python.org/file30036/patch_indenterror_offset.diff
___
Changes by Florent Xicluna florent.xicl...@gmail.com:
Removed file: http://bugs.python.org/file30036/patch_indenterror_offset.diff
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17825
___
Changes by Florent Xicluna florent.xicl...@gmail.com:
Added file: http://bugs.python.org/file30037/patch_indenterror_offset.diff
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17825
___
Serhiy Storchaka added the comment:
Your diff file looks broken.
I'm not sure it's the traceback module should be fixed and not Python
internals. Georg, what you say?
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17825
Mark Dickinson added the comment:
Isn't this just a consequence of Python's usual name-lookup rules? In this
code:
def test():
class Season(Enum):
SPRING = Season()
the class definition in 'test' amounts to a local assignment to the name
'Season'. So the occurrence
Florent Xicluna added the comment:
The previous patch fixes some cases where the caret was wrongly positioned.
However, there's probably stuff to fix in Python internals too.
See attached test cases (test_traceback_caret.py) which demonstrates other
issues with non-ASCII chars or tab in the
Ethan Furman added the comment:
On 04/27/2013 02:01 PM, Mark Dickinson wrote:
Mark Dickinson added the comment:
Isn't this just a consequence of Python's usual name-lookup rules? In this
code:
def test():
class Season(Enum):
SPRING = Season()
the class
Ethan Furman added the comment:
I guess the question is:
Because Python can no longer know if the name has been inserted via __prepare__
it has to go through the whole CLOSURE
business, but will changing the LOAD_DEREF to a LOAD_GLOBAL (only for items
inside a class def) do the trick?
Ned Deily added the comment:
The patch does solve the build problem for 2.7 on 10.4 (Tiger). The same
problem exists for 3.3 and default as well. I see the Tiger buildbots aren't
failing with this problem; I suspect that's because there is a newer version of
libsqlite3 being supplied in
Éric Araujo added the comment:
Thanks for the report and patch. Could you add a test?
I’m not sure where this sits on the bug vs. feature line.
--
nosy: +eric.araujo, r.david.murray
___
Python tracker rep...@bugs.python.org
Marc-Andre Lemburg added the comment:
On 27.04.2013 22:27, Serhiy Storchaka wrote:
Serhiy Storchaka added the comment:
Here is a patch for 2.7. Please test. Should it be fixed on 3.x?
Thanks, Serhiy.
I can confirm that the patch fixes the problem with 2.7.4 on
Mac OS X (and probably
Jan Gosmann added the comment:
Could you point me to some documentation on how to add a test? I have not been
involved in Python development so far.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17396
Changes by Florent Xicluna florent.xicl...@gmail.com:
--
nosy: +flox
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17396
___
___
Python-bugs-list
R. David Murray added the comment:
I (as a native English speaker, FWIW) agree that the existing text is correct
insofar as the reported problems go. I, however, would remove the comma after
'block'. I don't know that it is wrong as written, but it reads strangely to
my ear.
--
STINNER Victor added the comment:
Advantages of the patch.
* finer control on how the buffer is allocated: only overallocate if the
replacement string (while handling an encoding error) is longer than 1
character. The replace error handler should never use overallocation for
example.
STINNER Victor added the comment:
Advantages of the patch.
* finer control on how the buffer is allocated: only overallocate if the
replacement string (while handling an encoding error) is longer than 1
byte/character. The replace error handler should never use overallocation for
example.
Changes by STINNER Victor victor.stin...@gmail.com:
--
Removed message: http://bugs.python.org/msg187943
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17742
___
New submission from Andriy Mysyk:
Use _thread.Lock.acquire() documentation for threading.Lock.acquire().
threading.Lock inherits acquire() method from _thread.Lock. The two acquire()
methods are identical in their functionality yet have different documentation.
Documentation for
Andriy Mysyk added the comment:
I am attaching a patch that applies _thread.Lock.acquire() documentation to the
functionally identical threading.Lock.acquire().
--
keywords: +patch
Added file: http://bugs.python.org/file30039/issue17858.patch
___
R. David Murray added the comment:
For the record, both the _thread docs and the threading docs for acquire were
updated in 01d1fd775d16 as part of issue 7316. Some at least of the
differences come from 6ab4128a (issue 14823). That makes it likely that
the threading docs are the better
Andriy Mysyk added the comment:
Issue 14823 indeed improved threading documentation. However, even with the
improvement threading documentation makes acquire() appear to be more complex
and harder to use than it actually is.
--
___
Python tracker
Changes by Chris Calloway c...@chriscalloway.org:
Removed file: http://bugs.python.org/file29758/issue-15518-1.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15518
___
Chris Calloway added the comment:
I'm uploading a new patch which gets rid of the temp_cwd calls as suggested in
the review. The patch is not complete in that the explanatory comments
suggested in the review and revising the pre-existing tests have not been
completed yet. However, I want to
Ben Darnell added the comment:
We found a related issue with Tornado:
https://github.com/facebook/tornado/pull/750
We call wrap_socket with do_handshake_on_connect=False and then call
do_handshake when the socket is ready. If the getpeername call in wrap_socket
fails with ENOTCONN because
Changes by Brett Cannon br...@python.org:
--
assignee: brett.cannon -
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16104
___
___
Changes by Brett Cannon br...@python.org:
--
dependencies: -xml.parsers.expat.(errors|model) don't set the __loader__
attribute
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17115
___
Ned Deily added the comment:
Marc-Andre, can you elaborate on why you think Python 3 is not affected? The
changes for Issue17073 also added sqlite3_int64 to 3.2, 3.3, and default and,
for me on 10.4, _sqlite3.so currently fails to build in all three. (I don't
think 3.2 is worth worrying
Roundup Robot added the comment:
New changeset 75e32a0bfd74 by Brett Cannon in branch '3.3':
Issue #17357: Use more stern wording for
http://hg.python.org/cpython/rev/75e32a0bfd74
New changeset 5fac0ac46f54 by Brett Cannon in branch 'default':
merge for issue #17357
Nick Coghlan added the comment:
Just to clarify, the problem here isn't to do with referencing the class name
in particular, it's referencing *any* lexically scoped name from the class
body, when a metaclass wants to inject that as variable name in the class
namespace. Here's a case where it
Brett Cannon added the comment:
http://hg.python.org/cpython/rev/75e32a0bfd74 and
http://hg.python.org/cpython/rev/5fac0ac46f54 have more stronger wording for
importlib.invalidate_caches(). What's New already says to call the function
without being wishy-washy, so I didn't touch it.
Brett Cannon added the comment:
And I have decided to not bother removing the stat check.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17330
___
Changes by Brett Cannon br...@python.org:
--
keywords: +easy
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15834
___
___
Python-bugs-list mailing
Brett Cannon added the comment:
Since lib3 now exists we should probably take advantage and just keep a
translated, patched copy of 2to3 there to avoid this problem while keeping
performance on an even keel for comparison.
--
___
Python tracker
Changes by Benjamin Peterson benja...@python.org:
--
nosy: +benjamin.peterson
versions: +Python 3.2, Python 3.3 -Python 3.4
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17853
___
Ethan Furman added the comment:
Perhaps you and Benjamin should discuss that. :)
I just read a thread on core-mentors about when a bug is fixed or not --
considering that the behavior is plain wrong,
that workarounds will still work even if the bug is fixed, why shouldn't we fix
it even in
Benjamin Peterson added the comment:
There's no need for a discussion; the answer is no.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17853
___
Nick Coghlan added the comment:
In this case, we won't fix it in a maintenance release because of the kind of
change required to eliminate the bug. Adding a new opcode is likely to be the
simplest fix and that is necessarily a backwards incompatible change (since
older versions won't
Éric Araujo added the comment:
Certainly: http://docs.python.org/devguide contains information to get the
source code, describes the files layout and explains how to generate a patch.
You’ll find existing unit tests in Lib/test/test_modulefinder.py
Feel free to ask any question you might
Éric Araujo added the comment:
I would recommend that you base your patch on the default branch, i.e. what
will become Python 3.4. If we judge that this is not a new feature but
actually a bug fix, the core developer who commits the patch will take care of
backporting it to 2.7 and 3.3.
Ned Deily added the comment:
Something that comes to mind: the stack traces in both issues show similar
crashes where Tk is calling into OS X AppKit to create or modify a window.
Since a left paren is being typed, it seems to me the most likely scenario is
that the left paren is completing a
Kushal Das added the comment:
Bytearray encoding and decoding
--
Added file: http://bugs.python.org/file30041/issue17842_v2.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17842
___
Changes by Catalin Patulea catal...@google.com:
--
nosy: +Catalin.Patulea
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15139
___
___
Ethan Furman added the comment:
Nick, thanks for the explanation.
Benjamin, I was referring to Nick taking 3.3 and 3.2 off the issue and leaving
3.4, and you reversing it. ;)
Sorry for the confusion -- I just reread my post and the words there didn't
match the ideas in my head at the time
98 matches
Mail list logo