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

2012-09-17 Thread Ezio Melotti
Ezio Melotti added the comment: We discussed about this on IRC, and I'll try to summarize the outcomes. If we want devs to run doctests, the syntax should be as simple as possible, ideally there shouldn't be any extra syntax -- at least for the common case. Note that there are two kind of

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

2012-09-17 Thread Mike Hoy
Changes by Mike Hoy mho...@gmail.com: -- nosy: +mikehoy ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11643 ___ ___ Python-bugs-list mailing list

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

2012-09-17 Thread Mike Hoy
Mike Hoy added the comment: So we could fix this in reverse? Remove the |version| and replace them with X.Y since |version| doesn't expand within :file:? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11643

[issue15276] unicode format does not really work in Python 2.x

2012-09-17 Thread Chris Jerdonek
Chris Jerdonek added the comment: Eric, it looks like you wrote this comment: /* don't define FORMAT_LONG, FORMAT_FLOAT, and FORMAT_COMPLEX, since we can live with only the string versions of those. The builtin format() will convert them to unicode. */ in

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

2012-09-17 Thread Chris Jerdonek
Chris Jerdonek added the comment: See this code comment: /* don't define FORMAT_LONG, FORMAT_FLOAT, and FORMAT_COMPLEX, since we can live with only the string versions of those. The builtin format() will convert them to unicode. */ from

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

2012-09-17 Thread Ronald Oussoren
Ronald Oussoren added the comment: I don't think this is a bugfix, but a new feature and as such the behavior should only be changed for 3.4. The easiest workaround for this issue is to use setuptools or distribute when installing, as those tools do set the various build directories to

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

[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

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

[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

[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

[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 j...@jcea.es: -- nosy: +benj resolution: fixed - stage: committed/rejected - patch review status: closed - open ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15921

[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 j...@jcea.es: -- resolution: - fixed stage: patch review - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15921 ___

[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

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

[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 rep...@bugs.python.org http://bugs.python.org/issue15954 ___

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

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

[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

[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

[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

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

[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

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

[issue15956] backreference to named group does not work

2012-09-17 Thread Steve Newcomb
New submission from Steve Newcomb: The '\\gstartquote' in the below does not work: repr( re.compile( '!ENTITY[ \\011\\012\\015]+\\%[ \\011\\012\\015]*(?PentityName[A-Za-z][A-Za-z0-9\\.\\-\\_\\:]*)[ \\011\\012\\015]*(?Pstartquote[\\042\\047])(?PentityText.+?)\\gstartquote[

[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 rep...@bugs.python.org http://bugs.python.org/issue11664

[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

[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 rep...@bugs.python.org http://bugs.python.org/issue15419 ___

[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 rep...@bugs.python.org http://bugs.python.org/issue15475

[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 (?Pname...) looks clear to me. -- nosy: +amaury.forgeotdarc resolution: -

[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 rep...@bugs.python.org http://bugs.python.org/issue14616

[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

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

[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 rep...@bugs.python.org http://bugs.python.org/issue15629 ___ ___

[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

[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

[issue10044] small int optimization

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

[issue10044] small int optimization

2012-09-17 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- components: +Interpreter Core nosy: +storchaka versions: +Python 3.4 -Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10044 ___

[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 http://wiki.python.org/Distutils2/Contributing, which raises a 404. The correct URL is http://wiki.python.org/moin/Distutils2/Contributing. The attached patch fixes this typo. -- assignee: docs@python

[issue15945] memoryview + bytes fails

2012-09-17 Thread Antoine Pitrou
Antoine Pitrou added the comment: Opened issue15958 for the bytes.join enhancement. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15945 ___ ___

[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 stdin, line 1, in module TypeError: sequence item 0: expected bytes, memoryview found (ditto for bytearray.join) -- components:

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

2012-09-17 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- nosy: +storchaka ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15958 ___ ___ Python-bugs-list

[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

[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

[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 rep...@bugs.python.org

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

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

[issue15950] open() should not accept bool argument

2012-09-17 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/issue15950 ___ ___ Python-bugs-list mailing list

[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 rep...@bugs.python.org http://bugs.python.org/issue15836 ___ ___

[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 rep...@bugs.python.org http://bugs.python.org/issue15925

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

2012-09-17 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- components: +IO, Library (Lib) type: - performance ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15903 ___

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

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

[issue8542] Another test issue

2012-09-17 Thread R. David Murray
Changes by R. David Murray rdmur...@bitdance.com: -- stage: - committed/rejected ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8542 ___ ___

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

2012-09-17 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/issue12849 ___ ___ Python-bugs-list mailing list

[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 \ggroupname 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

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

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

2012-09-17 Thread Arfrever Frehtes Taifersar Arahesis
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com: -- nosy: +Arfrever ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15958 ___

[issue15945] memoryview + bytes fails

2012-09-17 Thread Arfrever Frehtes Taifersar Arahesis
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com: -- nosy: +Arfrever ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15945 ___

[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

[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

[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

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

2012-09-17 Thread Ezio Melotti
Changes by Ezio Melotti ezio.melo...@gmail.com: Added file: http://bugs.python.org/file27213/issue4711.png ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4711 ___