[issue21185] heapq fails to print in sorted order for certain inputs

2014-04-09 Thread wchlm
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]

[issue21184] statistics.pvariance with known mean does not work as expected

2014-04-09 Thread Wolfgang Maier
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

[issue21185] heapq fails to print in sorted order for certain inputs

2014-04-09 Thread Saimadhav Heblikar
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

[issue21185] heapq fails to print in sorted order for certain inputs

2014-04-09 Thread wchlm
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

[issue21186] RawConfigParser __name__ option handling inconsistent

2014-04-09 Thread Adam Groszer
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

[issue21187] 2.7 build-installer.py with OS X 10.9

2014-04-09 Thread Hervé Coatanhay
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

[issue21187] 2.7 build-installer.py with OS X 10.9

2014-04-09 Thread Hervé Coatanhay
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

[issue19977] Use surrogateescape error handler for sys.stdin and sys.stdout on UNIX for the C locale

2014-04-09 Thread Nick Coghlan
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

[issue21179] Rounding half to even

2014-04-09 Thread Roundup Robot
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

[issue21179] Rounding half to even

2014-04-09 Thread Mark Dickinson
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

[issue19977] Use surrogateescape error handler for sys.stdin and sys.stdout on UNIX for the C locale

2014-04-09 Thread STINNER Victor
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

[issue21176] Implement matrix multiplication operator (PEP 465)

2014-04-09 Thread Nathaniel Smith
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

[issue21184] statistics.pvariance with known mean does not work as expected

2014-04-09 Thread Steven D'Aprano
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

[issue21186] RawConfigParser __name__ option handling inconsistent

2014-04-09 Thread Adam Groszer
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

[issue21184] statistics.pvariance with known mean does not work as expected

2014-04-09 Thread STINNER Victor
Changes by STINNER Victor victor.stin...@gmail.com: -- nosy: +haypo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21184 ___ ___ Python-bugs-list

[issue21188] Broken link

2014-04-09 Thread LtWorf
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

[issue21189] Broken link to patch

2014-04-09 Thread LtWorf
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:

[issue21184] statistics.pvariance with known mean does not work as expected

2014-04-09 Thread Wolfgang Maier
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

[issue21190] Broken download link on README for CPython docs

2014-04-09 Thread Selena Deckelmann
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

[issue21190] Broken download link on README for CPython docs

2014-04-09 Thread Alex Gaynor
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

[issue21190] Broken download link on README for CPython docs

2014-04-09 Thread Roundup Robot
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

[issue21190] Broken download link on README for CPython docs

2014-04-09 Thread Senthil Kumaran
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

[issue20904] HAVE_PY_SET_53BIT_PRECISION for m68k

2014-04-09 Thread Andreas Schwab
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. --

[issue1191964] asynchronous Subprocess

2014-04-09 Thread Josiah Carlson
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

[issue21187] 2.7 build-installer.py with OS X 10.9

2014-04-09 Thread Ned Deily
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 ___

[issue20904] HAVE_PY_SET_53BIT_PRECISION for m68k

2014-04-09 Thread Mark Dickinson
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

[issue21169] getpass.getpass() fails with non-ASCII characters in prompt

2014-04-09 Thread Kushal Das
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

[issue21169] getpass.getpass() fails with non-ASCII characters in prompt

2014-04-09 Thread Kushal Das
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 ___

[issue21189] Broken link to patch

2014-04-09 Thread Georg Brandl
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

[issue21035] Python's HTTP server implementations hangs after 16.343 requests on MacOSX

2014-04-09 Thread Ronald Oussoren
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

[issue21191] os.fdopen() may eat file descriptor and still raise exception

2014-04-09 Thread Dima Tisnek
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

[issue1191964] asynchronous Subprocess

2014-04-09 Thread Richard Oudkerk
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

[issue21182] json.loads errors out on valid JSON

2014-04-09 Thread akira
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

[issue21191] os.fdopen() may eat file descriptor and still raise exception

2014-04-09 Thread Benjamin Peterson
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 -

[issue20434] Process crashes if not enough memory to import module

2014-04-09 Thread Andrew Svetlov
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

[issue21191] os.fdopen() may eat file descriptor and still raise exception

2014-04-09 Thread Dima Tisnek
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

[issue21191] os.fdopen() may eat file descriptor and still raise exception

2014-04-09 Thread Benjamin Peterson
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 ___

[issue21182] json.loads errors out on valid JSON

2014-04-09 Thread Ned Deily
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

[issue21191] os.fdopen() may eat file descriptor and still raise exception

2014-04-09 Thread Roundup Robot
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

[issue21191] os.fdopen() may eat file descriptor and still raise exception

2014-04-09 Thread Dima Tisnek
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

[issue21191] os.fdopen() may eat file descriptor and still raise exception

2014-04-09 Thread Benjamin Peterson
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

[issue20539] math.factorial may throw OverflowError

2014-04-09 Thread Mark Dickinson
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 ___

[issue1100942] Add datetime.time.strptime and datetime.date.strptime

2014-04-09 Thread Maciej Szulik
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

[issue20539] math.factorial may throw OverflowError

2014-04-09 Thread Mark Dickinson
Changes by Mark Dickinson dicki...@gmail.com: -- assignee: - mark.dickinson ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20539 ___ ___

[issue21191] os.fdopen() may eat file descriptor and still raise exception

2014-04-09 Thread Dima Tisnek
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

[issue20434] Process crashes if not enough memory to import module

2014-04-09 Thread Kristján Valur Jónsson
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

[issue21192] Idle: Print filename when running a file from editor

2014-04-09 Thread Terry J. Reedy
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,

[issue20539] math.factorial may throw OverflowError

2014-04-09 Thread Josh Rosenberg
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

[issue21185] heapq fails to print in sorted order for certain inputs

2014-04-09 Thread Josh Rosenberg
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

[issue21185] heapq fails to print in sorted order for certain inputs

2014-04-09 Thread Josh Rosenberg
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. --

[issue11838] IDLE: make interactive code savable as a runnable script

2014-04-09 Thread Terry J. Reedy
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 ___

[issue21185] heapq fails to print in sorted order for certain inputs

2014-04-09 Thread wchlm
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

[issue21191] os.fdopen() may eat file descriptor and still raise exception

2014-04-09 Thread Benjamin Peterson
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

[issue20539] math.factorial may throw OverflowError

2014-04-09 Thread Mark Dickinson
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

[issue20010] time.strftime('%z') didn't make +HHMM return in windows xp

2014-04-09 Thread Aaron Meurer
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 ___

[issue20644] OS X installer build broken by changes to documentation build

2014-04-09 Thread Roundup Robot
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

[issue21187] 2.7 build-installer.py with OS X 10.9

2014-04-09 Thread Roundup Robot
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

[issue21187] build-installer.py fails using Xcode 5.1 on OS X 10.9

2014-04-09 Thread Ned Deily
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:

[issue20539] math.factorial may throw OverflowError

2014-04-09 Thread Josh Rosenberg
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

[issue21150] Add quick links table to argparse docs

2014-04-09 Thread paul j3
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

[issue21191] os.fdopen() may eat file descriptor and still raise exception

2014-04-09 Thread Benjamin Peterson
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 ___

[issue21193] pow(a, b, c) should not raise TypeError when b is negative and c is provided

2014-04-09 Thread Josh Rosenberg
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

[issue20539] math.factorial may throw OverflowError

2014-04-09 Thread Mark Dickinson
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. --

[issue21193] pow(a, b, c) should not raise TypeError when b is negative and c is provided

2014-04-09 Thread Ned Deily
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 ___

[issue20539] math.factorial may throw OverflowError

2014-04-09 Thread Josh Rosenberg
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

[issue21176] Implement matrix multiplication operator (PEP 465)

2014-04-09 Thread Benjamin Peterson
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 ___

[issue21176] Implement matrix multiplication operator (PEP 465)

2014-04-09 Thread Roundup Robot
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

[issue21193] pow(a, b, c) should not raise TypeError when b is negative and c is provided

2014-04-09 Thread Josh Rosenberg
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

[issue21193] pow(a, b, c) should not raise TypeError when b is negative and c is provided

2014-04-09 Thread Josh Rosenberg
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

[issue21192] Idle: Print filename when running a file from editor

2014-04-09 Thread Adnan Umer
Changes by Adnan Umer adnanume...@gmail.com: -- components: +IDLE ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21192 ___ ___ Python-bugs-list