[issue4711] Wide literals in the table of contents overflow in documentation

2012-09-17 Thread Ezio Melotti
Changes by Ezio Melotti : Added file: http://bugs.python.org/file27213/issue4711.png ___ Python tracker ___ ___ Python-bugs-list mailing list U

[issue4711] Wide literals in the table of contents overflow in documentation

2012-09-17 Thread Ezio Melotti
Ezio Melotti added the comment: I experimented a bit more with "text-overflow: ellipsis;" but didn't obtain anything good. With "word-wrap: break-word;" I had better luck, and even if breaking long words might not be the most elegant solution, it looks better than the overflowing text and doe

[issue15796] Fix readline() docstrings

2012-09-17 Thread Ezio Melotti
Ezio Melotti added the comment: Pong, thanks for the patch! -- assignee: docs@python -> ezio.melotti nosy: +ezio.melotti resolution: -> fixed stage: -> committed/rejected status: open -> closed type: -> enhancement ___ Python tracker

[issue15796] Fix readline() docstrings

2012-09-17 Thread Roundup Robot
Roundup Robot added the comment: New changeset 210a189544c3 by Ezio Melotti in branch '2.7': #15796: Fix \n in readline docstring. http://hg.python.org/cpython/rev/210a189544c3 New changeset 6386e1f4f1fd by Ezio Melotti in branch '3.2': #15796: Fix \n in readline docstring. Patch by Serhiy Stor

[issue15945] memoryview + bytes fails

2012-09-17 Thread Arfrever Frehtes Taifersar Arahesis
Changes by Arfrever Frehtes Taifersar Arahesis : -- nosy: +Arfrever ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscri

[issue15958] bytes.join() should allow arbitrary buffer objects

2012-09-17 Thread Arfrever Frehtes Taifersar Arahesis
Changes by Arfrever Frehtes Taifersar Arahesis : -- nosy: +Arfrever ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscri

[issue15745] Numerous utime ns tests fail on FreeBSD w/ ZFS

2012-09-17 Thread Trent Nelson
Trent Nelson added the comment: Just noticed that the Solaris 10 slave is failing in the same way: == FAIL: test_utime (test.test_os.StatAttributeTests) -- Trac

[issue15956] backreference to named group does not work

2012-09-17 Thread Steve Newcomb
Steve Newcomb added the comment: I have re-read the documentation on re.sub(). Even now, now that I understand that the \g syntax applies to the repl argument only, I cannot see how the documentation can be understood that way. The paragraph in which the explanation of the \g syntax appears

[issue12849] Cannot override 'connection: close' in urllib2 headers

2012-09-17 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.

[issue8542] Another test issue

2012-09-17 Thread R. David Murray
Changes by R. David Murray : -- stage: -> committed/rejected ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: ht

[issue15903] Make rawiobase_read() read directly to bytes object

2012-09-17 Thread Antoine Pitrou
Antoine Pitrou added the comment: > The bytes object cannot "leak" so, as you say, checking that refcount > is pointless. But the view might "leak", and since it does not own a > reference to the base object we have a problem: we can't deallocate the > bytes object for fear of breaking the view

[issue15903] Make rawiobase_read() read directly to bytes object

2012-09-17 Thread Richard Oudkerk
Richard Oudkerk added the comment: > I think that's a useless precaution. The bytes object cannot "leak" > since you are using PyMemoryView_FromMemory(), which doesn't know about > the original object. The bytes object cannot "leak" so, as you say, checking that refcount is pointless. But th

[issue15903] Make rawiobase_read() read directly to bytes object

2012-09-17 Thread Antoine Pitrou
Antoine Pitrou added the comment: > If either refcount is larger than the expected value of 1, then the > data is copied rather than resized. I think that's a useless precaution. The bytes object cannot "leak" since you are using PyMemoryView_FromMemory(), which doesn't know about the original

[issue15903] Make rawiobase_read() read directly to bytes object

2012-09-17 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- components: +IO, Library (Lib) type: -> performance ___ Python tracker ___ ___ Python-bugs-list mail

[issue15925] email.utils.parsedate() and email.utils.parsedate_tz() should return None when date cannot be parsed

2012-09-17 Thread Arfrever Frehtes Taifersar Arahesis
Arfrever Frehtes Taifersar Arahesis added the comment: I think that email.utils.parsedate_to_datetime("0") should raise ValueError instead of TypeError. -- ___ Python tracker __

[issue15836] unittest assertRaises should verify excClass is actually a BaseException class

2012-09-17 Thread Daniel Wagner-Hall
Daniel Wagner-Hall added the comment: Is anything blocking this patch's submission? -- ___ Python tracker ___ ___ Python-bugs-list mai

[issue15950] open() should not accept bool argument

2012-09-17 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.

[issue15903] Make rawiobase_read() read directly to bytes object

2012-09-17 Thread Richard Oudkerk
Richard Oudkerk added the comment: New patch which checks the refcount of the memoryview and bytes object after calling readinto(). If either refcount is larger than the expected value of 1, then the data is copied rather than resized. -- Added file: http://bugs.python.org/file27211/i

[issue15144] Possible integer overflow in operations with addresses and sizes.

2012-09-17 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: > Perhaps the three new macros should be made available in a .h file? > (in which case they should be private, i.e. start with _). Perhaps. There are similar macros in other files (Include/objimpl.h, Objects/obmalloc.c, Python/pyarena.c, Modules/expat/xmlpars

[issue15959] Declaration mismatch of quick integer allocation counters

2012-09-17 Thread Christian Heimes
Christian Heimes added the comment: The patch looks good. IMO it can safely be applied as it fixes a rarely used debug feature. -- nosy: +christian.heimes stage: -> patch review ___ Python tracker ___

[issue15959] Declaration mismatch of quick integer allocation counters

2012-09-17 Thread Serhiy Storchaka
New submission from Serhiy Storchaka: In Objects/longobject.c quick_int_allocs and quick_neg_int_allocs defined as int but in Objects/object.c they are declared and used as Py_ssize_t. Here is a patch that fixes this mismatch. See also issue4850. -- components: Interpreter Core files:

[issue15144] Possible integer overflow in operations with addresses and sizes.

2012-09-17 Thread Antoine Pitrou
Antoine Pitrou added the comment: Perhaps the three new macros should be made available in a .h file? (in which case they should be private, i.e. start with _). -- type: security -> behavior versions: +Python 3.4 -Python 3.3 ___ Python tracker

[issue15958] bytes.join() should allow arbitrary buffer objects

2012-09-17 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- nosy: +storchaka ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.p

[issue15958] bytes.join() should allow arbitrary buffer objects

2012-09-17 Thread Antoine Pitrou
New submission from Antoine Pitrou: This should ideally succeed: >>> b''.join([memoryview(b'foo'), b'bar']) Traceback (most recent call last): File "", line 1, in TypeError: sequence item 0: expected bytes, memoryview found (ditto for bytearray.join) -- components: Interpreter Core

[issue15945] memoryview + bytes fails

2012-09-17 Thread Antoine Pitrou
Antoine Pitrou added the comment: Opened issue15958 for the bytes.join enhancement. -- ___ Python tracker ___ ___ Python-bugs-list mai

[issue15957] README.txt points to broken "contributing" url in python wiki

2012-09-17 Thread Cliff Dyer
New submission from Cliff Dyer: The README.txt file for distutils2 points to , which raises a 404. The correct URL is . The attached patch fixes this typo. -- assignee: docs@python c

[issue10044] small int optimization

2012-09-17 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- components: +Interpreter Core nosy: +storchaka versions: +Python 3.4 -Python 3.3 ___ Python tracker ___ _

[issue10044] small int optimization

2012-09-17 Thread STINNER Victor
Changes by STINNER Victor : -- nosy: +haypo ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.

[issue15629] Add to regrtest the ability to run Lib and Doc doctests

2012-09-17 Thread Brett Cannon
Brett Cannon added the comment: I should mention that http://bugs.python.org/issue10967 exists as a meta issue about trying to gut regrtest in favour of using other things in unittest (and doctest in this case) when possible. -- ___ Python tracker

[issue15629] Add to regrtest the ability to run Lib and Doc doctests

2012-09-17 Thread R. David Murray
R. David Murray added the comment: We should improve the unittest help, then :) I will also note that the couple of times I tried it I couldn't figure out how to use the regrtest test selection :) What we probably need for regrtest is a way to pass through a "selection string" from the regrt

[issue15629] Add to regrtest the ability to run Lib and Doc doctests

2012-09-17 Thread Éric Araujo
Éric Araujo added the comment: RDM’s arguments make a lot of sense. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubs

[issue15629] Add to regrtest the ability to run Lib and Doc doctests

2012-09-17 Thread Antoine Pitrou
Antoine Pitrou added the comment: > I think we should be moving *away* from having special infrastructure > in regrtest. As much stuff as makes sense should be moved to > unittest, and we've been slowly doing that. Correspondingly, we > should use Sphinx's native test facilities, not add specia

[issue15629] Add to regrtest the ability to run Lib and Doc doctests

2012-09-17 Thread R. David Murray
R. David Murray added the comment: I've given this some more thought, and I'm leaning toward Antoine's POV here. The point of running the doctests in the docs is not to test python, but to test the docs. Sphinx has a facility to do that: make doctest. So I think it is better to use that doc-

[issue14616] subprocess docs should mention pipes.quote/shlex.quote

2012-09-17 Thread Éric Araujo
Éric Araujo added the comment: You thought it was better not to mention that pipes.quote is semi-official and becomes public as shlex.quote in 3.3? -- ___ Python tracker ___ ___

[issue15956] backreference to named group does not work

2012-09-17 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: \g is meant to be used in re.sub(), in the replacement text (see the docs); in the search pattern, (?P=startquote) can be used to refer to a named group. The docs of "(?P...)" looks clear to me. -- nosy: +amaury.forgeotdarc resolution: -> invalid

[issue15475] Correct __sizeof__ support for itertools

2012-09-17 Thread Meador Inge
Meador Inge added the comment: Unassigning from myself. I thought I would have more time to review and push this through. -- assignee: meador.inge -> ___ Python tracker ___ __

[issue15419] distutils2: build should use a version-specific build directory

2012-09-17 Thread Éric Araujo
Éric Araujo added the comment: A doc note for distutils in stable versions could also be added. -- ___ Python tracker ___ ___ Python-b

[issue15419] distutils2: build should use a version-specific build directory

2012-09-17 Thread Éric Araujo
Éric Araujo added the comment: Okay, then it’s distutils2 material. -- components: -Distutils title: distutils: build should use a version-specific build directory -> distutils2: build should use a version-specific build directory versions: +3rd party, Python 3.4 -Python 2.7, Python 3.

[issue11664] Add patch method to unittest.TestCase

2012-09-17 Thread Michael Foord
Michael Foord added the comment: Why would mock.patch.object be the appropriate one to add to TestCase? patch.object is used orders of magnitude less than patch. -- ___ Python tracker _

[issue15956] backreference to named group does not work

2012-09-17 Thread Steve Newcomb
New submission from Steve Newcomb: The '\\g' in the below does not work: >>> repr( re.compile( '\\<\\!ENTITY[ \\011\\012\\015]+\\%[ >>> \\011\\012\\015]*(?P[A-Za-z][A-Za-z0-9\\.\\-\\_\\:]*)[ >>> \\011\\012\\015]*(?P[\\042\\047])(?P.+?)\\g[ >>> \\011\\012\\015]*\\>', re.IGNORECASE | re.DOTALL)

[issue15490] Correct __sizeof__ support for StringIO

2012-09-17 Thread Martin v . Löwis
Martin v. Löwis added the comment: Am 17.09.2012 14:26, schrieb Serhiy Storchaka: >> I would personally prefer if the computations where done in >> Py_ssize_t, not PyObject* > > I too. But on platforms with 64-bit pointers and 32-bit sizes we can > allocate total more than PY_SIZE_MAX bytes (hey

[issue15952] format(value) and value.__format__() behave differently with unicode format

2012-09-17 Thread Eric V. Smith
Eric V. Smith added the comment: I believe the conversion is happening in Objects/abstract.c in PyObject_Format, around line 864, near this comment: /* Convert to unicode, if needed. Required if spec is unicode and result is str */ I think changing the docs will result in more conf

[issue15629] Add to regrtest the ability to run Lib and Doc doctests

2012-09-17 Thread Ezio Melotti
Ezio Melotti added the comment: > Documentation examples are meant to be read, not executed I agree, but several of them already run, and others run with the addition of doctests directives (that are hidden in the html output). If the code needs to be changed in a way that is less readable, t

[issue15954] No error checking after using of the wcsxfrm()

2012-09-17 Thread Martin v . Löwis
Martin v. Löwis added the comment: > I don't know what exception type should be used here: > OSError with an errno EINVAL or some specialized type. No, I think the appropriate error is ValueError, at least if errno is EINVAL. > because I don't know under what conditions it would be possible e

[issue15629] Add to regrtest the ability to run Lib and Doc doctests

2012-09-17 Thread Antoine Pitrou
Antoine Pitrou added the comment: I think I'm -1 to run doctests as part of regrtest. Documentation examples are meant to be read, not executed: it is fine for them to omit unimportant information or trivial boilerplate (such as imports). Any complication in the way doc examples must be writte

[issue15490] Correct __sizeof__ support for StringIO

2012-09-17 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: It can't work well if we count internal Python objects that can be shared. This is because the "work well" concept is not well defined. And because the implementation of a certain defined calculation algorithm can be completely unmaintainable, that is not we

[issue15955] gzip, bz2, lzma: add method to get decompressed size

2012-09-17 Thread Christian Heimes
New submission from Christian Heimes: The gzip, bz2 and lzma file reader have no method to get the actual size and compression ratio of a compressed file. In my opinion it's useful to know how much disk space a file will need before it's decompressed. -- components: Library (Lib) messa

[issue15922] make howto/urllib2.rst doctests pass

2012-09-17 Thread Ezio Melotti
Ezio Melotti added the comment: +>>> try: +... urllib.request.urlopen(req) +... except urllib.error.URLError as e: +...print("Error opening url.") +...# E.g. "[Errno 8] nodename nor servname provided, or not known" +...print("Reason:", e.reason) #doctest:

[issue15954] No error checking after using of the wcsxfrm()

2012-09-17 Thread Christian Heimes
Christian Heimes added the comment: The patch looks good. `s` and `buf` are cleaned up after the exit label. -- stage: -> patch review ___ Python tracker ___ ___

[issue15954] No error checking after using of the wcsxfrm()

2012-09-17 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Here is a sample patch (to specify the location of the issue). I don't sure OSError is well here. As far as I understand, this function is Windows-specific, so I can't check how it works with code points beyond the BMP or with surrogates. -- keyword

[issue15490] Correct __sizeof__ support for StringIO

2012-09-17 Thread Martin v . Löwis
Martin v. Löwis added the comment: I disagree that sizeof cannot work well for variable-sized types. It works very well for strings, lists, tuple, dicts, and other "regular" containers. I agree that it is not important that it is absolutely correct (in some sense) for every object, but it shou

[issue15921] select module uses uninitialized value "tv.tv_usec"

2012-09-17 Thread Jesús Cea Avión
Changes by Jesús Cea Avión : -- resolution: -> fixed stage: patch review -> committed/rejected status: open -> closed ___ Python tracker ___

[issue15921] select module uses uninitialized value "tv.tv_usec"

2012-09-17 Thread Jesús Cea Avión
Changes by Jesús Cea Avión : -- nosy: +benj resolution: fixed -> stage: committed/rejected -> patch review status: closed -> open ___ Python tracker ___

[issue15954] No error checking after using of the wcsxfrm()

2012-09-17 Thread Christian Heimes
Christian Heimes added the comment: Have you tried code points beyond the BMP? The C function doesn't have a return value that signals an error. An explicit check of errno is required. http://linux.die.net/man/3/wcsxfrm -- nosy: +christian.heimes __

[issue15954] No error checking after using of the wcsxfrm()

2012-09-17 Thread Serhiy Storchaka
New submission from Serhiy Storchaka: The wcsxfrm() function may fail but there is no error check code. I don't know what exception type should be used here: OSError with an errno EINVAL or some specialized type. I can't prepare tests, because I don't know under what conditions it would be pos

[issue15953] Incorrect some fields declaration in the PyTypeObject documentation

2012-09-17 Thread Serhiy Storchaka
New submission from Serhiy Storchaka: The declaration of some fields in the PyTypeObject documentation does not match the sources. Here is a patch that fixes the mismatch. -- assignee: docs@python components: Documentation files: doc_newtypes.patch keywords: easy, patch messages: 170591

[issue11643] Use |version| instead of X.Y in the doc

2012-09-17 Thread Ezio Melotti
Ezio Melotti added the comment: I fixed the one in site.py. If there's no way to use |version| in :file:`...` I think using {X.Y} is OK, so that can be done where a bare X.Y (without {}) is currently used. -- ___ Python tracker

[issue11643] Use |version| instead of X.Y in the doc

2012-09-17 Thread Roundup Robot
Roundup Robot added the comment: New changeset de6976fe19aa by Ezio Melotti in branch '2.7': #11643: fix rst markup error in site.rst. http://hg.python.org/cpython/rev/de6976fe19aa New changeset 7aca2781c381 by Ezio Melotti in branch '3.2': #11643: fix rst markup error in site.rst. http://hg.pyt