New submission from wchlm:
I observe the following in Python 2.6.1 in CentOS 5.9 and in Python 2.7.5 in
MacOS 10.9.2.
A heapified 3-element array containing elements in the order [low, high,
medium] fails to print in sorted order, as shown below:
import heapq
lista = [1, 6, 5, 4]
Wolfgang Maier added the comment:
I do not think this is a bug in the module, but rather incorrect usage.
From your own docs:
data should be an iterable of Real-valued numbers, with at least one
value. The optional argument mu, if given, should be the mean of
the data. If it is
Saimadhav Heblikar added the comment:
Hi,
I dont think its a bug.
The textbook definition of a min(or max) heap is
Heaps are binary trees for which every parent node has a value less than or
equal to any of its children.
Therefore,
when lista = [1,6,5,4], and heapify is run on it,it can be
wchlm added the comment:
Hi sahutd,
You may be right. I was keying off a stackoverflow example
(http://stackoverflow.com/questions/12373837/heapq-module-python) that might
have been misleading.
In fact, the Python documentation never does say what a printed heapified array
is suppose to
New submission from Adam Groszer:
In RawConfigParser the __name__ option handling is inconsistent:
RawConfigParser.options() and items() works hard to hide it, but has_options()
does not
--
components: Library (Lib)
messages: 215809
nosy: Adam.Groszer
priority: normal
severity: normal
New submission from Hervé Coatanhay:
With XCode 5.1 some changes were made to clang, making it impossible to build
Mac OS X installer.
Shipped SQLite and Sleepycat DB pass CFLAGS and LDFLAGS to compiler in their
compiler check in configure script.
In particular -syslibroot option is a linker
Hervé Coatanhay added the comment:
By the way it seems more like an SQLite / Sleepycat issue as LDFLAGS should be
passed to linker not compiler. Proposed modifications are just workarounds to
allow Mac installer creation on OS X 10.9.
--
___
Python
Nick Coghlan added the comment:
The default locale on Fedora is indeed UTF-8 these days - the problem is that
*users* are used to being able to use LANG=C to force the POSIX locale
(whether for testing purposes or other reasons), and that currently means
system utilities written in Python may
Roundup Robot added the comment:
New changeset 7ec8c4555772 by Mark Dickinson in branch '2.7':
Issue #21179: Fix description of 'round' function for numbers.Real.
http://hg.python.org/cpython/rev/7ec8c4555772
--
nosy: +python-dev
___
Python tracker
Mark Dickinson added the comment:
Yep, 2.7 does round-ties-away-from-zero. There's even special code for that:
the underlying machinery does a round-ties-to-even, and then there's a hack on
top of that to convert to round-ties-away-from-zero.
Looks like this error went unnoticed for quite a
STINNER Victor added the comment:
The default locale on Fedora is indeed UTF-8 these days - the problem is that
*users* are used to being able to use LANG=C to force the POSIX locale
(whether for testing purposes or other reasons), and that currently means
system utilities written in
Changes by Nathaniel Smith n...@pobox.com:
--
nosy: +njs
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21176
___
___
Python-bugs-list mailing list
Steven D'Aprano added the comment:
On Wed, Apr 09, 2014 at 08:20:42AM +, Wolfgang Maier wrote:
I do not think this is a bug in the module, but rather incorrect usage.
[...]
No, it is legitimate usage. See, for example, Numerical Recipes in
Pascal by Press et al. When you know the
Adam Groszer added the comment:
e.g.
myconfig.has_options(existing section, __name__)
is always True, whereas
myconfig.options(existing section)
never has a __name__ entry
--
___
Python tracker rep...@bugs.python.org
Changes by STINNER Victor victor.stin...@gmail.com:
--
nosy: +haypo
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21184
___
___
Python-bugs-list
New submission from LtWorf:
gcmodule.c lists a few reference links.
http://www.arctrix.com/nas/python/gc/
http://www.python.org/pipermail/python-dev/2000-March/003869.html
http://www.python.org/pipermail/python-dev/2000-March/004010.html
New submission from LtWorf:
This page
https://mail.python.org/mailman/listinfo/patches
suggests to go here: http://www.python.org/patches/ to know how to send
patches. However that page doesn't exist.
--
assignee: docs@python
components: Documentation
messages: 215819
nosy:
Wolfgang Maier added the comment:
ok, there may be use cases for calculating a variance estimate in such
situations, but IMHO what you are trying to do is to abuse a function which is
not documented to be made for the purpose and then complain that it does not
behave correctly.
The
New submission from Selena Deckelmann:
The page: https://github.com/python/cpython/blob/master/Doc/README.txt
Links to: http://docs.python.org/download/
Which is now a 404. A URL which may be correct is:
https://docs.python.org/3/download.html
I'm unsure what the org policy is on linking
Alex Gaynor added the comment:
It looks like https://docs.python.org/3/download.html (and I suppose the 2.x
variant) are the right URLs to use this.
--
nosy: +alex
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21190
Roundup Robot added the comment:
New changeset aec35c0d308b by Senthil Kumaran in branch '2.7':
issue #21190: Fix the docs README link
http://hg.python.org/cpython/rev/aec35c0d308b
New changeset df8f49f8cdd2 by Senthil Kumaran in branch '3.4':
issue #21190: Fix the broken docs download link
Senthil Kumaran added the comment:
Fixed this all active versions. Thanks for the report.
--
nosy: +orsenthil
resolution: - fixed
stage: - committed/rejected
status: open - closed
___
Python tracker rep...@bugs.python.org
Andreas Schwab added the comment:
The only problem is that under some conditions involving denormalized numbers
the result may lose a bit of precision. But that is mostly irrelevant for this
issue, at least it wouldn't make it worse than it is now.
--
Josiah Carlson added the comment:
Submitting an updated patch addressing Giampaolo's comments.
--
Added file: http://bugs.python.org/file34774/subprocess_2.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1191964
Changes by Ned Deily n...@acm.org:
--
assignee: ronaldoussoren - ned.deily
nosy: +ned.deily
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21187
___
Mark Dickinson added the comment:
under some conditions involving denormalized numbers the result may lose a
bit of precision
That sounds like a non-issue for this application: the dtoa.c computations are
careful to avoid subnormals in intermediate computations.
If mirabilos has withdrawn
Kushal Das added the comment:
Updated patch with discovering of currect locale and corresponding test case.
--
Added file: http://bugs.python.org/file34775/issue21169_v3.patch
___
Python tracker rep...@bugs.python.org
Kushal Das added the comment:
New patch with actual test case :)
--
Added file: http://bugs.python.org/file34776/issue21169_v4.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21169
___
Georg Brandl added the comment:
Barry, you run the list, so please change this to a link to bugs.python.org
(and maybe docs.python.org/devguide).
--
assignee: docs@python - barry
nosy: +barry, georg.brandl
___
Python tracker rep...@bugs.python.org
Ronald Oussoren added the comment:
This could be related to a problem described on this blog:
http://savanne.be/1035-benchmarking-on-osx-http-timeouts/
As such this appears to be a platform issue and not a python one.
--
___
Python tracker
New submission from Dima Tisnek:
os.fdopen() should either:
* consume file descriptor and return file/io object, or
* leave file descriptor alone and raise an exception
this invariant is broken in the following test case:
fd = os.open(/, os.O_RDONLY)
try:
obj = os.fdopen(fd, r)
except
Richard Oudkerk added the comment:
Can you explain why you write in 512 byte chunks. Writing in one chunk should
not cause a deadlock.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1191964
akira added the comment:
You need to escape backslashes inside a Python string literal or use raw-string
literals:
import json
json.loads(r'[[\Residential | Furniture | Cabinets\,\119.99\]]')
[u'[Residential | Furniture | Cabinets,119.99]']
If the backslashes are unintentional then
Benjamin Peterson added the comment:
I think this is just won't fix. I agree the behavior in 3.x is better, but at
least fdopen() is consistent about closing in 2.x, so you could work around it
by dupping the fd.
--
nosy: +benjamin.peterson
resolution: - wont fix
status: open -
Andrew Svetlov added the comment:
Looks like the issue has gone after 3.4
Anf it's still present for 2.7.
If somebody like to make a patch for 2.7 - you are welcome!
--
versions: -Python 3.3
___
Python tracker rep...@bugs.python.org
Dima Tisnek added the comment:
Benjamin, I think you missed the key point:
file + matching mode - fd eaten, object created
file + mode mismatch - fd remains, exception raised
dir + matching mode - fd eaten, exception raised
The issue is about resouce (fd) management
Thus, how can user code
Benjamin Peterson added the comment:
Ah, you're right. I misread the code.
--
resolution: wont fix -
status: closed - open
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21191
___
Changes by Ned Deily n...@acm.org:
--
components: +Library (Lib) -IO
resolution: - invalid
stage: - committed/rejected
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21182
Roundup Robot added the comment:
New changeset 4a3b455abf76 by Benjamin Peterson in branch '2.7':
make sure fdopen always closes the fd in error cases (closes #21191)
http://hg.python.org/cpython/rev/4a3b455abf76
--
nosy: +python-dev
resolution: - fixed
stage: - committed/rejected
Dima Tisnek added the comment:
I don't like proposed patch -- it changes semantics of more (?) common failure
modes.
I think it's best to keep semantics in line with Python 3.3 -- if fdopen fails,
it leaves file descriptor alone.
--
___
Python
Benjamin Peterson added the comment:
On Wed, Apr 9, 2014, at 12:48, Dima Tisnek wrote:
Dima Tisnek added the comment:
I don't like proposed patch -- it changes semantics of more (?) common
failure modes.
I don't know if opening the file with the wrong mode is any more wrong
than opening
Mark Dickinson added the comment:
Updated patch.
--
Added file: http://bugs.python.org/file34777/huge_factorial_input_v3.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20539
___
Maciej Szulik added the comment:
Sorry it took me that long - but I'm finally attaching fixed patch. I've also
checked it again current default branch and updated descriptions accordingly.
--
hgrepos: +232
Added file: http://bugs.python.org/file34778/issue1100942_20140409.patch
Changes by Mark Dickinson dicki...@gmail.com:
--
assignee: - mark.dickinson
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20539
___
___
Dima Tisnek added the comment:
Good point.
Personally I think it's more pythonic to consume fd only on success. I accept
that's just an opinion.
In any case, let's keep error semantics in py2.7 and py3.3 same.
--
___
Python tracker
Kristján Valur Jónsson added the comment:
Here we are. There were a lot of places where this was being incorrectly done.
And some places where this was being considered a recoverable error, which it
isn't because the source is freed.
Which sort of supports my opinion that this is bad
New submission from Terry J. Reedy:
Upon restarting the user process, Idle prints a separator bar in the shell:
== RESTART=
When restart is due to running a file with F5, print RUN filename instead of
RESTART. Idea from Adnan Umer,
Josh Rosenberg added the comment:
Mark, you said:
OverflowError seems to have the majority vote. I'll change it to that.
But your most recent patch seems to have gone back to ValueError for both
cases. Is there a reason for that? FWIW, I favor OverflowError as the too
large type, though I
Josh Rosenberg added the comment:
It's not really relevant what a heapified list looks like (and there is no
reason to guarantee a particular appearance, since it's an implementation
detail that could change). It's supposed to function as a heap with the heap
functions, that's all. The docs
Josh Rosenberg added the comment:
By the way, in the top answer to the Stack Overflow post you linked, it's clear
that the list wasn't sorted. [44, 42, 3, 89, 10] became [3, 10, 44, 89, 42],
and you'll notice, the last three elements are out of order.
--
Changes by Terry J. Reedy tjre...@udel.edu:
--
type: - enhancement
versions: +Python 2.7, Python 3.4, Python 3.5 -Python 3.3
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11838
___
wchlm added the comment:
All fair enough. I see the error of my ways. I am closing the case with a
Resolution of invalid. Thanks
--
resolution: - invalid
status: open - closed
___
Python tracker rep...@bugs.python.org
Benjamin Peterson added the comment:
On Wed, Apr 9, 2014, at 13:18, Dima Tisnek wrote:
Dima Tisnek added the comment:
Good point.
Personally I think it's more pythonic to consume fd only on success. I
accept that's just an opinion.
In any case, let's keep error semantics in py2.7
Mark Dickinson added the comment:
Josh: well spotted; thanks for picking up on this. I was wondering whether
anyone would pick up on that, and I should have mentioned the change explicitly.
I do think ValueError is the correct exception here. My interpretation of
OverflowError is that it
Aaron Meurer added the comment:
The docs could be much more clear about this in my opinion.
--
nosy: +Aaron.Meurer
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20010
___
Roundup Robot added the comment:
New changeset 88572ccb8ebe by Ned Deily in branch '2.7':
Issue #20644: Keep build-installer.py in sync across active versions.
http://hg.python.org/cpython/rev/88572ccb8ebe
New changeset e0722b5b9412 by Ned Deily in branch '3.4':
Issue #20644: Keep
Roundup Robot added the comment:
New changeset 63a55ed6622b by Ned Deily in branch '2.7':
Issue #21187: Fix OS X installer fail-to-build with Xcode 5.1.
http://hg.python.org/cpython/rev/63a55ed6622b
New changeset a3299de5fc93 by Ned Deily in branch '3.4':
Issue #21187: Fix OS X installer
Ned Deily added the comment:
Thanks for the report. It should work OK now.
--
components: +Build
resolution: - fixed
stage: - committed/rejected
status: open - closed
title: 2.7 build-installer.py with OS X 10.9 - build-installer.py fails using
Xcode 5.1 on OS X 10.9
versions:
Josh Rosenberg added the comment:
I just think it's a little odd to make math.factorial uniquely sensitive to the
documented definition of OverflowError. Basically every one of the non-masking
PyLong_AsCType interfaces uses OverflowError for too large values.
In fact, all the functions which
paul j3 added the comment:
While 'argparse' is complex, its organization is quite different from
'itertools'. For most purposes there is one starting point:
parser = argparse.ArgumentParser(...)
Nearly everything else invokes a 'parser' method. Most complex and common is
Benjamin Peterson added the comment:
I should note the C level fdopen has the the 2.x semantics.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21191
___
New submission from Josh Rosenberg:
While checking the exceptions used to compare existing behavior while
investigating #20539, I noticed a weird behavior in pow() (implemented by
long_pow in longobject.c). If a 3rd argument (the modulus) is provided, and the
2nd argument (the exponent) is
Mark Dickinson added the comment:
Making math.factorial the exception would be violating the reasonable
expectation one might get from using similar functions.
Can you point to some examples of those similar functions? I can't think of
any obvious examples offhand.
--
Changes by Ned Deily n...@acm.org:
--
nosy: +mark.dickinson
versions: -Python 3.1, Python 3.2, Python 3.3
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21193
___
Josh Rosenberg added the comment:
A few examples (some are patently ridiculous, since the range of values anyone
would use ends long before you'd overflow a 32 bit integer, let alone a 64 bit
value on my build of Python, but bear with me:
datetime.datetime(2**64, 1, 2)
Traceback (most recent
Benjamin Peterson added the comment:
I think this patch is fairly straightforward, and I don't want it to rot, so
here we go...
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21176
___
Roundup Robot added the comment:
New changeset c553d8f72d65 by Benjamin Peterson in branch 'default':
PEP 465: a dedicated infix operator for matrix multiplication (closes #21176)
http://hg.python.org/cpython/rev/c553d8f72d65
--
nosy: +python-dev
resolution: - fixed
stage: needs patch
Josh Rosenberg added the comment:
Here's the trivial patch for code and the associated unit test (we were
actually testing that it raised TypeError specifically; it now raises
ValueError, and the unit test expects ValueError).
unit tests passed aside from test_io, but I'm pretty sure that's
Josh Rosenberg added the comment:
As I mentioned on another bug, I filled out and submitted the contributor
agreement form electronically earlier this week, it just hasn't propagated yet.
I'm fairly sure trained monkeys reading the description of this bug report
would produce the exact same
Changes by Adnan Umer adnanume...@gmail.com:
--
components: +IDLE
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21192
___
___
Python-bugs-list
70 matches
Mail list logo