[issue15502] Meta path finders and path entry finders are different, but share an ABC

2012-08-03 Thread Eric Snow
Eric Snow added the comment: This patch implements most of Brett's recommendation. I've held off on actually deprecating Finder just yet. However, it would probably entail a message in the docs like this: The API signatures for meta path finders and path entry finders were separated by PEP

[issue15540] Python 3.3 and numpy

2012-08-03 Thread Martin v . Löwis
Martin v. Löwis added the comment: This is a mis-understanding of what NumPy does and why.There is a need to byte-swap only when the data is stored on disk in the reverse order from the native machine So is there ever a need to byte-swap Unicode strings? I can see how *numeric* data

[issue15544] math.isnan fails with some Decimal NaNs

2012-08-03 Thread Mark Dickinson
Mark Dickinson added the comment: Yep, Decimal.__float__ isn't too sophisticated. Probably it should convert all Decimal quiet NaNs (at least) to float NaNs, keeping the sign if possible but discarding any payload. Not so sure about signaling NaNs, though; I think it would be fine for those

[issue15543] central documentation for 'universal newlines'

2012-08-03 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: See issue15204. -- nosy: +storchaka ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15543 ___ ___

[issue13992] Segfault in PyTrash_destroy_chain

2012-08-03 Thread Charles-François Natali
Charles-François Natali added the comment: (gdb) p op $12 = (PyObject *) 0x4dc7bc0 Don't you have GDB 7, to decode Python objects ? You can check the type of the object with : p op-ob_type.tp_name thread all apply bt is going to be very long no ? Could you tell me what you want to know

[issue15545] sqlite3.Connection.iterdump() does not work with row_factory = sqlite3.Row

2012-08-03 Thread Pierre Le Marre
Changes by Pierre Le Marre lema...@eifer.org: -- components: None nosy: plemarre priority: normal severity: normal status: open title: sqlite3.Connection.iterdump() does not work with row_factory = sqlite3.Row type: crash versions: Python 3.2 ___

[issue15545] sqlite3.Connection.iterdump() does not work with row_factory = sqlite3.Row

2012-08-03 Thread Martin v . Löwis
New submission from Martin v. Löwis: Can you please elaborate? Structure your report as follows: 1. this is what I did 2. this is what happened 3. this is what should have happened instead. -- nosy: +loewis ___ Python tracker rep...@bugs.python.org

[issue15204] Deprecate the 'U' open mode

2012-08-03 Thread Chris Jerdonek
Changes by Chris Jerdonek chris.jerdo...@gmail.com: -- nosy: +cjerdonek ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15204 ___ ___

[issue15545] sqlite3.Connection.iterdump() does not work with row_factory = sqlite3.Row

2012-08-03 Thread Pierre Le Marre
Pierre Le Marre added the comment: I use Python 3.2.3 on GNU/Linux 64bits (openSUSE 12.2). I have created an in-memory connection with the following code: conn = sqlite3.connect(:memory:, detect_types=sqlite3.PARSE_DECLTYPES, check_same_thread=False) conn.row_factory = sqlite3.Row Then I have

[issue15543] central documentation for 'universal newlines'

2012-08-03 Thread Chris Jerdonek
Chris Jerdonek added the comment: Since universal newline mode is discouraged and getting deprecated in the built-in open() function, the central place for describing universal newlines should probably not be the documentation for the open() method. I am leaning towards a glossary entry.

[issue15546] Iteration breaks with bz2.open(filename,'rt')

2012-08-03 Thread David Beazley
New submission from David Beazley: The bz2 library in Python3.3b1 doesn't support iteration for text-mode properly. Example: f = bz2.open('access-log-0108.bz2') next(f) # Works b'140.180.132.213 - - [24/Feb/2008:00:08:59 -0600] GET /ply/ply.html HTTP/1.1 200 97238\n' g =

[issue15544] math.isnan fails with some Decimal NaNs

2012-08-03 Thread Steven D'Aprano
Steven D'Aprano added the comment: Attached is a patch for decimal.py, and test_decimal.py. I cannot provide a patch for the C decimal implementation, sorry. Following Mark's suggestion, my patch keeps the sign but discards the payload for quiet NANs, and raises ValueError for signalling

[issue15540] Python 3.3 and numpy

2012-08-03 Thread Martin v . Löwis
Martin v. Löwis added the comment: FWIW, with regard to Martin's tangential comment about appropriate use of the tracker, I'm personally fine with using the tracker for 'I found this problem, attempted to fix it (but failed), here's my attempt'. I don't mind that at all, either. What

[issue15544] math.isnan fails with some Decimal NaNs

2012-08-03 Thread Stefan Krah
Stefan Krah added the comment: I think math.isnan('snan') probably should not raise. Decimal('snan').is_nan() just returns true and I am under the impression that IEEE 754 specifies the same. I have to admit though that I just consulted Wikipedia for the latter: The predicate isNaN(x)

[issue15540] Python 3.3 and numpy

2012-08-03 Thread Stefan Krah
Stefan Krah added the comment: Martin v. L??wis rep...@bugs.python.org wrote: I don't mind that at all, either. What I dislike is I have this issue, here is what I've got, and I will continue to work on it kind of reports (when Dave clearly said that his patch is work-in-progress). There is a

[issue15546] Iteration breaks with bz2.open(filename,'rt')

2012-08-03 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: -- nosy: +nadeem.vawda ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15546 ___ ___ Python-bugs-list

[issue15530] Enhance Py_MIN and Py_MAX

2012-08-03 Thread Antoine Pitrou
Antoine Pitrou added the comment: I don't understand the point of your patch. Can you explain? -- nosy: +pitrou ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15530 ___

[issue15546] Iteration breaks with bz2.open(filename,'rt')

2012-08-03 Thread Nadeem Vawda
Nadeem Vawda added the comment: I can't seem to reproduce this with an up-to-date checkout from Mercurial: import bz2 g = bz2.open('access-log-0108.bz2','rt') next(g) '140.180.132.213 - - [24/Feb/2008:00:08:59 -0600] GET /ply/ply.html HTTP/1.1 200 97238\n' (where

[issue15530] Enhance Py_MIN and Py_MAX

2012-08-03 Thread Antoine Pitrou
Antoine Pitrou added the comment: Yes. It's explained in the comment of the two macros: When compiled with GCC, check also that types of x and y are compatible at compile time. I'm sorry, that doesn't explain anything. The C compiler already checks types for you. So what does it bring? And

[issue15530] Enhance Py_MIN and Py_MAX

2012-08-03 Thread STINNER Victor
STINNER Victor added the comment: I don't understand the point of your patch. Can you explain? Yes. It's explained in the comment of the two macros: When compiled with GCC, check also that types of x and y are compatible at compile time. So it adds a cheap santity check at compile time.

[issue15546] Iteration breaks with bz2.open(filename,'rt')

2012-08-03 Thread David Beazley
David Beazley added the comment: File attached.The file can be read in its entirety in binary mode. -- Added file: http://bugs.python.org/file26673/access-log-0108.bz2 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15546

[issue15544] math.isnan fails with some Decimal NaNs

2012-08-03 Thread Mark Dickinson
Mark Dickinson added the comment: Decimal('snan').is_nan() just returns true and I am under the impression that IEEE 754 specifies the same. Sure, but IEEE 754 also specifies that math.sqrt(signalling nan) should signal. Since both math.sqrt and math.isnan are going through __float__, we

[issue15525] test_multiprocessing failure on Windows XP

2012-08-03 Thread Richard Oudkerk
Richard Oudkerk added the comment: Looks like it is fixed. -- resolution: - fixed stage: needs patch - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15525

[issue15547] Why do we have os.truncate() and os.ftruncate() whereas os.truncate() accepts a file descriptor?

2012-08-03 Thread STINNER Victor
New submission from STINNER Victor: posix_truncate() accepts a file descriptor, so os.ftruncate() can be removed from Python 3.3. memset(path, 0, sizeof(path)); path.function_name = truncate; #ifdef HAVE_FTRUNCATE path.allow_fd = 1; #endif if (!PyArg_ParseTupleAndKeywords(args,

[issue15530] Enhance Py_MIN and Py_MAX

2012-08-03 Thread Martin v . Löwis
Martin v. Löwis added the comment: Victor hinted that it would detect errors when combining int and unsigned int. To elaborate, see the attached min.c. It gives [traditional MIN definition] [int, pointer] min.c:18: warning: comparison between pointer and integer min.c:18: warning:

[issue15514] Correct __sizeof__ support for cpu_set

2012-08-03 Thread Jesús Cea Avión
Changes by Jesús Cea Avión j...@jcea.es: -- nosy: +jcea ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15514 ___ ___ Python-bugs-list mailing list

[issue15514] Correct __sizeof__ support for cpu_set

2012-08-03 Thread Roundup Robot
Roundup Robot added the comment: New changeset 463d3ad22cdb by Jesus Cea in branch 'default': Closes #15514: Correct __sizeof__ support for cpu_set http://hg.python.org/cpython/rev/463d3ad22cdb -- nosy: +python-dev resolution: - fixed stage: - committed/rejected status: open - closed

[issue15478] UnicodeDecodeError on OSError on Windows with undecodable (bytes) filename

2012-08-03 Thread STINNER Victor
STINNER Victor added the comment: Attached patch modifies all functions of the os module taking filenames to keep the filename unmodified in OSError.filename. The patch changes also os.link(), os.rename() and os.replace() to use the source, not the destination, in the error message. It is

[issue15512] Correct __sizeof__ support for parser

2012-08-03 Thread Jesús Cea Avión
Changes by Jesús Cea Avión j...@jcea.es: -- nosy: +jcea ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15512 ___ ___ Python-bugs-list mailing list

[issue15547] Why do we have os.truncate() and os.ftruncate() whereas os.truncate() accepts a file descriptor?

2012-08-03 Thread STINNER Victor
Changes by STINNER Victor victor.stin...@gmail.com: -- nosy: +georg.brandl ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15547 ___ ___

[issue15548] Mention all new os functions in What's New in Python 3.3

2012-08-03 Thread STINNER Victor
New submission from STINNER Victor: The os module has a lot of new functions in Python 3.3. It looks like only a few are documented in What's New in Python 3.3. Examples : truncate(), ftruncate() and sync() are not mentionned. Does Sphinx have a function to list of new functions added to

[issue15544] math.isnan fails with some Decimal NaNs

2012-08-03 Thread Mark Dickinson
Mark Dickinson added the comment: IEEE 754 doesn't help here, since it doesn't cover decimal floating-point - binary floating-point conversions. OTOH, IEEE 754 *does* cover floating-point to int conversions (5.4.1, 5.8): those fall under 'general-computational operations', and as such

[issue15547] Why do we have os.truncate() and os.ftruncate() whereas os.truncate() accepts a file descriptor?

2012-08-03 Thread STINNER Victor
STINNER Victor added the comment: To check if os.truncate() supports file description, os.truncate in os.supports_fd checek can be used. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15547

[issue15512] Correct __sizeof__ support for parser

2012-08-03 Thread Roundup Robot
Roundup Robot added the comment: New changeset aceb975c4832 by Jesus Cea in branch '2.7': Closes #15512: Correct __sizeof__ support for parser http://hg.python.org/cpython/rev/aceb975c4832 New changeset 91884d04de06 by Jesus Cea in branch '3.2': Closes #15512: Correct __sizeof__ support for

[issue15530] Enhance Py_MIN and Py_MAX

2012-08-03 Thread Antoine Pitrou
Antoine Pitrou added the comment: Le vendredi 03 août 2012 à 12:15 +, Martin v. Löwis a écrit : So compared to the traditional type checks: a) this gives a hard compile error, whereas the existing check would only produce warnings Warnings are quite visible already, and we try to silence

[issue15469] Correct __sizeof__ support for deque

2012-08-03 Thread Roundup Robot
Roundup Robot added the comment: New changeset a3d49f1de893 by Jesus Cea in branch '2.7': Closes #15469: Correct __sizeof__ support for deque http://hg.python.org/cpython/rev/a3d49f1de893 New changeset b0725c1b3068 by Jesus Cea in branch '3.2': Closes #15469: Correct __sizeof__ support for

[issue15512] Correct __sizeof__ support for parser

2012-08-03 Thread Antoine Pitrou
Antoine Pitrou added the comment: Compilation of 2.7 under Windows is broken: http://buildbot.python.org/all/builders/AMD64%20Windows7%20SP1%202.7/builds/75 -- assignee: - jcea nosy: +pitrou status: closed - open ___ Python tracker

[issue15548] Mention all new os functions in What's New in Python 3.3

2012-08-03 Thread Ross Lagerwall
Ross Lagerwall added the comment: Attached is a diff between dir(os) in 3.2 and 3.3 -- keywords: +patch nosy: +rosslagerwall Added file: http://bugs.python.org/file26676/oschanges.diff ___ Python tracker rep...@bugs.python.org

[issue15544] math.isnan fails with some Decimal NaNs

2012-08-03 Thread Steven D'Aprano
Steven D'Aprano added the comment: On 03/08/12 22:06, Mark Dickinson wrote: Decimal('snan').is_nan() just returns true and I am under the impression that IEEE 754 specifies the same. Sure, but IEEE 754 also specifies that math.sqrt(signalling nan) should signal. Since both math.sqrt and

[issue15512] Correct __sizeof__ support for parser

2012-08-03 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Oops, I forgot to remove the remnants of debugging code. Here's the patch. Sorry. -- Added file: http://bugs.python.org/file26677/parser_sizeof_cleanup.patch ___ Python tracker rep...@bugs.python.org

[issue15473] importlib no longer uses imp.NullImporter

2012-08-03 Thread Brett Cannon
Changes by Brett Cannon br...@python.org: -- resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15473 ___

[issue15512] Correct __sizeof__ support for parser

2012-08-03 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Compilation of 2.7 under Windows is broken: Here is a patch for declarations reorganizing. -- Added file: http://bugs.python.org/file26678/parser_methods_declaration_move-2.7.patch ___ Python tracker

[issue15544] math.isnan fails with some Decimal NaNs

2012-08-03 Thread Mark Dickinson
Mark Dickinson added the comment: before the conversion to float. By I have no idea whether that is practical in the math module. That's a much bigger discussion: as it is, most of the math module functions just provide simple wrappers around the system math library, which deals purely

[issue15540] Python 3.3 and numpy

2012-08-03 Thread Ondřej Čertík
Ondřej Čertík added the comment: Martin, So if the byte swapping is done before the Unicode object is created: why did Dave and Ondřej run into problems then? As I wrote above (http://bugs.python.org/msg167280), this happened because of wrong NumPy tests, that need to be fixed. They are

[issue15512] Correct __sizeof__ support for parser

2012-08-03 Thread Roundup Robot
Roundup Robot added the comment: New changeset 0827fef8652d by Jesus Cea in branch '2.7': #15512: Remove remnants of debugging code http://hg.python.org/cpython/rev/0827fef8652d New changeset 0bda3f00b60a by Jesus Cea in branch '3.2': #15512: Remove remnants of debugging code

[issue15513] Correct __sizeof__ support for pickle

2012-08-03 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: In any case do not commit the patch for the time being. Probably it should be improved to include the size of the internal Python objects (see discussion in issue15490). -- ___ Python tracker

[issue6471] errno and strerror attributes incorrectly set on socket errors wrapped by urllib

2012-08-03 Thread R. David Murray
R. David Murray added the comment: This is an interesting idea and should at least improve matters. I'm wondering, though...I seem to remember writing code that fished the wrapped error out using one of those attributrs...but I'm not at a computer where I can try to check on that. Hopefully

[issue15544] math.isnan fails with some Decimal NaNs

2012-08-03 Thread Antoine Pitrou
Antoine Pitrou added the comment: Why not add a is_nan() method to float numbers instead? -- nosy: +pitrou ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15544 ___

[issue15512] Correct __sizeof__ support for parser

2012-08-03 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Compilation of 2.7 under Windows is successful: http://buildbot.python.org/all/builders/AMD64%20Windows7%20SP1%202.7/builds/77 -- status: open - closed ___ Python tracker rep...@bugs.python.org

[issue13498] os.makedirs exist_ok documentation is incorrect, as is some of the behavior

2012-08-03 Thread R. David Murray
R. David Murray added the comment: I want the opposite: a way to say I don't care what the mode is as long as it exists. Currently there is no way to do that, as far as I remember. -- ___ Python tracker rep...@bugs.python.org

[issue15492] textwrap.wrap expand_tabs does not behave as expected

2012-08-03 Thread R. David Murray
R. David Murray added the comment: I think that expanding them before wrapping is correct. Any lining up would be true only for the original unwrapped input text. -- nosy: +r.david.murray ___ Python tracker rep...@bugs.python.org

[issue15494] Move test/support.py into a test.support subpackage

2012-08-03 Thread R. David Murray
Changes by R. David Murray rdmur...@bitdance.com: -- nosy: +r.david.murray ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15494 ___ ___

[issue15540] Python 3.3 and numpy

2012-08-03 Thread Ondřej Čertík
Ondřej Čertík added the comment: Here is my new patch: https://github.com/numpy/numpy/pull/372 It implements what I was talking about (and fixes the NumPy tests bug). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15540

[issue15549] openssl version in windows builds does not support renegotiation

2012-08-03 Thread Cory Mintz
New submission from Cory Mintz: The Python 2.7.3 and 2.6.8 Windows builds are both built against OpenSSL 0.9.8l 5 Nov 2009. This specific version of OpenSSL had renegotiation removed due a security vulnerability. Except from http://svn.python.org/projects/external/openssl-0.9.8x/NEWS.

[issue15486] Standardised mechanism for stripping importlib frames from tracebacks

2012-08-03 Thread Jesús Cea Avión
Changes by Jesús Cea Avión j...@jcea.es: -- nosy: +jcea ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15486 ___ ___ Python-bugs-list mailing list

[issue15550] Trailing white spaces

2012-08-03 Thread Serhiy Storchaka
New submission from Serhiy Storchaka: My editors are configured to remove trailing spaces (this is useful for removing artifacts of indentation). The flip side of this is that my patches sometimes contain unrelated trailing spaces fixes. Trailing spaces are not significant in any CPython

[issue15425] Another strange Tracebacks with importlib

2012-08-03 Thread Jesús Cea Avión
Changes by Jesús Cea Avión j...@jcea.es: -- nosy: +jcea ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15425 ___ ___ Python-bugs-list mailing list

[issue15487] Correct __sizeof__ support for buffered I/O

2012-08-03 Thread Jesús Cea Avión
Changes by Jesús Cea Avión j...@jcea.es: -- nosy: +jcea ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15487 ___ ___ Python-bugs-list mailing list

[issue15540] Python 3.3 and numpy

2012-08-03 Thread Travis Oliphant
Travis Oliphant added the comment: On Aug 3, 2012, at 1:35 AM, Martin v. Löwis wrote: Martin v. Löwis added the comment: This is a mis-understanding of what NumPy does and why.There is a need to byte-swap only when the data is stored on disk in the reverse order from the native

[issue15549] openssl version in windows builds does not support renegotiation

2012-08-03 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: -- nosy: +loewis ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15549 ___ ___ Python-bugs-list mailing

[issue15510] textwrap.wrap('') returns empty list

2012-08-03 Thread Jesús Cea Avión
Jesús Cea Avión added the comment: I think this is a bug. The question to ponder is backwards compatibility, specially if this is going to be backported to 2.7/3.2. Chris, could you possibly ask for opinions in python-dev and/or python-list? -- stage: patch review -

[issue15510] textwrap.wrap('') returns empty list

2012-08-03 Thread Jesús Cea Avión
Changes by Jesús Cea Avión j...@jcea.es: -- stage: - patch review ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15510 ___ ___ Python-bugs-list

[issue15551] Unit tests that return generators silently fail

2012-08-03 Thread Jason Baker
New submission from Jason Baker: The following test will pass silently: class SomeTest(unittest.TestCase): def testSomething(self): yield 1 self.fail() -- components: None messages: 167340 nosy: Jason.Baker priority: normal severity: normal status: open

[issue15551] Unit tests that return generators silently fail

2012-08-03 Thread Alex Gaynor
Changes by Alex Gaynor alex.gay...@gmail.com: -- nosy: +alex ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15551 ___ ___ Python-bugs-list mailing

[issue15510] textwrap.wrap('') returns empty list

2012-08-03 Thread Antoine Pitrou
Antoine Pitrou added the comment: I think this is a bug. Do you have any argument? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15510 ___

[issue15547] Why do we have os.truncate() and os.ftruncate() whereas os.truncate() accepts a file descriptor?

2012-08-03 Thread Larry Hastings
Larry Hastings added the comment: Because both functions were available in 3.2, and we can't remove old functions without a full deprecation cycle. -- resolution: - wont fix stage: - committed/rejected status: open - closed ___ Python tracker

[issue15552] gettext: if looking for .mo in default locations, also look in locale-bundle location

2012-08-03 Thread Dominique Leuenberger
New submission from Dominique Leuenberger: Coming from openSUSE, might be a bit special, but worthy the discussion. Background: - Language files are per design split off from the main application rpm (package-lang). Rational is 'space concerns for live CDs' - We offer bundle-lang-LANG

[issue15464] ssl: add set_msg_callback function

2012-08-03 Thread Antoine Pitrou
Antoine Pitrou added the comment: Thiébaud, I haven't reviewed the patch in detail, but why does the callback only receive the buffer contents? At the minimum, I think it should also receive write_p (whether the packet is an incoming or outgoing message is a rather useful piece of

[issue15548] Mention all new os functions in What's New in Python 3.3

2012-08-03 Thread Georg Brandl
Georg Brandl added the comment: Victor: try make changes. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15548 ___ ___ Python-bugs-list mailing

[issue15544] math.isnan fails with some Decimal NaNs

2012-08-03 Thread Stefan Krah
Stefan Krah added the comment: OTOH, IEEE 754 *does* cover floating-point to int conversions (5.4.1, 5.8): those fall under 'general-computational operations', and as such should signal when given an sNaN. That sounds good. Let's keep the ValueError then. We could consider

[issue15544] math.isnan fails with some Decimal NaNs

2012-08-03 Thread Stefan Krah
Stefan Krah added the comment: Why not add a is_nan() method to float numbers instead? Do you mean replacing math.isnan(x) by x.is_nan() to avoid the issue altogether? I'm not sure that's possible given that math just wraps the C library. -- ___

[issue15544] math.isnan fails with some Decimal NaNs

2012-08-03 Thread Antoine Pitrou
Antoine Pitrou added the comment: Why not add a is_nan() method to float numbers instead? Do you mean replacing math.isnan(x) by x.is_nan() to avoid the issue altogether? I'm not sure that's possible given that math just wraps the C library. Yup. By calling x.is_nan() you would by

[issue15550] Trailing white spaces

2012-08-03 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Because CPython repository contains binary files too, they should be reverted: hg diff | sed -nre 's/^Binary file (.*) has changed/\1/p' | tr '\n' '\0' | xargs -0 hg revert -- ___ Python tracker

[issue15550] Trailing white spaces

2012-08-03 Thread Ned Deily
Ned Deily added the comment: There already is a hook in place for the main python.org repository that checks for and rejects changesets that include files with space issues: http://hg.python.org/hooks/file/bd04c6b37749/checkwhitespace.py You can add it to your local repo to check patches

[issue15551] Unit tests that return generators silently fail

2012-08-03 Thread Ned Deily
Changes by Ned Deily n...@acm.org: -- nosy: +ezio.melotti, michael.foord ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15551 ___ ___

[issue15551] Unit tests that return generators silently fail

2012-08-03 Thread Michael Foord
Michael Foord added the comment: unittest calls test methods to execute tests. Generator functions do nothing (except create a generator) when you call them. Test methods as generators therefore do nothing in unittest. -- resolution: - invalid stage: - committed/rejected status:

[issue15510] textwrap.wrap('') returns empty list

2012-08-03 Thread Ethan Furman
Ethan Furman added the comment: The documentation says, Returns a list of output lines; an empty list is not a list of lines. -- nosy: +stoneleaf ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15510

[issue15510] textwrap.wrap('') returns empty list

2012-08-03 Thread Ethan Furman
Ethan Furman added the comment: Not sure I would worry about fixing it in 2.7, although I don't have strong feelings about that. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15510 ___

[issue15551] Unit tests that return generators silently fail

2012-08-03 Thread Jason Baker
Jason Baker added the comment: I can play this game too! Since generator functions do nothing when used as a unittest test method, there is no value in having a test method that is a generator function. Therefore, it is an error to give a test method that is a generator function. Since it

[issue15510] textwrap.wrap('') returns empty list

2012-08-03 Thread Antoine Pitrou
Antoine Pitrou added the comment: an empty list is not a list of lines Really? .splitlines() [] -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15510 ___

[issue15550] Trailing white spaces

2012-08-03 Thread Antoine Pitrou
Antoine Pitrou added the comment: Or you can use make patchcheck which will (hopefully) warn you of such issues. -- nosy: +pitrou ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15550 ___

[issue15551] Unit tests that return generators silently fail

2012-08-03 Thread Michael Foord
Michael Foord added the comment: It's not a game. Have a test method as a generator function is clearly programmer error. Doing nothing is the expected behaviour. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15551

[issue15510] textwrap.wrap('') returns empty list

2012-08-03 Thread Ethan Furman
Ethan Furman added the comment: Antoine Pitrou wrote: Antoine Pitrou added the comment: an empty list is not a list of lines Really? .splitlines() [] Really. -- ''.split('\n') [''] -- ___ Python tracker rep...@bugs.python.org

[issue15510] textwrap.wrap('') returns empty list

2012-08-03 Thread Ethan Furman
Ethan Furman added the comment: Ethan Furman wrote: Antoine Pitrou added the comment: .splitlines() [] -- ''.split('\n') [''] I see the docs have been fixed in 3 to explain the not present last empty line. However, sure this is still not correct? -- wrap(' ') [] So if you have

[issue15551] Unit tests that return generators silently fail

2012-08-03 Thread Jason Baker
Jason Baker added the comment: Who expects this behavior? Can you give me an example of when someone would rely upon a generator test to do nothing? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15551

[issue15551] Unit tests that return generators silently fail

2012-08-03 Thread Michael Foord
Michael Foord added the comment: It's the expected behaviour according to the unittest specification. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15551 ___

[issue15510] textwrap.wrap('') returns empty list

2012-08-03 Thread Antoine Pitrou
Antoine Pitrou added the comment: Really. -- ''.split('\n') [''] You claimed that an empty list is not a list of lines. I countered that splitlines(), which *by definition* returns a list of lines, can return an empty list, therefore textwrap.wrap() is not exotic in its behaviour. Whether

[issue15551] Unit tests that return generators silently fail

2012-08-03 Thread Jason Baker
Jason Baker added the comment: I would like to verify this. Link the specification, and highlight where it says that the expected behavior for a test method that is a generator function is to do nothing. -- ___ Python tracker

[issue15547] Why do we have os.truncate() and os.ftruncate() whereas os.truncate() accepts a file descriptor?

2012-08-03 Thread STINNER Victor
STINNER Victor added the comment: Oh, I see: os.ftruncate() is present in Python 3.2; but os.truncate() was added to Python 3.3. Ok, it's an excellent reason to not remove os.ftruncate() ;-) -- ___ Python tracker rep...@bugs.python.org

[issue15510] textwrap.wrap('') returns empty list

2012-08-03 Thread Ethan Furman
Ethan Furman added the comment: Antoine Pitrou wrote: Antoine Pitrou added the comment: Really. -- ''.split('\n') [''] You claimed that an empty list is not a list of lines. I countered that splitlines(), which *by definition* returns a list of lines, can return an empty list,

[issue15510] textwrap.wrap('') returns empty list

2012-08-03 Thread Antoine Pitrou
Antoine Pitrou added the comment: For an empty string, sure -- for a string with nothing but white space, no: -- wrap(' ') [] That's because wrap() suppresses extra whitespace by default. Once extra whitespace is suppressed, you are left with an empty text, meaning an empty list of

[issue15530] Enhance Py_MIN and Py_MAX

2012-08-03 Thread Martin v . Löwis
Martin v. Löwis added the comment: I think the feature is somewhat desirable; I agree code combining different types in MIN or MAX is flawed - if it is intentional, asking for an explicit cast is not asking too much. I don't agree. Trying to battle with C's semantics doesn't seem very

[issue15530] Enhance Py_MIN and Py_MAX

2012-08-03 Thread Antoine Pitrou
Antoine Pitrou added the comment: I think the feature is somewhat desirable; I agree code combining different types in MIN or MAX is flawed - if it is intentional, asking for an explicit cast is not asking too much. I don't agree. Trying to battle with C's semantics doesn't seem very

[issue15546] Iteration breaks with bz2.open(filename,'rt')

2012-08-03 Thread Nadeem Vawda
Nadeem Vawda added the comment: The cause of this problem is that BZ2File.read1() sometimes returns b, even though the file is not at EOF. This happens when the underlying BZ2Decompressor cannot produce any decompressed data from just the block passed to it in _fill_buffer(); in this case, it

[issue15546] Iteration breaks with bz2.open(filename,'rt')

2012-08-03 Thread Antoine Pitrou
Antoine Pitrou added the comment: I propose amending BZ2File.read1() to make as many reads from the underlying file as necessary to return a non-empty result. Agreed. IMO, read1()'s contract should be read as a best-effort thing, not an absolute guarantee. Returning an empty string when

[issue15510] textwrap.wrap('') returns empty list

2012-08-03 Thread Chris Jerdonek
Chris Jerdonek added the comment: That's because wrap() suppresses extra whitespace by default. But the documentation for drop_whitespace clearly states that, after wrapping, leading whitespace in the first line is always preserved, though. Once extra whitespace is suppressed, you are left

[issue15530] Enhance Py_MIN and Py_MAX

2012-08-03 Thread Meador Inge
Changes by Meador Inge mead...@gmail.com: -- nosy: +meador.inge ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15530 ___ ___ Python-bugs-list

[issue15510] textwrap.wrap('') returns empty list

2012-08-03 Thread Antoine Pitrou
Antoine Pitrou added the comment: That's because wrap() suppresses extra whitespace by default. But the documentation for drop_whitespace clearly states that, after wrapping, leading whitespace in the first line is always preserved, though. Ok, then it's a bit fuzzy. That whitespace is

[issue1859] textwrap doesn't linebreak on \n

2012-08-03 Thread Antoine Pitrou
Antoine Pitrou added the comment: After discussing issue15510, I think this should probably be left as-is, or be implemented in a separate function so as to avoid breaking compatibility. -- nosy: +pitrou ___ Python tracker rep...@bugs.python.org

[issue15530] Enhance Py_MIN and Py_MAX

2012-08-03 Thread Martin v . Löwis
Martin v. Löwis added the comment: The former. If C allows it then what's the point of special-casing Py_MIN and Py_MAX to disallow it? C allows it includes cases like C allows an the result to be implementation-defined, or an implementation-defined signal to be raised, and indeed, some

  1   2   >