[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 ___ ___ Python-bugs-list mailing list Unsub

[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 > w

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

2012-08-03 Thread Pierre Le Marre
Changes by Pierre Le Marre : -- 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 ___ Python tracker

[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

[issue15204] Deprecate the 'U' open mode

2012-08-03 Thread Chris Jerdonek
Changes by Chris Jerdonek : -- nosy: +cjerdonek ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.pyt

[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 hav

[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. T

[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 NANs.

[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. Wh

[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) determin

[issue15540] Python 3.3 and numpy

2012-08-03 Thread Stefan Krah
Stefan Krah added the comment: Martin v. L??wis 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 > worse kind, whe

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

2012-08-03 Thread Antoine Pitrou
Changes by Antoine Pitrou : -- nosy: +nadeem.vawda ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.

[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 ___ ___

[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

[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 ___

[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() should signal. Since both math.sqrt and math.isnan are going through __float__, we can't kee

[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 ___ ___

[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(arg

[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: pointer/int

[issue15514] Correct __sizeof__ support for cpu_set

2012-08-03 Thread Jesús Cea Avión
Changes by Jesús Cea Avión : -- nosy: +jcea ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.

[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 -> close

[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 mayb

[issue15512] Correct __sizeof__ support for parser

2012-08-03 Thread Jesús Cea Avión
Changes by Jesús Cea Avión : -- nosy: +jcea ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.

[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 : -- nosy: +georg.brandl ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.

[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 Pytho

[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 sh

[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 ___

[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 pars

[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 silen

[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 deque

[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 __

[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() should > signal. Since both math.sqrt and math.isn

[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

[issue15473] importlib no longer uses imp.NullImporter

2012-08-03 Thread Brett Cannon
Changes by Brett Cannon : -- resolution: -> fixed status: open -> closed ___ Python tracker ___ ___ Python-bugs-list mailing list Uns

[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 wi

[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 te

[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 http://hg.python.or

[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 ___ ___

[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 __

[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 _

[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 _

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

2012-08-03 Thread R. David Murray
Changes by R. David Murray : -- nosy: +r.david.murray ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://ma

[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 ___

[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. Ma

[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 : -- nosy: +jcea ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.

[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 sourc

[issue15425] Another strange Tracebacks with importlib

2012-08-03 Thread Jesús Cea Avión
Changes by Jesús Cea Avión : -- nosy: +jcea ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.

[issue15487] Correct __sizeof__ support for buffered I/O

2012-08-03 Thread Jesús Cea Avión
Changes by Jesús Cea Avión : -- nosy: +jcea ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.

[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

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

2012-08-03 Thread Antoine Pitrou
Changes by Antoine Pitrou : -- nosy: +loewis ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python

[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 : -- stage: -> patch review ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://

[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 title

[issue15551] Unit tests that return generators silently fail

2012-08-03 Thread Alex Gaynor
Changes by Alex Gaynor : -- nosy: +alex ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/

[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 ___ ___ Python-bugs-list m

[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- packages, wi

[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 information)

[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 ___ ___ Python-bugs-list mailing list Unsubscribe:

[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 InvalidOperat

[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. -- ___ Py

[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 c

[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 befor

[issue15551] Unit tests that return generators silently fail

2012-08-03 Thread Ned Deily
Changes by Ned Deily : -- nosy: +ezio.melotti, michael.foord ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: ht

[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: op

[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 ___ __

[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 ___ __

[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 is

[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 ___ __

[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 ___ ___

[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

[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

[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(' ') [] S

[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 ___ _

[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 ___ ___ Py

[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. Whet

[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 _

[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 empt

[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 o

[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 ver

[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

[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, i

[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 the

[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 l

[issue15530] Enhance Py_MIN and Py_MAX

2012-08-03 Thread Meador Inge
Changes by Meador Inge : -- nosy: +meador.inge ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.pyth

[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 whitesp

[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

[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

[issue15530] Enhance Py_MIN and Py_MAX

2012-08-03 Thread Martin v . Löwis
Changes by Martin v. Löwis : -- resolution: -> rejected status: open -> closed ___ Python tracker ___ ___ Python-bugs-list mailing li

[issue14905] zipimport.c needs to support namespace packages when no 'directory' entry exists

2012-08-03 Thread Eric Snow
Changes by Eric Snow : -- nosy: +eric.snow ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.o

  1   2   >