[issue15716] Ability to specify the PYTHONPATH via a command line flag

2012-11-28 Thread Andrew Svetlov

Changes by Andrew Svetlov :


--
nosy: +asvetlov

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12370] Use of super overwrites use of __class__ in class namespace

2012-11-28 Thread Daniel Urban

Daniel Urban added the comment:

Thanks for the review!

Nick, the example with Outer, InnerParent and InnerChild still works (the 
evaluation happens before we enter the new scope).

Of course you're all right about __args__ and __kw__. I'll try to find a way to 
hide them.

--
stage: patch review -> needs patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16568] allow constructors to be documented separately from class

2012-11-28 Thread Chris Jerdonek

New submission from Chris Jerdonek:

This issue is to settle on and provide a way to document the constructor of a 
class separately from the overall summary/description of a class.

This is something that Ezio, Nick, and I discussed briefly on IRC a few hours 
ago.  We all see the value in it.

Currently, Sphinx's "class" directive is used in many places to document the 
constructor of a class.  One drawback of this approach is that linking to the 
class using the :class: role links to the constructor as opposed to the class 
summary.  As a result, in many cases the class description needs to be added 
before the class directive, and a second link needs to be created and used for 
the overall description.

One way to address this would be to create a new "constructor" directive 
similar to directives like method, classmethod, and staticmethod.  The 
constructor documentation could then be hyperlinked to using a new 
:constructor: role (or perhaps :ctor: to go with the pattern of 4-letter 
roles).  The class summary could then go immediately after the class directive, 
with the constructor directive following, as follows:

.. class:: Foo

   Description of Foo.

   .. constructor:: Foo(bar=1)
   
  Return a Foo.

This could render as--

class **Foo**

   Description of Foo.
   
   *constructor* **Foo**(bar=1)

  Return a Foo.

It is possible that something similar could be achieved by abusing the method 
directive for constructors and linking to them using :meth:`~Foo.Foo`, but that 
wouldn't be ideal in a few respects.

Nick also raised a related issue for base classes, etc.  I will let him speak 
to that issue, which might be best as part of another new issue.

--
assignee: docs@python
components: Documentation
messages: 176524
nosy: chris.jerdonek, docs@python, ezio.melotti, ncoghlan
priority: normal
severity: normal
status: open
title: allow constructors to be documented separately from class
type: enhancement

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16209] add a "class str" entry to the docs

2012-11-28 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 0097379df2e1 by Chris Jerdonek in branch '3.3':
Add a str class entry to the "Text Sequence Type" section (issue #16209).
http://hg.python.org/cpython/rev/0097379df2e1

New changeset 81ac75c64780 by Chris Jerdonek in branch 'default':
Merge from 3.3: Add a str class entry to the string section (issue #16209).
http://hg.python.org/cpython/rev/81ac75c64780

--
nosy: +python-dev

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16209] add a "class str" entry to the docs

2012-11-28 Thread Chris Jerdonek

Changes by Chris Jerdonek :


--
resolution:  -> fixed
stage: patch review -> committed/rejected
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13475] Add '-p'/'--path0' command line option to override sys.path[0] initialisation

2012-11-28 Thread Kristján Valur Jónsson

Kristján Valur Jónsson added the comment:

before or after running site.py?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13475] Add '-p'/'--path0' command line option to override sys.path[0] initialisation

2012-11-28 Thread Nick Coghlan

Nick Coghlan added the comment:

I'd suggest this would be applied at the same time as when sys.path[0] gets set 
now, but that kind of messy complication is why I decided we really needed to 
step back and start trying to clean up what we already have before we started 
layering yet *more* complications onto the initialisation process.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16205] update :class:`str` references to link to the str type section

2012-11-28 Thread Chris Jerdonek

Chris Jerdonek added the comment:

This was addressed by issue #16209 since with that change :class:`str` and 
:func:`str` now both go to the new str class entry in the string type section.  
See also the new issue #16568.

--
resolution:  -> duplicate
status: open -> closed
superseder:  -> add a "class str" entry to the docs

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13475] Add '-p'/'--path0' command line option to override sys.path[0] initialisation

2012-11-28 Thread Kristján Valur Jónsson

Kristján Valur Jónsson added the comment:

Absolutely, Nick.
Perhaps we ought to start gathering a list of real world requirements, i.e. how 
do people run, or want to run, python?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16323] Wrong C API documentation for locale encoding

2012-11-28 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 11629c14ce1f by Andrew Svetlov in branch '3.3':
Issue #16323: Fix wrong C API documentation for locale encoding.
http://hg.python.org/cpython/rev/11629c14ce1f

New changeset 6f3d3003acf3 by Andrew Svetlov in branch 'default':
Merge issue #16323: Fix wrong C API documentation for locale encoding.
http://hg.python.org/cpython/rev/6f3d3003acf3

--
nosy: +python-dev

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16323] Wrong C API documentation for locale encoding

2012-11-28 Thread Andrew Svetlov

Andrew Svetlov added the comment:

Fixed. Thanks.

--
nosy: +asvetlov
resolution:  -> fixed
stage: patch review -> committed/rejected
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15990] solidify argument/parameter terminology

2012-11-28 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 69d5d834c5cb by Chris Jerdonek in branch '3.2':
Improve argument/parameter documentation (issue #15990).
http://hg.python.org/cpython/rev/69d5d834c5cb

New changeset 40fd26a4206b by Chris Jerdonek in branch '3.3':
Merge from 3.2: improve argument/parameter documentation (issue #15990).
http://hg.python.org/cpython/rev/40fd26a4206b

New changeset 74d8a2a20c52 by Chris Jerdonek in branch 'default':
Merge from 3.3: improve argument/parameter documentation (issue #15990).
http://hg.python.org/cpython/rev/74d8a2a20c52

--
nosy: +python-dev

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15990] solidify argument/parameter terminology

2012-11-28 Thread Chris Jerdonek

Chris Jerdonek added the comment:

I realize now that this would also be good for 2.7.  I will try to do that 
tomorrow.

--
versions: +Python 2.7, Python 3.2

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16567] Implementing .= for variable operator

2012-11-28 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc added the comment:

Please submit this kind of ideas to the python-ideas mailing list, to trigger a 
discussion and get valuable feedback:
http://www.python.org/community/lists/#python-ideas-mailing-list

--
nosy: +amaury.forgeotdarc
resolution:  -> invalid
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16323] Wrong C API documentation for locale encoding

2012-11-28 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I think the sentence "If a byte sequence can be decoded as a surrogate 
character and *errors* is not ``"strict"``, then the byte sequence is escaped 
using the ``"surrogateescape"`` error handler instead of being decoded." is 
redundant.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16554] The description of the argument of MAKE_FUNCTION and MAKE_CLOSURE is incorrect

2012-11-28 Thread Daniel Urban

Daniel Urban added the comment:

Sorry, I won't have time for that in the following weeks.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16566] Structure._anonymous_ should not allow strings

2012-11-28 Thread anatoly techtonik

anatoly techtonik added the comment:

I agree with you on a generic case, where "Special cases aren't special enough 
to break the rules.", but this special case in ctypes and _anonymous_ context 
is where the rule "Although practicality beats purity." should apply. Otherwise 
I can't see any examples where the latter wins, and why it presents in the The 
Zen at all.

--
status: closed -> pending

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9720] zipfile writes incorrect local file header for large files in zip64

2012-11-28 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Patches updated to resolve merge conflict with issue11981.

Please review and apply any of this patches. This is needed for some
other my zipfile patches.

--
Added file: http://bugs.python.org/file28145/zipfile_zip64_always_2.patch
Added file: http://bugs.python.org/file28146/zipfile_zip64_try_2.patch

___
Python tracker 

___diff -r 6f3d3003acf3 Lib/zipfile.py
--- a/Lib/zipfile.pyWed Nov 28 12:34:27 2012 +0200
+++ b/Lib/zipfile.pyWed Nov 28 14:15:29 2012 +0200
@@ -346,7 +346,7 @@
 # compress_size Size of the compressed file
 # file_size Size of the uncompressed file
 
-def FileHeader(self):
+def FileHeader(self, zip64=None):
 """Return the per-file header as a string."""
 dt = self.date_time
 dosdate = (dt[0] - 1980) << 9 | dt[1] << 5 | dt[2]
@@ -362,12 +362,17 @@
 extra = self.extra
 
 min_version = 0
-if file_size > ZIP64_LIMIT or compress_size > ZIP64_LIMIT:
-# File is larger than what fits into a 4 byte integer,
-# fall back to the ZIP64 extension
+if zip64 is None:
+zip64 = file_size > ZIP64_LIMIT or compress_size > ZIP64_LIMIT
+if zip64:
 fmt = ' ZIP64_LIMIT or compress_size > ZIP64_LIMIT:
+if not zip64:
+raise LargeZipFile("Filesize would require ZIP64 extensions")
+# File is larger than what fits into a 4 byte integer,
+# fall back to the ZIP64 extension
 file_size = 0x
 compress_size = 0x
 min_version = ZIP64_VERSION
@@ -1301,7 +1306,7 @@
 zinfo.CRC = 0
 self.filelist.append(zinfo)
 self.NameToInfo[zinfo.filename] = zinfo
-self.fp.write(zinfo.FileHeader())
+self.fp.write(zinfo.FileHeader(False))
 return
 
 cmpr = _get_compressor(zinfo.compress_type)
@@ -1309,8 +1314,9 @@
 # Must overwrite CRC and sizes with correct data later
 zinfo.CRC = CRC = 0
 zinfo.compress_size = compress_size = 0
-zinfo.file_size = file_size = 0
-self.fp.write(zinfo.FileHeader())
+# Compressed size can be larger than uncompressed size
+self.fp.write(zinfo.FileHeader(self._allowZip64))
+file_size = 0
 while 1:
 buf = fp.read(1024 * 8)
 if not buf:
@@ -1330,11 +1336,11 @@
 zinfo.compress_size = file_size
 zinfo.CRC = CRC
 zinfo.file_size = file_size
-# Seek backwards and write CRC and file sizes
+# Seek backwards and write file header (which will now include
+# correct CRC and file sizes)
 position = self.fp.tell()   # Preserve current position in file
-self.fp.seek(zinfo.header_offset + 14, 0)
-self.fp.write(struct.pack(" ZIP64_LIMIT or \
+zinfo.compress_size > ZIP64_LIMIT
+if zip64 and not self._allowZip64:
+raise LargeZipFile("Filesize would require ZIP64 extensions")
+self.fp.write(zinfo.FileHeader(zip64))
 self.fp.write(data)
-self.fp.flush()
 if zinfo.flag_bits & 0x08:
 # Write CRC and file sizes after the file data
-self.fp.write(struct.pack("diff -r 6f3d3003acf3 Lib/zipfile.py
--- a/Lib/zipfile.pyWed Nov 28 12:34:27 2012 +0200
+++ b/Lib/zipfile.pyWed Nov 28 14:15:50 2012 +0200
@@ -346,7 +346,7 @@
 # compress_size Size of the compressed file
 # file_size Size of the uncompressed file
 
-def FileHeader(self):
+def FileHeader(self, zip64=None):
 """Return the per-file header as a string."""
 dt = self.date_time
 dosdate = (dt[0] - 1980) << 9 | dt[1] << 5 | dt[2]
@@ -362,12 +362,17 @@
 extra = self.extra
 
 min_version = 0
-if file_size > ZIP64_LIMIT or compress_size > ZIP64_LIMIT:
-# File is larger than what fits into a 4 byte integer,
-# fall back to the ZIP64 extension
+if zip64 is None:
+zip64 = file_size > ZIP64_LIMIT or compress_size > ZIP64_LIMIT
+if zip64:
 fmt = ' ZIP64_LIMIT or compress_size > ZIP64_LIMIT:
+if not zip64:
+raise LargeZipFile("Filesize would require ZIP64 extensions")
+# File is larger than what fits into a 4 byte integer,
+# fall back to the ZIP64 extension
 file_size = 0x
 compress_size = 0x
 min_version = ZIP64_VERSION
@@ -1301,7 +1306,7 @@
 zinfo.CRC = 0
 self.filelist.append(zinfo)
 self.NameToInfo[zinfo.filename] = zinfo
-self.fp.write(zinfo.FileHeader())
+self.fp.write(z

[issue16566] Structure._anonymous_ should not allow strings

2012-11-28 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc added the comment:

OTOH, __slots__ also allows a single string, but it is silently converted to a 
1-tuple:

class C:
__slots__ = 'abc'
assert 'abc' in C.__dict__

--
nosy: +amaury.forgeotdarc
status: pending -> open

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16323] Wrong C API documentation for locale encoding

2012-11-28 Thread Andrew Svetlov

Andrew Svetlov added the comment:

Really I don't know what's better. Victor, what do you think?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16333] Trailing whitespace in json dump when using indent

2012-11-28 Thread anatoly techtonik

anatoly techtonik added the comment:

> The reason is that people might rely on exact output and it's not nice to 
> break their code in a bugfix release.

This code has a very bad smell. Between supporting people who did that and 
teaching them a lesson I choose the latter, but I bet the situation like you 
describe either didn't exist or easily fixable on their side. If it's not 
fixable, then there is always a virtualenv and previous versions. That's about 
sympathy.

Now about technical side of conservative development. There is no promise of 
binary compatibility for pretty-printed data. Python never made pretty-prints a 
serialization format. If you insist that people rely on this behavior, let's 
document it, because at least on this tracker there are already two people who 
have questions about that.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16547] IDLE raises an exception in tkinter after fresh file's text has been rendered

2012-11-28 Thread Lukas Lueg

Lukas Lueg added the comment:

@Roger: Triggering the segfault on MacOS 10.6 requires some interaction with 
the text-window while the text is being rendered. This includes moving the 
window or just clicking into it's canvas. Carefully leaving the window alone 
while colorization is going on avoids the segfault thereafter. My guess is that 
TK's event queue gets upset; the segfault was fixed when switching to 
ActiveState TK.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15716] Ability to specify the PYTHONPATH via a command line flag

2012-11-28 Thread Martin Dengler

Changes by Martin Dengler :


--
nosy: +mdengler

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16499] CLI option for isolated mode

2012-11-28 Thread Martin Dengler

Changes by Martin Dengler :


--
nosy: +mdengler

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16333] Trailing whitespace in json dump when using indent

2012-11-28 Thread R. David Murray

R. David Murray added the comment:

"Code smell" and "Easily fixable on their side" are not an arguments that apply 
here.  We have a strong backward compatibility policy that strives not to break 
working code in bug fix releases.  And yes, this means that there are sometimes 
bugs that we only fix in feature releases.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16569] Preventing errors of simultaneous access in zipfile

2012-11-28 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

If the ZipFile was created by passing in a file-like object as the first 
argument to the constructor, then simultaneous reading or writing of different 
file results in an non-consistent state. There is a warning about this in the 
documentation. The proposed patch forces this condition, raising the early 
exception if you attempt to simultaneously access.

I'm not sure whether it's worth apply to older versions.

--
components: Library (Lib)
files: zipfile_simultaneous.patch
keywords: patch
messages: 176544
nosy: alanmcintyre, serhiy.storchaka
priority: normal
severity: normal
stage: patch review
status: open
title: Preventing errors of simultaneous access in zipfile
type: enhancement
versions: Python 3.4
Added file: http://bugs.python.org/file28147/zipfile_simultaneous.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16557] PEP 380 isn't reflected in the Functional Programming HOWTO

2012-11-28 Thread Andrew Svetlov

Changes by Andrew Svetlov :


--
keywords: +easy
stage:  -> needs patch
type:  -> enhancement
versions: +Python 3.4

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16570] Absolute imports fail to take full path into account?

2012-11-28 Thread Dirkjan Ochtman

New submission from Dirkjan Ochtman:

This seems confusing:

djc@enrai test $ ls -lR
.:
total 0
drwxr-xr-x 4 djc users 160 Nov 28 15:35 pkg

./pkg:
total 4
-rw-r--r-- 1 djc users  39 Nov 28 15:37 http.py
-rw-r--r-- 1 djc users   0 Nov 28 15:34 __init__.py
drwxr-xr-x 3 djc users 136 Nov 28 15:40 tests

./pkg/tests:
total 8
-rw-r--r-- 1 djc users  21 Nov 28 15:37 http.py
-rw-r--r-- 1 djc users  27 Nov 28 15:40 __init__.py

djc@enrai test $ cat pkg/__init__.py
djc@enrai test $ cat pkg/http.py
from http.client import HTTPConnection
djc@enrai test $ cat pkg/tests/__init__.py
from pkg.tests import http
djc@enrai test $ cat pkg/tests/http.py
from pkg import http
djc@enrai test $ python3
Python 3.2.3 (default, May 28 2012, 09:27:08)
[GCC 4.5.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from pkg import http
>>>
djc@enrai test $ python3
Python 3.2.3 (default, May 28 2012, 09:27:08)
[GCC 4.5.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from pkg.tests import http
>>>
djc@enrai test $ PYTHONPATH=. python3 pkg/tests/__init__.py
Traceback (most recent call last):
  File "pkg/tests/__init__.py", line 1, in 
from pkg.tests import http
  File "/home/djc/src/test/pkg/tests/__init__.py", line 1, in 
from pkg.tests import http
  File "/home/djc/src/test/pkg/tests/http.py", line 1, in 
from pkg import http
  File "/home/djc/src/test/pkg/http.py", line 1, in 
from http.client import HTTPConnection
  File "/home/djc/src/test/pkg/tests/http.py", line 1, in 
from pkg import http
ImportError: cannot import name http

--
components: Interpreter Core
messages: 176545
nosy: brett.cannon, djc, ncoghlan
priority: normal
severity: normal
status: open
title: Absolute imports fail to take full path into account?
versions: Python 3.2

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16569] Preventing errors of simultaneous access in zipfile

2012-11-28 Thread Jesús Cea Avión

Jesús Cea Avión added the comment:

I am -0 to this. We can't prevent programmers for shotting in the foot.

--
nosy: +jcea

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16323] Wrong C API documentation for locale encoding

2012-11-28 Thread STINNER Victor

STINNER Victor added the comment:

"If a byte sequence can be decoded as a surrogate character and
*errors* is not ``"strict"``, then the byte sequence is escaped using
the ``"surrogateescape"`` error handler instead of being decoded."

I don't understand this sentence but it sounds to be wrong. The
"surrogateescape" is only used if errors="surrogateescape"...

If errors is set and is different to "strict" and "surrogateescape",
an error is raised.

2012/11/28 Andrew Svetlov :
>
> Andrew Svetlov added the comment:
>
> Really I don't know what's better. Victor, what do you think?
>
> --
>
> ___
> Python tracker 
> 
> ___

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16569] Preventing errors of simultaneous access in zipfile

2012-11-28 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Reading from closed ZipFile or reading from ZipFile opened for write already 
forbidden. This is a preventing of the same kind.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16333] Trailing whitespace in json dump when using indent

2012-11-28 Thread anatoly techtonik

anatoly techtonik added the comment:

The problem with policy and 'common sense' is that not everybody can feel that 
'common sense', especially when there is no time to go deep into the issue. 
Policy is a quick and good 42 no matter that the matter is. The problem that it 
is also a filter, which puts a barrier in front of all reasonable arguments. 
You have either to transform yourself to live behind the barrier or to leave.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16565] Increase Py_AddPendingCall array size

2012-11-28 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.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16333] Trailing whitespace in json dump when using indent

2012-11-28 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Here is a patch which adds a suggestion to use appropriate separators with 
indent. It also use they in Lib/json/tool.py.

I suggest this patch only for old Python, up to 3.3. For 3.4 this is not needed 
if my previous suggestion will be accepted.

--
Added file: 
http://bugs.python.org/file28148/json_indent_separators_suggestion.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16571] Iterating over inconsistently-indented code block causes execution of code only on last iteration of loop

2012-11-28 Thread Brian Berard

New submission from Brian Berard:

When a loop (for loop in this case) contains multiple lines of code, if the 
lines are inconsistently indented, the for loop will only execute those lines 
on the final pass through the loop with no type of warning regarding 
indentation error. 

Ex. 

for i in range(0,10):
print "I will print on every iteration: %d" % i  # TAB indented
print "I will only print on the final iteration: %d" % i # 4 spaces

--
components: Interpreter Core
files: python_test.py
messages: 176551
nosy: dimitriprosser
priority: normal
severity: normal
status: open
title: Iterating over inconsistently-indented code block causes execution of 
code only on last iteration of loop
type: behavior
versions: Python 2.7
Added file: http://bugs.python.org/file28149/python_test.py

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16571] Iterating over inconsistently-indented code block causes execution of code only on last iteration of loop

2012-11-28 Thread Brian Berard

Changes by Brian Berard :


--
type: behavior -> enhancement

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16571] Iterating over inconsistently-indented code block causes execution of code only on last iteration of loop

2012-11-28 Thread Mark Dickinson

Mark Dickinson added the comment:

This is expected behaviour for Python 2.x:  Python interprets every TAB 
character as advancing to the next multiple-of-8 column, regardless of how your 
editor sees it.  It would be too disruptive to change this behaviour in Python 
2.x.

It's already fixed in Python 3: there it's a syntax error to mix tabs and 
spaces in this way.  Python 2.7 gives a warning if you run with the '-3' flag.

--
nosy: +mark.dickinson
resolution:  -> wont fix
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16571] Iterating over inconsistently-indented code block causes execution of code only on last iteration of loop

2012-11-28 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
stage:  -> committed/rejected

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16474] More code coverage for imp module

2012-11-28 Thread Andrew Svetlov

Andrew Svetlov added the comment:

I think nothing bad to push additional tests into 3.3 also.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15990] solidify argument/parameter terminology

2012-11-28 Thread Guido van Rossum

Changes by Guido van Rossum :


--
nosy:  -gvanrossum, python-dev

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15627] Add a method to importlib.abc.SourceLoader for converting source to a code object

2012-11-28 Thread Brett Cannon

Brett Cannon added the comment:

It might not be compulsory, but how else are you going to get a code object? 
Then again, get_code() kind of codifies the use of the word "code" for methods 
that return a code object.

So if you want to do the work to change the name then go ahead.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11076] Iterable argparse Namespace

2012-11-28 Thread Roundup Robot

Roundup Robot added the comment:

New changeset bbecbcff0ce4 by Andrew Svetlov in branch '3.2':
Issue #11076: document the way to convert argparse.Namespace to a dict.
http://hg.python.org/cpython/rev/bbecbcff0ce4

New changeset ee4e31845977 by Andrew Svetlov in branch '3.3':
Merge issue #11076: document the way to convert argparse.Namespace to a dict.
http://hg.python.org/cpython/rev/ee4e31845977

New changeset 63ff2d421d1a by Andrew Svetlov in branch 'default':
Merge issue #11076: document the way to convert argparse.Namespace to a dict.
http://hg.python.org/cpython/rev/63ff2d421d1a

--
nosy: +python-dev

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16570] Absolute imports fail to take full path into account?

2012-11-28 Thread Brett Cannon

Brett Cannon added the comment:

This test example is nonsensical. You are directly executing a package which 
leads to pkg/tests being put in sys.path first. That means you end up with http 
in pkg/tests masking the one in the stdlib, which causes your ``from 
http.clients import HTTPConnection`` to fail. You should be using the -m option 
with a proper __main__.py file to avoid this. If you do that with a __main__.py 
file doing nothing more than ``from pkg import tests`` everything works.

--
resolution:  -> rejected
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11076] Iterable argparse Namespace

2012-11-28 Thread Andrew Svetlov

Andrew Svetlov added the comment:

Sorry, looks like it work already was done. Reverting: c008f070f88a 
814403d824a5 ddcf09a348ca

--
nosy: +asvetlov
resolution:  -> duplicate
stage: patch review -> committed/rejected
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16570] Absolute imports fail to take full path into account?

2012-11-28 Thread Dirkjan Ochtman

Dirkjan Ochtman added the comment:

It's not nonsensical. Something exactly like it came up while I was looking 
into porting couchdb-python to Python 3. couchdb-python has had a couchdb.http 
module for a while now; it didn't start clashing with the stdlib until Python 
3. Also, I don't understand why Python is trying to import any "bare" http, 
when all the imports are absolute.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16570] Absolute imports fail to take full path into account?

2012-11-28 Thread Dirkjan Ochtman

Dirkjan Ochtman added the comment:

Never mind, I get what you're getting at now. I thought that the cwd was added 
to the sys.path, not the containing directory for the executed script. I'll 
look into using __main__. Thanks!

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16570] Absolute imports fail to take full path into account?

2012-11-28 Thread Brett Cannon

Brett Cannon added the comment:

When you execute a module on the command line, sys.path[0] is set to that 
containing directory (e.g. pkg/tests in your example; just have 
pkg/tests/__init__.py print out sys.path to see what I mean). ``import http`` 
is going to look on sys.path no matter what, and with ``pkg/tests`` being the 
first entry on sys.path, its going to find pkg/tests/http.py before it even has 
a chance to look in the directory containing the stdlib. A bare import only 
means "look on sys.path", not "magically only look in the stdlib".

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16570] Absolute imports fail to take full path into account?

2012-11-28 Thread Brett Cannon

Brett Cannon added the comment:

Glad it makes sense now. =) I was writing my reply while you sent yours.

Anyway, your PYTHONPATH setting goes on to sys.path *after* the directory 
containing the script being executed. This is so that when you execute Python 
code somewhere it will get the local modules and packages it expects and not 
some random one you accidentally masked using PYTHONPATH.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16571] Iterating over inconsistently-indented code block causes execution of code only on last iteration of loop

2012-11-28 Thread Ned Batchelder

Ned Batchelder added the comment:

@Brian:  Your code doesn't run in Python 2.7 as you've shown it, it produces an 
IndentationError.  If your code is actually different, and does run, try 
running it with the -tt flag on Python, which will warn about inconsistent 
indentation.

--
nosy: +nedbat

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16571] Iterating over inconsistently-indented code block causes execution of code only on last iteration of loop

2012-11-28 Thread Brian Berard

Brian Berard added the comment:

@nedbat I'm able to run that code as is and receive no such error. With the -tt 
option, I do receive an indentation error. I will keep that in mind.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16570] Absolute imports fail to take full path into account?

2012-11-28 Thread Eric Snow

Eric Snow added the comment:

Things are working as they should here.  The key points:

* when running a script, sys.path[0] is set to the script's directory (with no 
script sys.path[0] is set to the CWD, see issue13475),
* pkg/tests/__init__.py is loaded and executed twice: once as the script under 
the __main__ module and once during import as pkg.tests,
* Python does not handle circular imports very well,
* bad things happen when a "top-level" module has the same name as a module in 
the stdlib.

Together those explain what's going on.  The import you did at the REPL 
happened with '' at sys.path[0], so modules are found at the right relative 
places: pkg, pkg.http, pkg.tests, and pkg.tests.http.  There is no script 
involved, just imports, so no double-loading happens.

Things go south when you run "PYTHONPATH=. python3 pkg/tests/__init__.py".  
First of all, pkg/tests/__init__.py is executed twice: once as the script and 
once under import.  Though you set PYTHONPATH, sys.path[0] is set to 
"pkg/tests", the directory the script is in.  sys.path[1] is ".", what you were 
expecting to be at sys.path[0].  So when finding modules, the import system 
will first look in "pkg/tests" then in ".".  Thus the pkg.* imports work as 
expected.  However, "from http.client import HTTPConnection" in 
pkg/tests/http.py finds the same http.py (this time as the "http" module 
instead of "pkg.tests.http") in pkg/tests rather than the stdlib module as you 
expected.  So it tries to import it a second time with a different module name. 
 Since pkg/tests/http.py is already being loaded due to pkg/test/__init__.py, 
you get a circular import.  Even if you did not get the circular import you 
would have gotten an ImportError for "http.client" since pkg/tests/http.py 
neither behaves li
 ke a package nor actually has any "client" submodule.

Part of the fix is to use relative imports where appropriate.  For instance, 
change pkg/tests/__init__.py like this:

  from . import http

Also, don't run pkg/tests/__init__.py directly.  Instead try this:

  PYTHONPATH=. python3 -m pkg.tests

However, this implies that you wanted to run the package as a script, so you 
should have pkg/tests/__main__.py which would import pkg.tests.  Alternately, 
you could have a dedicated script elsewhere, perhaps next to the pkg directory 
that does the same thing.  Here's what I mean:

some_project/
  pkg/
tests/
  __init__.py
  __main__.py (option 1)
  http.py
__init__.py
  run_unittests.py (option 2)

Finally, don't name your modules with the same names as those in the stdlib. 


--
nosy: +eric.snow

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16570] Absolute imports fail to take full path into account?

2012-11-28 Thread Eric Snow

Eric Snow added the comment:

oops.  too slow.  :)

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11076] Iterable argparse Namespace

2012-11-28 Thread Chris Jerdonek

Chris Jerdonek added the comment:

Following up Andrew's last comment, for the record, it looks like this was done 
as part of issue 8982.

--
nosy: +chris.jerdonek
superseder:  -> argparse docs cross reference Namespace as a class but the 
Namespace class is not documented

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16568] allow constructors to be documented separately from class

2012-11-28 Thread Ezio Melotti

Ezio Melotti added the comment:

I was wondering if this should be called initializer instead of constructor.  
Another idea is to keep using the "method" directive and use :initializer: to 
differentiate it from the others.  This might be easier to implement, but OTOH 
is not consistent with the staticmethod and classmethod directives though.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16568] allow constructors to be documented separately from class

2012-11-28 Thread Ezio Melotti

Changes by Ezio Melotti :


--
nosy: +georg.brandl

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16565] Increase Py_AddPendingCall array size

2012-11-28 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc added the comment:

This array would still have a fixed size.
Could you arrange your code so that you enqueue pending calls elsewhere, and 
call Py_AddPendingCall only once until the pending items have been processed?

--
nosy: +amaury.forgeotdarc

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16565] Increase Py_AddPendingCall array size

2012-11-28 Thread Antoine Pitrou

Antoine Pitrou added the comment:

I just took a look at 
https://github.com/felipecruz/pyaio/commit/127372ba0a6dbca4045256dcd653789ee35f6a78
 and it looks a bit silly to me: if the completion handler is called in a 
separate thread, then the completion handler can just take the GIL and put the 
results in a regular Python queue.

In short, using signals for any kind of high-speed I/O sounds completely 
archaic to me.

--
nosy: +pitrou

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4806] Function calls taking a generator as star argument can mask TypeErrors in the generator

2012-11-28 Thread Chris Kaynor

Changes by Chris Kaynor :


--
nosy: +DragonFireCK

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16333] Trailing whitespace in json dump when using indent

2012-11-28 Thread Ezio Melotti

Ezio Melotti added the comment:

> There is no promise of binary compatibility for pretty-printed data.

This was the reason that made me consider backporting this on the other 
branches.  After all I expect this feature to be used from the terminal, while 
printing JSON in a human-friendly format and in other situations were trailing 
spaces would have little or no importance.
OTOH people might be used pretty-printed JSON in tests to get a better a diff 
for example, and changing that in a debug release might be annoying.

IOW the annoyance of having trailing spaces if it doesn't get fixed evens out 
the annoyance of having a possibly unwanted change of behavior if it does get 
fixed.

Serhiy patches look good to me (modulo a couple of minor typos), so I will 
probably apply them as soon as I get a chance.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16333] Trailing whitespace in json dump when using indent

2012-11-28 Thread R. David Murray

R. David Murray added the comment:

Yes, I think the risk of breaking doctests (and breaking them in a very 
mysterious way...trailing spaces) is high enough that we shouldn't backport the 
fix, unfortunately.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10052] Python/dtoa.c:158: #error "Failed to find an exact-width 32-bit integer type" (FreeBSD 4.11 + gcc 2.95.4)

2012-11-28 Thread Trent Nelson

Changes by Trent Nelson :


--
nosy: +trent

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16333] Trailing whitespace in json dump when using indent

2012-11-28 Thread Éric Araujo

Éric Araujo added the comment:

I agree with RDM.

--
versions:  -Python 2.7, Python 3.2, Python 3.3

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10052] Python/dtoa.c:158: #error "Failed to find an exact-width 32-bit integer type" (FreeBSD 4.11 + gcc 2.95.4)

2012-11-28 Thread Mark Dickinson

Mark Dickinson added the comment:

This is also an issue on the Tru64 / alpha on Snakebite:  that platform has 
inttypes.h but no stdint.h, and inttypes.h has typedefs for uint32_t and 
friends, but no defines for UINT32_MAX, etc.  So the pyport.h check:

#if (defined UINT32_MAX || defined uint32_t)

fails (uint32_t is a typedef rather than a #define). To make matters worse, the 
autoconf macro AC_TYPE_UINT32_T correctly detects that uint32_t exists, so 
doesn't bother to define it.

The ideal place to fix this would be in the configure scripts.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10052] Python/dtoa.c:158: #error "Failed to find an exact-width 32-bit integer type" (FreeBSD 4.11 + gcc 2.95.4)

2012-11-28 Thread Mark Dickinson

Changes by Mark Dickinson :


--
assignee:  -> mark.dickinson

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10052] Python/dtoa.c:158: #error "Failed to find an exact-width 32-bit integer type" (FreeBSD 4.11 + gcc 2.95.4)

2012-11-28 Thread Mark Dickinson

Changes by Mark Dickinson :


--
versions: +Python 3.3, Python 3.4

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16333] Trailing whitespace in json dump when using indent

2012-11-28 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Please left 2.7, 3.2 and 3.3 for documentation changes (the second patch).

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16333] Trailing whitespace in json dump when using indent

2012-11-28 Thread Éric Araujo

Changes by Éric Araujo :


--
components: +Documentation
versions: +Python 2.7, Python 3.2, Python 3.3

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15990] solidify argument/parameter terminology

2012-11-28 Thread Chris Jerdonek

Chris Jerdonek added the comment:

> Note that I took this from the pep.  The pep could get the same clarification
> (unless I made it more confusing than it was).

Reading the following, it seems that PEPs aren't generally clarified after 
becoming Final (as is PEP 362):

"In general, Standards track PEPs are no longer modified after they have 
reached the Final state."

(from http://www.python.org/dev/peps/pep-0001/#pep-maintenance )

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16572] Bad multi-inheritance support in some libs like threading or multiprocessing

2012-11-28 Thread Thomas Chiroux

New submission from Thomas Chiroux:

when using multi-inheritance and super() in __init__(), super() tries to run 
each constructor once.
For this to work correctly, it is needed to call super() in each constructor, 
including for Classes directly inherited from object.

The sample below does not execute correctly because threading.Thread 
constructor does not call super()
(and because Thread inherit from _Verbose, _Verbose should also call super() )

Sample:
from threading import Thread


class Foo(object):
def __init__(self):
super(Foo, self).__init__()
print('Foo constructor')
self.param1 = 'foo param1'


class Bar(Thread, Foo):
def __init__(self):
super(Bar, self).__init__()
print('Bar constructor')
self.another_param1 = "bar another_param1"

def run(self):
print("Running (%s - %s)" % (self.another_param1, self.param1))


if __name__ == '__main__':
threads = []
for i in range(1, 10):
thread = Bar()
threads.append(thread)
thread.start()

for thread in threads:
thread.join()


This sample work by simply inverting Thread and Foo :

(...)
class Bar(Foo, Thread):
(...)

The sample is about threading.Thread, but it's also the same for 
multiprocessing.Process, and maybe for other modules in stdlib.

attached is a proposed path for threading.Tread in 2.7

I've tested the issue and have the same behavior in 2.7 and in 3.3

--
components: Library (Lib)
files: diff_threading.py_2.7.patch
keywords: patch
messages: 176576
nosy: thomas.chiroux
priority: normal
severity: normal
status: open
title: Bad multi-inheritance support in some libs like threading or 
multiprocessing
type: behavior
versions: Python 2.7, Python 3.3
Added file: http://bugs.python.org/file28150/diff_threading.py_2.7.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9176] module termios doesn't build on HP-UX

2012-11-28 Thread Stefan Krah

Stefan Krah added the comment:

This should be fixed now (see #6308).

--
nosy: +skrah
resolution:  -> duplicate
stage:  -> committed/rejected
status: open -> closed
superseder:  -> termios fix for QNX breaks HP-UX

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15990] solidify argument/parameter terminology

2012-11-28 Thread Éric Araujo

Éric Araujo added the comment:

PEP 1 doesn’t reflect current practice then.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15990] solidify argument/parameter terminology

2012-11-28 Thread Ezio Melotti

Ezio Melotti added the comment:

The PEPs don't undergo major changes, but AFAIU typo fixes and minor 
clarifications/rephrasing are allowed.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16572] Bad multi-inheritance support in some libs like threading or multiprocessing

2012-11-28 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Can you please provide a diff in unified format? I don't see any super() in 
Lib/threading.py.

--
nosy: +serhiy.storchaka

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16572] Bad multi-inheritance support in some libs like threading or multiprocessing

2012-11-28 Thread Thomas Chiroux

Thomas Chiroux added the comment:

updated diff file, unified format

--
Added file: http://bugs.python.org/file28151/diff_unified_threading.py_2.7.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16534] -Olimit: unsupported option: warnings and ./configure failures

2012-11-28 Thread Stefan Krah

Stefan Krah added the comment:

The issue here is that the BASECFLAGS variable contains the mysterious 
option -Olimit 1500, which makes the X87_DOUBLE_ROUNDING test fail (i.e. 
X87_DOUBLE_ROUNDING is set to true when it should be false).

When BASECFLAGS is unset, test_float passes.


-Olimit gives problems with at least icc, suncc and HP C/aC++. So
propose to make this an -Olimit issue instead.

--
components: +Build -Tests
keywords: +buildbot
stage:  -> needs patch
title: test_float failure on IA64 (HPUX) -> -Olimit: unsupported option: 
warnings and ./configure failures
versions: +Python 3.3, Python 3.4

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16333] Trailing whitespace in json dump when using indent

2012-11-28 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 78bad589f205 by Ezio Melotti in branch '2.7':
#16333: document a way to get rid of trailing whitespace when indent is used.
http://hg.python.org/cpython/rev/78bad589f205

New changeset 2a5b183ac3cd by Ezio Melotti in branch '3.2':
#16333: document a way to get rid of trailing whitespace when indent is used.
http://hg.python.org/cpython/rev/2a5b183ac3cd

New changeset 9d6706b6b482 by Ezio Melotti in branch '3.3':
#16333: merge with 3.2.
http://hg.python.org/cpython/rev/9d6706b6b482

New changeset 8b30a764b58d by Ezio Melotti in branch 'default':
#16333: null merge with 3.3.
http://hg.python.org/cpython/rev/8b30a764b58d

New changeset e63ac05ccfa8 by Ezio Melotti in branch 'default':
#16333: use (",", ": ") as default separator when indent is specified to avoid 
trailing whitespace.  Patch by Serhiy Storchaka.
http://hg.python.org/cpython/rev/e63ac05ccfa8

--
nosy: +python-dev

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16333] Trailing whitespace in json dump when using indent

2012-11-28 Thread Roundup Robot

Roundup Robot added the comment:

New changeset e7919cf9b5e5 by Ezio Melotti in branch 'default':
#16333: fix example in docstring.
http://hg.python.org/cpython/rev/e7919cf9b5e5

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16333] Trailing whitespace in json dump when using indent

2012-11-28 Thread Ezio Melotti

Ezio Melotti added the comment:

I committed the patches leaving out the json.tool changes.
I will commit those as part of #16476.
Thanks Serhiy for the patches!

--
resolution:  -> fixed
stage: patch review -> committed/rejected
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15043] test_gdb is disallowed by default security settings in Fedora 17

2012-11-28 Thread Stefan Krah

Stefan Krah added the comment:

The test still seems to fail on Fedora 16:

http://buildbot.python.org/all/builders/AMD64%20Fedora%20without%20threads%202.7/builds/906/steps/test/logs/stdio

--
nosy: +skrah

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16534] -Olimit: unsupported option: warnings and ./configure failures

2012-11-28 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 5697387b0089 by Stefan Krah in branch '2.7':
Issue #16534: On HP-UX ac_cv_olimit_ok=yes is a false positive.
http://hg.python.org/cpython/rev/5697387b0089

--
nosy: +python-dev

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16572] Bad multi-inheritance support in some libs like threading or multiprocessing

2012-11-28 Thread Richard Oudkerk

Richard Oudkerk added the comment:

The patch is liable to break programs which explicitly call base constructors 
because the constructor will be called more than once.

It also assumes that the __init__() method of all base classes should be called 
with no arguments (other than self).  That is true in your example, but won't 
be in general.

--
nosy: +sbt

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15990] solidify argument/parameter terminology

2012-11-28 Thread Chris Jerdonek

Chris Jerdonek added the comment:

Thanks for the clarification.  I will create an issue to clarify that part of 
PEP 1.  It should also say who is allowed to make such changes and whether/from 
whom approval is necessary, etc.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16573] 2to3 should treat enumerate like sorted for zip, map, filter, dict, xrange

2012-11-28 Thread Jonathan Kotta

New submission from Jonathan Kotta:

enumerate() is a "consuming_call", as defined in fixer_util.py, because it 
takes an iterable (not necessarily a collection).  Therefore whenever we have 
something like enumerate(zip(...)), we don't need to replace it with 
enumerate(list(zip(...))) in 2to3, because enumerate doesn't care that zip no 
longer returns a list.

Patch attached.

--
components: 2to3 (2.x to 3.x conversion tool)
files: enumerate.patch
keywords: patch
messages: 176590
nosy: jpkotta
priority: normal
severity: normal
status: open
title: 2to3 should treat enumerate like sorted for zip, map, filter, dict, 
xrange
type: behavior
Added file: http://bugs.python.org/file28152/enumerate.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16476] Trailing spaces in pretty-printed JSON

2012-11-28 Thread Ezio Melotti

Changes by Ezio Melotti :


--
status: closed -> open

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16534] -Olimit: unsupported option: warnings and ./configure failures

2012-11-28 Thread Stefan Krah

Stefan Krah added the comment:

./configure is fixed, sys.float_repr_style is 'short' now.


I agree that it's not worth backporting Py_NAN fixes; I guess we can
close this then.

--
resolution:  -> fixed
stage: needs patch -> committed/rejected
status: open -> closed
versions:  -Python 3.3, Python 3.4

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16572] Bad multi-inheritance support in some libs like threading or multiprocessing

2012-11-28 Thread Thomas Chiroux

Thomas Chiroux added the comment:

That's right.
Lets consider this 'patch' was more for illustrating my example (like:  this 
kind of modification may work) than to add directly into python core module... 
(which i'm not capable of)

But I think the problem remains: do you agree that Classes should include a 
super() call in their __init__ ?
[btw indeed a super() call with kwargs: super(ClassName, 
self).__init__(**kwargs)]

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16476] Trailing spaces in pretty-printed JSON

2012-11-28 Thread Roundup Robot

Roundup Robot added the comment:

New changeset fa277ab588de by Ezio Melotti in branch '2.7':
#16476: Fix json.tool to avoid including trailing whitespace.
http://hg.python.org/cpython/rev/fa277ab588de

New changeset 6996a53f13ce by Ezio Melotti in branch '3.2':
#16476: Fix json.tool to avoid including trailing whitespace.
http://hg.python.org/cpython/rev/6996a53f13ce

New changeset 73a7e6ecd0e1 by Ezio Melotti in branch '3.3':
#16476: merge with 3.2.
http://hg.python.org/cpython/rev/73a7e6ecd0e1

New changeset c062ef6e4c3e by Ezio Melotti in branch 'default':
#16476: null merge with 3.3.
http://hg.python.org/cpython/rev/c062ef6e4c3e

--
nosy: +python-dev

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16476] Trailing spaces in pretty-printed JSON

2012-11-28 Thread Ezio Melotti

Ezio Melotti added the comment:

I fixed this separately from #16333.
In the "default" branch this got fixed by #16333 already.
Thanks for the report!

--
assignee:  -> ezio.melotti
components: +Library (Lib)
resolution: duplicate -> fixed
versions: +Python 3.2, Python 3.3, Python 3.4

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16549] regression: -m json.tool module is broken

2012-11-28 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 08e5973fdc7e by Ezio Melotti in branch '2.7':
#16549: Add tests for json.tools.  Initial patch by Berker Peksag and Serhiy 
Storchaka.
http://hg.python.org/cpython/rev/08e5973fdc7e

New changeset 44c544809e6c by Ezio Melotti in branch '3.2':
#16549: Make json.tool work again on Python 3 and add tests.  Initial patch by 
Berker Peksag and Serhiy Storchaka.
http://hg.python.org/cpython/rev/44c544809e6c

New changeset 1e2ae5e01963 by Ezio Melotti in branch '3.3':
#16549: merge with 3.2.
http://hg.python.org/cpython/rev/1e2ae5e01963

New changeset cdeca27b32e5 by Ezio Melotti in branch 'default':
#16549: merge with 3.3.
http://hg.python.org/cpython/rev/cdeca27b32e5

--
nosy: +python-dev

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16549] regression: -m json.tool module is broken

2012-11-28 Thread Ezio Melotti

Ezio Melotti added the comment:

Fixed, thanks for the patches!

--
resolution:  -> fixed
stage: patch review -> committed/rejected
status: open -> closed
versions: +Python 2.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16333] Trailing whitespace in json dump when using indent

2012-11-28 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 1e3b01c52aee by Ezio Melotti in branch 'default':
#16333: add Misc/NEWS entry for e63ac05ccfa8.
http://hg.python.org/cpython/rev/1e3b01c52aee

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16476] Trailing spaces in pretty-printed JSON

2012-11-28 Thread Ezio Melotti

Changes by Ezio Melotti :


--
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16574] clarify policy on updates to final peps

2012-11-28 Thread Chris Jerdonek

New submission from Chris Jerdonek:

This issue is to clarify the policy in PEP 1 regarding non-substantive changes 
to PEPs in the Final state (minor clarifications, rephrasings, etc).

Currently, PEP 1 says, "In general, Standards track PEPs are no longer modified 
after they have reached the Final state."

(from http://www.python.org/dev/peps/pep-0001/#pep-maintenance )

However, others have pointed out that minor clarifications and rephrasings are 
in fact allowed:

http://bugs.python.org/issue15990#msg176575

The updated wording should also state the policy or process regarding such 
changes (who is allowed to make them and whether and from whom approval is 
needed to make such changes, etc).

--
assignee: docs@python
components: Documentation
messages: 176598
nosy: barry, chris.jerdonek, docs@python, eric.araujo, ezio.melotti, goodger, 
ncoghlan
priority: normal
severity: normal
status: open
title: clarify policy on updates to final peps
type: enhancement

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15990] solidify argument/parameter terminology

2012-11-28 Thread Chris Jerdonek

Chris Jerdonek added the comment:

I just created issue 16574 to clarify PEP 1 with regard to the above.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16333] Trailing whitespace in json dump when using indent

2012-11-28 Thread Éric Araujo

Éric Araujo added the comment:

Ezio, I noticed in the check-in mail that you added the note before the 
description of the separators argument (specifically, the descrition of what it 
does when it’s a tuple).  Maybe it would flow best to move the note after that 
part?

Also, I don’t think this is important enought that it warrants a note 
directive.  Regular text would have looked good to me.

Kudos for the patch otherwise; I love it when we can at least give workarounds 
and recipes in stable versions’ docs.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16333] Trailing whitespace in json dump when using indent

2012-11-28 Thread Ezio Melotti

Ezio Melotti added the comment:

> I noticed in the check-in mail that you added the note before
> the description of the separators argument

The note is just after the description of the indent argument, because it's 
relevant only when a indent value is specified.

> Regular text would have looked good to me.

I considered this, but I think it's ok.  I built the doc and the note is not 
too bad.  The other two alternatives were: 1) use a normal paragraph, but that 
would have broken the flow, since each paragraph describes a different arg; 2) 
write it in the same paragraph of "indent", but that would have made it less 
visible.

FTR I also closed the related issues #16476 and #16549.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16572] Bad multi-inheritance support in some libs like threading or multiprocessing

2012-11-28 Thread Richard Oudkerk

Richard Oudkerk added the comment:

> But I think the problem remains: do you agree that Classes should include 
> a super() call in their __init__ ?

No, I don't.

I think super() is an attractive nuisance which is difficult to use correctly 
in an __init__() method, except in the trivial case where you only have one 
(non-mixin) base class.

See https://fuhm.net/super-harmful/

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16574] clarify policy on updates to final peps

2012-11-28 Thread Martin v . Löwis

Martin v. Löwis added the comment:

I don't think this needs clarification. The status quo is fine.

--
nosy: +loewis

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16574] clarify policy on updates to final peps

2012-11-28 Thread Chris Jerdonek

Chris Jerdonek added the comment:

Are you saying that PEP 1 is correct and that Final PEPs should not be 
modified, or that the PEP isn't correct but that it shouldn't be modified?

If the latter, for someone new it's not clear whether minor clarifications are 
permitted and if so, how to go about making one.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16574] clarify policy on updates to final peps

2012-11-28 Thread Éric Araujo

Éric Araujo added the comment:

I think Brett edited PEP 302 a decade after its acceptance.

--
nosy: +brett.cannon

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



  1   2   >