[issue13538] Improve doc for str(bytesobject)

2012-10-16 Thread Chris Jerdonek

Chris Jerdonek added the comment:

Attaching updated patch based on Ezio and Antoine's comments.  Let me know if 
I'm not using the correct or preferred terminology around buffer objects and 
the buffer protocol.

It doesn't seem like the section on the buffer protocol actually says what 
objects implementing the buffer protocol should be called.  I gather indirectly 
from the docs that such objects are called "buffer objects" (as opposed to just 
"buffers"):

http://docs.python.org/dev/c-api/buffer.html#bufferobjects

--
stage: needs patch -> patch review
Added file: http://bugs.python.org/file27591/issue-13538-2-default.patch

___
Python tracker 

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



[issue13538] Improve doc for str(bytesobject)

2012-10-16 Thread Chris Jerdonek

Chris Jerdonek added the comment:

Reattaching patch (a line was missing).

--
Added file: http://bugs.python.org/file27592/issue-13538-3-default.patch

___
Python tracker 

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



[issue15988] Inconsistency in overflow error messages of integer argument

2012-10-16 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
dependencies: +Possible integer overflow of PyLong_AsLong() results

___
Python tracker 

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



[issue16244] TimedRotatingFileHandler forces "write" mode, should use "append"

2012-10-16 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 6fcfe701502b by Vinay Sajip in branch '2.7':
Issue #16244: Remove file mode overrides.
http://hg.python.org/cpython/rev/6fcfe701502b

New changeset 5e770555be62 by Vinay Sajip in branch '3.2':
Issue #16244: Remove file mode overrides.
http://hg.python.org/cpython/rev/5e770555be62

New changeset 4f1287be26a6 by Vinay Sajip in branch '3.3':
Issue #16244: Merged change from 3.2.
http://hg.python.org/cpython/rev/4f1287be26a6

New changeset c20b0b5590db by Vinay Sajip in branch 'default':
Closes #16244: Merged change from 3.3.
http://hg.python.org/cpython/rev/c20b0b5590db

--
nosy: +python-dev
resolution:  -> fixed
stage:  -> 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



[issue16245] Update html.entities.html5 dictionary and parseentities.py

2012-10-16 Thread Ezio Melotti

New submission from Ezio Melotti:

A JSON file containing all the HTML5 entities is now available at 
http://dev.w3.org/html5/spec/entities.json.
I tested from the interpreter to see if it matches the values in 
html.entities.html5 and there are a dozen of entities that need to be updated:

>>> s = json.load(open('entities.json'))
>>> from html.entities import html5
>>> for (k1,i1),(k2,i2) in zip(sorted(s.items()), sorted(html5.items())):
...   if i1['characters'] != i2: (k1, k2, i1['characters'], i2, 
i1['codepoints'], list(map(ord, i2)))
... 
('⃜', 'DotDot;', '⃜', '◌⃜', [8412], [9676, 8412])
('̑', 'DownBreve;', '̑', '◌̑', [785], [9676, 785])
('⟨', 'LeftAngleBracket;', '⟨', '〈', [10216], [9001])
('
', 'NewLine;', '\n', '␊', [10], [9226])
('⟩', 'RightAngleBracket;', '⟩', '〉', [10217], [9002])
('	', 'Tab;', '\t', '␉', [9], [9225])
('⃛', 'TripleDot;', '⃛', '◌⃛', [8411], [9676, 8411])
('⟨', 'lang;', '⟨', '〈', [10216], [9001])
('⟨', 'langle;', '⟨', '〈', [10216], [9001])
('⟩', 'rang;', '⟩', '〉', [10217], [9002])
('⟩', 'rangle;', '⟩', '〉', [10217], [9002])
('⃛', 'tdot;', '⃛', '◌⃛', [8411], [9676, 8411])

The Tools/scripts/parseentities.py script should also be updated (or possibly a 
new, separate script should be added), so it can be used to generate the html5 
dict.  I'm setting this as release blocker so that the update gets done before 
the release (other values might change in the meanwhile).

--
assignee: ezio.melotti
messages: 173021
nosy: ezio.melotti
priority: release blocker
severity: normal
stage: needs patch
status: open
title: Update html.entities.html5 dictionary and parseentities.py
type: behavior
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



[issue16103] sys.stdin.readline 'unsupported' (IDLE 2.7.3, Win7, pythonw)

2012-10-16 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Yes, the first part of my post was about how it worked in regular interactive 
window: prints text, then prompt, then blinking underline cursor.

Python 2.7.3 (default, Apr 10 2012, 23:24:47) [MSC v.1500 64 bit (AMD64)] on 
win32 -- Win7 Professional, with all MS patches.

Are you running the apr 10 release or something compiled later, with the 
readline stub replaced?

Problem manifests in raw_input(): get same behavior of print prompt then crash 
when should display input cursor.

>>> raw_input('xyz')  # IDLE still
xyz
Traceback (most recent call last):
  File "", line 1, in 
raw_input('xyz')
UnsupportedOperation: readline

Problem really is sys.stdin.readline(), which is the dummy stub I quoted in 
first message.

>>> sys.stdin.readline()

Traceback (most recent call last):
  File "", line 1, in 
sys.stdin.readline()
UnsupportedOperation: readline

--
title: Help() fails at raw_input readline (IDLE 2.7.3, Win7, pythonw) -> 
sys.stdin.readline 'unsupported' (IDLE 2.7.3, Win7, pythonw)

___
Python tracker 

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



[issue16245] Update html.entities.html5 dictionary and parseentities.py

2012-10-16 Thread Kushal Das

Changes by Kushal Das :


--
nosy: +kushaldas

___
Python tracker 

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



[issue13538] Improve doc for str(bytesobject)

2012-10-16 Thread Ezio Melotti

Ezio Melotti added the comment:

+  str(bytes, encoding[, errors='strict'])
+  str(bytes, errors[, encoding='utf-8'])

Why not simply str(bytes, encoding='utf-8', errors='strict')? (Your signature 
suggests that str(b'abc', 'strict') should work.)

+   the string itself.  This behavior differs from :func:`repr` in that the

I'm not sure this is the right place where to explain the differences between 
__str__ and __repr__ (or maybe it is?).  Also doesn't str() falls back on 
__repr__ if __str__ is missing?  Does :meth:`__str__` link to object.__str__?

+   If *encoding* or *errors* is given,

and/or

+   (or :class:`bytearray`) object, then :func:`str` calls

I would use 'is equivalent to', rather than 'calls'.

+   :meth:`bytes.decode(encoding, errors) ` on the object
+   and returns the value.  Otherwise, the bytes object underlying the buffer
+   object is obtained before calling :meth:`bytes.decode() `.

:meth:`bytes.decode` should be enough.

+   Passing a :func:`bytes `

:func:`bytes` should be enough (if it isn't, maybe you want :func:`.bytes`).

--

___
Python tracker 

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



[issue15936] Add link from os.urandom to random.SystemRandom

2012-10-16 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 0a0b890508d3 by Andrew Svetlov in branch '3.3':
Issue #15936: Add link from os.urandom to random.SystemRandom
http://hg.python.org/cpython/rev/0a0b890508d3

New changeset 34c2bb737364 by Andrew Svetlov in branch 'default':
Merge issue #15936: Add link from os.urandom to random.SystemRandom
http://hg.python.org/cpython/rev/34c2bb737364

--
nosy: +python-dev

___
Python tracker 

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



[issue15936] Add link from os.urandom to random.SystemRandom

2012-10-16 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 2bff4969b65b by Andrew Svetlov in branch '2.7':
Issue #15936: Add link from os.urandom to random.SystemRandom
http://hg.python.org/cpython/rev/2bff4969b65b

--

___
Python tracker 

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



[issue15936] Add link from os.urandom to random.SystemRandom

2012-10-16 Thread Andrew Svetlov

Andrew Svetlov added the comment:

Fixed. Thanks.

--
nosy: +asvetlov
resolution:  -> fixed
stage: needs patch -> 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



[issue15936] Add link from os.urandom to random.SystemRandom

2012-10-16 Thread Roundup Robot

Roundup Robot added the comment:

New changeset c1f27cf0cc9d by Andrew Svetlov in branch '2.7':
Issue #15936: Reformat text for os.random to follow Larry Hastings suggestion
http://hg.python.org/cpython/rev/c1f27cf0cc9d

New changeset da8155ccf70b by Andrew Svetlov in branch '3.3':
Issue #15936: Reformat text for os.random to follow Larry Hastings suggestion
http://hg.python.org/cpython/rev/da8155ccf70b

New changeset bd3647e9ac62 by Andrew Svetlov in branch 'default':
Merge issue #15936: Reformat text for os.random to follow Larry Hastings 
suggestion
http://hg.python.org/cpython/rev/bd3647e9ac62

--

___
Python tracker 

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



[issue15988] Inconsistency in overflow error messages of integer argument

2012-10-16 Thread Mark Dickinson

Changes by Mark Dickinson :


--
nosy: +mark.dickinson

___
Python tracker 

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



[issue16103] sys.stdin.readline 'unsupported' (IDLE 2.7.3, Win7, pythonw)

2012-10-16 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Check patch for issue9290.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue16103] sys.stdin.readline 'unsupported' (IDLE 2.7.3, Win7, pythonw)

2012-10-16 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

What type of sys.stdin? Try run in "no subprocess" mode (-n).

--

___
Python tracker 

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



[issue16245] Update html.entities.html5 dictionary and parseentities.py

2012-10-16 Thread Ezio Melotti

Changes by Ezio Melotti :


--
keywords: +patch
Added file: http://bugs.python.org/file27593/issue16245.diff

___
Python tracker 

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



[issue15833] most failures to write byte-compiled file no longer suppressed

2012-10-16 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 53ce30b62de2 by Trent Nelson in branch '3.3':
Issue #15833: don't raise an exception if importlib can't write byte-compiled
http://hg.python.org/cpython/rev/53ce30b62de2

--
nosy: +python-dev

___
Python tracker 

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



[issue15833] most failures to write byte-compiled file no longer suppressed

2012-10-16 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 36b2ca7dc893 by Trent Nelson in branch 'default':
Merge issue #15833: don't raise an exception if importlib can't write
http://hg.python.org/cpython/rev/36b2ca7dc893

--

___
Python tracker 

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



[issue15833] most failures to write byte-compiled file no longer suppressed

2012-10-16 Thread Trent Nelson

Trent Nelson added the comment:

Charles' patch applied in 3.3 and merged to 3.x.  Thanks Charles.

--
resolution:  -> fixed
stage:  -> 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



[issue16245] Update html.entities.html5 dictionary and parseentities.py

2012-10-16 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue16246] Multiprocessing infinite loop on Windows

2012-10-16 Thread Ethan Furman

New submission from Ethan Furman:

On Windows multiprocessing has a well known limitation: because there is no 
fork() new shells must be invoked, and if the call that ultimately starts 
multiprocessing is not guarded by an `if __name__ == '__main___'` check an 
infinite loops results and you have a very nice brick instead of a computer.

On Stackoverflow I proposed a work-around [1], which is basically to check if 
an environment variable exists (MP_GUARD is this case), and if it does raise an 
exception.

I'm going to try and merge that into multiprocessing itself.  Are there any 
other platforms besides Windows where this is a problem?

[1] http://stackoverflow.com/q/12852643/208880

--
components: Windows
messages: 173033
nosy: amaury.forgeotdarc, jnoller, stoneleaf
priority: normal
severity: normal
status: open
title: Multiprocessing infinite loop on Windows
versions: Python 2.7, Python 3.1, 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



[issue15298] _sysconfigdata is generated in srcdir, not builddir

2012-10-16 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 24d52d3060e8 by Trent Nelson in branch '3.3':
Issue #15298: ensure _sysconfigdata is generated in build directory,
http://hg.python.org/cpython/rev/24d52d3060e8

New changeset f85c3f4d9b98 by Trent Nelson in branch 'default':
Merge issue #15298: ensure _sysconfigdata is generated in build directory,
http://hg.python.org/cpython/rev/f85c3f4d9b98

--
nosy: +python-dev

___
Python tracker 

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



[issue16247] Report failing url in URLError?

2012-10-16 Thread Nick Coghlan

New submission from Nick Coghlan:

Trying to streamline the URL retrieval example in the concurrent.futures docs 
were severely hampered by the fact the URLError thrown by urlopen doesn't tell 
you *what URL* it was trying to retrieve when it failed.

This is OK in synchronous code (where you probably still have the URL around), 
but quite a pain in asynchronous code (such as that using concurrent.futures) 
where the original context may have been lost by the time the future is 
signalled.

--
messages: 173035
nosy: ncoghlan
priority: normal
severity: normal
status: open
title: Report failing url in URLError?

___
Python tracker 

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



[issue16247] Report failing url in URLError?

2012-10-16 Thread Ezio Melotti

Ezio Melotti added the comment:

See also #10836 and msg172988.

--
components: +Library (Lib)
nosy: +ezio.melotti
stage:  -> needs patch
type:  -> behavior
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



[issue16151] Deferred KeyboardInterrupt in interactive mode

2012-10-16 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc added the comment:

My Python interpreter does not have auto-completion.  Do you import something 
special at startup?

--
nosy: +amaury.forgeotdarc

___
Python tracker 

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



[issue15819] Unable to build Python out-of-tree when source tree is readonly.

2012-10-16 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 617591e7d708 by Trent Nelson in branch '3.2':
Issue #15819: additional fixes for out-of-tree builds from read-only src.
http://hg.python.org/cpython/rev/617591e7d708

New changeset abb00e23681a by Trent Nelson in branch '3.3':
Merge issue #15819: additional fixes for out-of-tree builds from read-only src.
http://hg.python.org/cpython/rev/abb00e23681a

New changeset 3420fbd87646 by Trent Nelson in branch 'default':
Merge issue #15819: additional fixes for out-of-tree builds from read-only src.
http://hg.python.org/cpython/rev/3420fbd87646

--

___
Python tracker 

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



[issue16246] Multiprocessing infinite loop on Windows

2012-10-16 Thread R. David Murray

Changes by R. David Murray :


--
nosy: +sbt
type:  -> behavior
versions: +Python 3.4 -Python 3.1

___
Python tracker 

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



[issue16151] Deferred KeyboardInterrupt in interactive mode

2012-10-16 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Nothing. I think it depends if Python was build with readline support.

--

___
Python tracker 

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



[issue16246] Multiprocessing infinite loop on Windows

2012-10-16 Thread Tim Golden

Tim Golden added the comment:

The natural way to do this in windows is using the Job API:

http://msdn.microsoft.com/en-us/library/windows/desktop/ms684161%28v=vs.85%29.aspx

However I'm not sure where to apply this within the multiprocessing
architecture (or if it's even a good idea).

--
nosy: +tim.golden

___
Python tracker 

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



[issue15819] Unable to build Python out-of-tree when source tree is readonly.

2012-10-16 Thread Roundup Robot

Roundup Robot added the comment:

New changeset e0a2b14a3cf9 by Trent Nelson in branch '2.7':
Issue #15819: additional fixes for out-of-tree builds from read-only src.
http://hg.python.org/cpython/rev/e0a2b14a3cf9

--

___
Python tracker 

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



[issue15819] Unable to build Python out-of-tree when source tree is readonly.

2012-10-16 Thread Trent Nelson

Trent Nelson added the comment:

Things should be looking a lot better now across the board.  I just committed 
fixes where appropriate to 2.7, 3.2, 3.3 and 3.x for this issue and two related 
issues: 

http://bugs.python.org/issue15298
http://bugs.python.org/issue15833

The only thing that stands out now for 3.[23x] is $(srcdir)/Lib/$(PLATDIR).  Do 
we need a patch along the following lines?

% hg diff
diff -r 617591e7d708 Makefile.pre.in
--- a/Makefile.pre.in   Tue Oct 16 08:41:32 2012 -0400
+++ b/Makefile.pre.in   Tue Oct 16 09:46:53 2012 -0400
@@ -947,7 +947,7 @@
multiprocessing multiprocessing/dummy \
unittest unittest/test \
curses pydoc_data $(MACHDEPS)
-libinstall:build_all $(srcdir)/Lib/$(PLATDIR) $(srcdir)/Modules/xxmodule.c
+libinstall:build_all Lib/$(PLATDIR) $(srcdir)/Modules/xxmodule.c
@for i in $(SCRIPTDIR) $(LIBDEST); \
do \
if test ! -d $(DESTDIR)$$i; then \
@@ -1031,14 +1031,14 @@
./$(BUILDPYTHON) -m lib2to3.pgen2.driver 
$(DESTDIR)$(LIBDEST)/lib2to3/PatternGrammar.txt
 
 # Create the PLATDIR source directory, if one wasn't distributed..
-$(srcdir)/Lib/$(PLATDIR):
-   mkdir $(srcdir)/Lib/$(PLATDIR)
-   cp $(srcdir)/Lib/plat-generic/regen $(srcdir)/Lib/$(PLATDIR)/regen
+Lib/$(PLATDIR):
+   mkdir Lib/$(PLATDIR)
+   cp $(srcdir)/Lib/plat-generic/regen Lib/$(PLATDIR)/regen
export PATH; PATH="`pwd`:$$PATH"; \
export PYTHONPATH; PYTHONPATH="`pwd`/Lib"; \
export DYLD_FRAMEWORK_PATH; DYLD_FRAMEWORK_PATH="`pwd`"; \
export EXE; EXE="$(BUILDEXE)"; \
-   cd $(srcdir)/Lib/$(PLATDIR); $(RUNSHARED) ./regen
+   cd Lib/$(PLATDIR); $(RUNSHARED) ./regen
 
 python-config: $(srcdir)/Misc/python-config.in
# Substitution happens here, as the completely-expanded BINDIR

--
nosy: +pitrou

___
Python tracker 

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



[issue16246] Multiprocessing infinite loop on Windows

2012-10-16 Thread Richard Oudkerk

Richard Oudkerk added the comment:

I think this is a duplicate of Issue #15646 which has been fixed in the 2.7 and 
3.x branches.

If you run Lib/test/mp_fork_bomb.py you should get a RuntimeError with a 
helpful message telling you to use the 'if __name__ == "__main__"' idiom.

--
resolution:  -> duplicate
stage:  -> committed/rejected
status: open -> pending
superseder:  -> multiprocessing can do equivalent of a fork bomb on Windows

___
Python tracker 

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



[issue16103] sys.stdin.readline 'unsupported' (IDLE 2.7.3, Win7, pythonw)

2012-10-16 Thread Roger Serwy

Roger Serwy added the comment:

I am running 2.7.3 from Apr 10, 2012, freshly installed. I still can not 
reproduce this problem when running IDLE with or without a subprocess. 

Is your PyShell.py file the original or was it modified by accident? It may be 
possible that run.py was modified as well and is failing to register stdin 
correctly.

--

___
Python tracker 

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



[issue15833] most failures to write byte-compiled file no longer suppressed

2012-10-16 Thread Charles-François Natali

Charles-François Natali added the comment:

> Charles' patch applied in 3.3 and merged to 3.x.  Thanks Charles.

Thanks for taking care of this!

--

___
Python tracker 

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



[issue15819] Unable to build Python out-of-tree when source tree is readonly.

2012-10-16 Thread Roundup Robot

Roundup Robot added the comment:

New changeset c35db4960d1c by Trent Nelson in branch '2.7':
Issue #15819: tweak logic in previous commit (e0a2b14a3cf9).
http://hg.python.org/cpython/rev/c35db4960d1c

New changeset 5707c8a36cc0 by Trent Nelson in branch '3.2':
Issue #15819: tweak logic in previous commit (617591e7d708).
http://hg.python.org/cpython/rev/5707c8a36cc0

New changeset 85863c4a93db by Trent Nelson in branch '3.3':
Merge issue #15819: tweak logic in previous commit.
http://hg.python.org/cpython/rev/85863c4a93db

New changeset d282018bff10 by Trent Nelson in branch 'default':
Merge issue #15819: tweak logic in previous commit.
http://hg.python.org/cpython/rev/d282018bff10

--

___
Python tracker 

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



[issue16248] Security bug in tkinter allows for untrusted code execution.

2012-10-16 Thread Ramchandra Apte

New submission from Ramchandra Apte:

Because tkinter.py uses exec to execute code from a file, it has a security 
bug. It searches for the file in the home dir. Apparently, on my system (don't 
know if its the same on others), the $HOME variable is the same as the non-root 
one when running Python with root priveleges
Steps to reproduce:
create a file called .Tk.py in your home folder
Whatever code is in that file will be executed.

run these three lines of code in Python:

import tkinter
w = tkinter.Tk()
w.mainloop()

I will add more details in later comments.

--
components: Tkinter
messages: 173047
nosy: ramchandra.apte
priority: normal
severity: normal
status: open
title: Security bug in tkinter allows for untrusted code execution.

___
Python tracker 

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



[issue16248] Security bug in tkinter allows for untrusted code execution.

2012-10-16 Thread Ramchandra Apte

Changes by Ramchandra Apte :


--
type:  -> security

___
Python tracker 

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



[issue16248] Security bug in tkinter allows for untrusted code execution.

2012-10-16 Thread Ramchandra Apte

Ramchandra Apte added the comment:

s/tkinter.py/tkinter.__init__

--

___
Python tracker 

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



[issue16249] unicode name accepts a punctuation glyph

2012-10-16 Thread julien tayon

New submission from julien tayon:

I guess unicode variable names are restricted to letters, and that symbols and 
punctuation shoud be ignored (except _).

I have tested other dots (punctuation) they dont work. 

Only
http://www.fileformat.info/info/unicode/char/00b7/index.htm
oddly enough has worked so far.


$ python3.2
Python 3.2.3 (default, Sep 10 2012, 18:14:40) 
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> foo⋅bar=42
  File "", line 1
foo⋅bar=42
^
SyntaxError: invalid character in identifier
>>> print(ord("foo⋅bar"[3]))
8901
>>> foo·bar = 42
>>> print(ord("foo·bar"[3]))
183

I have sampled randomly in the same block as MIDDLE DOT and it seems to behave 
correctly.

--
components: Interpreter Core
messages: 173049
nosy: julien.tayon
priority: normal
severity: normal
status: open
title: unicode name accepts a punctuation glyph
type: behavior
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



[issue16248] Security bug in tkinter allows for untrusted code execution.

2012-10-16 Thread Ramchandra Apte

Ramchandra Apte added the comment:

In Lib/tkinter/__init__.py:1801 , the readprofile function executes untrusted 
code.

--

___
Python tracker 

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



[issue16248] Security bug in tkinter allows for untrusted code execution.

2012-10-16 Thread Ramchandra Apte

Ramchandra Apte added the comment:

specifically, when running Python using sudo (not in a root shell), the $HOME 
variable is preserved.

--

___
Python tracker 

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



[issue16249] unicode name accepts a punctuation glyph

2012-10-16 Thread R. David Murray

R. David Murray added the comment:

The rules for python identifiers are documented here:

  http://docs.python.org/dev/reference/lexical_analysis.html#identifiers

Are you saying that the behavior does not match the documentation?

--
nosy: +r.david.murray

___
Python tracker 

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



[issue10836] urllib.request.urlretrieve calls URLError with 3 args

2012-10-16 Thread Chris Jerdonek

Chris Jerdonek added the comment:

> This should be reported in another issue though.

Has this been done?

--
nosy: +chris.jerdonek

___
Python tracker 

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



[issue10836] urllib.request.urlretrieve calls URLError with 3 args

2012-10-16 Thread Ezio Melotti

Ezio Melotti added the comment:

Nick reported #16247 today which is very similar.

--
nosy: +ncoghlan

___
Python tracker 

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



[issue16249] unicode name accepts a punctuation glyph

2012-10-16 Thread julien tayon

julien tayon added the comment:

http://www.fileformat.info/info/unicode/char/b7/index.htm

the unicode category is Po (Ponctuation). 

Empirically, it cannot start a variable name so according to the rules given in 
the lexical analyser it should be one of : Mn, Mc, Nd, Pc

Which is not the case Po not in [ Mn, Mc, Nd, Pc ].

Modulo my weak brain, it does not seem right.

--

___
Python tracker 

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



[issue16249] unicode name accepts a punctuation glyph

2012-10-16 Thread Ezio Melotti

Ezio Melotti added the comment:

The characters with the Other_ID_Continue property are also included, i.e.:

00B7  ; Other_ID_Continue # Po   MIDDLE DOT
0387  ; Other_ID_Continue # Po   GREEK ANO TELEIA
1369..1371; Other_ID_Continue # No   [9] ETHIOPIC DIGIT ONE..ETHIOPIC DIGIT 
NINE
19DA  ; Other_ID_Continue # No   NEW TAI LUE THAM DIGIT ONE

See http://unicode.org/Public/UNIDATA/PropList.txt

--
assignee:  -> ezio.melotti
nosy: +ezio.melotti
resolution:  -> invalid
stage:  -> 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



[issue7512] shutil.copystat may fail EOPNOTSUPP

2012-10-16 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Tests added in issue14662. This issue can be closed.

--
nosy: +serhiy.storchaka
status: pending -> open

___
Python tracker 

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



[issue16250] URLError invoked with reason as filename

2012-10-16 Thread Chris Jerdonek

New submission from Chris Jerdonek:

This issue is to fix invocations of URLError so that "reasons" are not passed 
in for the "filename" argument of the URLError constructor.

Ezio found and described this issue when commenting on issue 10836:

  http://bugs.python.org/issue10836#msg172988

In more detail: URLError accepts "reason" and "filename" arguments:

http://hg.python.org/cpython/file/74b95194ba86/Lib/urllib/error.py#l23

However, in several places in Lib/urllib, URLError is invoked with a "reason" 
passed in for the filename.  For example:

raise URLError('local file error', 'not on local host')

This issue could be addressed for this example by changing the above to:

raise URLError('local file error: not on local host')

This dovetails with issue #16247, which is to start passing the actual filename 
in for some calls to URLError (and perhaps to adjust URLError's __str__, etc).

--
components: Library (Lib)
keywords: easy
messages: 173058
nosy: chris.jerdonek, ezio.melotti
priority: normal
severity: normal
status: open
title: URLError invoked with reason as filename
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



[issue10836] urllib.request.urlretrieve calls URLError with 3 args

2012-10-16 Thread Chris Jerdonek

Chris Jerdonek added the comment:

For tracking purposes, I created issue 16250 for what you observed above, which 
as you said is related to but not the same as Nick's issue 16247.

--

___
Python tracker 

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



[issue16250] URLError invoked with reason as filename

2012-10-16 Thread Senthil Kumaran

Changes by Senthil Kumaran :


--
nosy: +orsenthil

___
Python tracker 

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



[issue16250] URLError invoked with reason as filename

2012-10-16 Thread Ezio Melotti

Changes by Ezio Melotti :


--
nosy: +ncoghlan

___
Python tracker 

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



[issue16250] URLError invoked with reason as filename

2012-10-16 Thread Chris Jerdonek

Chris Jerdonek added the comment:

> raise URLError('local file error: not on local host')

I should also point out that URLError invocations with formats like the above 
already do occur in Lib/urllib/request.py.  For example:

raise URLError('ftp error: no host given')
exc = URLError('ftp error: %s' % msg)
raise URLError("http protocol error: bad status line")

--

___
Python tracker 

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



[issue5476] datetime: timedelta(minutes = i) silently fails with numpy.int32 input

2012-10-16 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

It is more than 6 months old with no activity.

--
nosy: +serhiy.storchaka
status: pending -> open

___
Python tracker 

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



[issue2263] struct.pack() + numpy int raises SystemError

2012-10-16 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

FYI Py_TPFLAGS_INT_SUBCLASS already not used in Python 3.x.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue5476] datetime: timedelta(minutes = i) silently fails with numpy.int32 input

2012-10-16 Thread Mark Dickinson

Changes by Mark Dickinson :


--
nosy: +mark.dickinson

___
Python tracker 

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



[issue5223] infinite recursion in PyErr_WriteUnraisable

2012-10-16 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

On 2.7 prints two 42, on 3.x fails (RuntimeError: maximum recursion depth 
exceeded in comparison) on first call. 2.6 out of date for non-security fix.

--
nosy: +serhiy.storchaka
status: pending -> open

___
Python tracker 

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



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

2012-10-16 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Here is a new patch checking that the sequence size didn't change. I also 
refactored the join() implementation into a shared function in stringlib.

--
Added file: http://bugs.python.org/file27594/bytes_join_buffers3.patch

___
Python tracker 

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



[issue13572] import _curses fails because of UnicodeDecodeError('utf8' codec can't decode byte 0xb5 ...') on ARM Ubuntu 3.x

2012-10-16 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Barry, you can reproduce it? The issue obviously in PyUnicode_FromString() call 
from PyCursesWindow_GetKey(). We can try latin1 encoding, locale encoding or 
utf-8 with surrogateescape error handler.

--
nosy: +serhiy.storchaka
status: pending -> open

___
Python tracker 

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



[issue16251] object.__reduce__()

2012-10-16 Thread Eric Snow

New submission from Eric Snow:

In Objects/typeobject.c, reduce_2() makes _PyObject_GetAttrId() calls to pull 
some methods for the object in question.  This is a problem when the object's 
type defines __getattr__() or __getattribute__() and returns something like 
None when the attribute is not found:


from copy import deepcopy

class Spam(dict):
def __getattr__(self, name):
# defaults to None
return self.get(name)

deepcopy(Spam(ham=5))


While we could do a check on the result of _PyObject_GetAttrId() to make sure 
it is callable, the better solution would be to look up the methods on the 
object's type rather than on the object.  Doing so falls in line with the 
specified pattern for special method lookup [1].  I'm guessing there are a few 
other related places in typeobject.c that have the same problem which could be 
fixed in the same way.

I'm marking this as a bug rather than a feature since it is a deviation from 
the specification for special methods.

[1] http://docs.python.org/dev/reference/datamodel.html#special-method-lookup

--
components: Interpreter Core
messages: 173066
nosy: eric.snow
priority: normal
severity: normal
stage: needs patch
status: open
title: object.__reduce__()
type: behavior
versions: Python 2.7, 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



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

2012-10-16 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I added new comments. :-(

--

___
Python tracker 

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



[issue16251] object.__reduce__()

2012-10-16 Thread Benjamin Peterson

Benjamin Peterson added the comment:

pickle and _pickle also look on the instance for __reduce__ and __reduce_ex__.

--
nosy: +benjamin.peterson

___
Python tracker 

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



[issue16251] some special methods are looked up on the instance rather than the type

2012-10-16 Thread Eric Snow

Changes by Eric Snow :


--
title: object.__reduce__() -> some special methods are looked up on the 
instance rather than the type

___
Python tracker 

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



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

2012-10-16 Thread Antoine Pitrou

Antoine Pitrou added the comment:

> I added new comments. :-(

Thanks. I think I will commit after adding the missing #undef :-)

--

___
Python tracker 

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



[issue13572] import _curses fails because of UnicodeDecodeError('utf8' codec can't decode byte 0xb5 ...') on ARM Ubuntu 3.x

2012-10-16 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Here are three patches. I think one of them (or any) should fix the issue. The 
question is what solution returns more suitable result for non-ascii key 
names.

--
keywords: +patch
Added file: 
http://bugs.python.org/file27595/curses_getkey_utf8_surrogateescape.patch
Added file: http://bugs.python.org/file27596/curses_getkey_latin1.patch
Added file: http://bugs.python.org/file27597/curses_getkey_locale.patch

___
Python tracker 

___diff -r bd3647e9ac62 Modules/_cursesmodule.c
--- a/Modules/_cursesmodule.c   Tue Oct 16 13:52:53 2012 +0300
+++ b/Modules/_cursesmodule.c   Tue Oct 16 21:53:38 2012 +0300
@@ -1144,12 +1144,20 @@
 return Py_BuildValue("C", rtn);
 } else {
 const char *knp;
+size_t size;
 #if defined(__NetBSD__)
 knp = unctrl(rtn);
 #else
 knp = keyname(rtn);
 #endif
-return PyUnicode_FromString((knp == NULL) ? "" : knp);
+if (knp == NULL)
+return PyUnicode_FromStringAndSize(NULL, 0);
+size = strlen(knp);
+if (size > PY_SSIZE_T_MAX) {
+PyErr_SetString(PyExc_OverflowError, "input too long");
+return NULL;
+}
+return PyUnicode_DecodeUTF8Stateful(knp, (Py_ssize_t)size, 
"surrogateescape", NULL);
 }
 }
 
diff -r bd3647e9ac62 Modules/_cursesmodule.c
--- a/Modules/_cursesmodule.c   Tue Oct 16 13:52:53 2012 +0300
+++ b/Modules/_cursesmodule.c   Tue Oct 16 21:54:08 2012 +0300
@@ -1144,12 +1144,20 @@
 return Py_BuildValue("C", rtn);
 } else {
 const char *knp;
+size_t size;
 #if defined(__NetBSD__)
 knp = unctrl(rtn);
 #else
 knp = keyname(rtn);
 #endif
-return PyUnicode_FromString((knp == NULL) ? "" : knp);
+if (knp == NULL)
+return PyUnicode_FromStringAndSize(NULL, 0);
+size = strlen(knp);
+if (size > PY_SSIZE_T_MAX) {
+PyErr_SetString(PyExc_OverflowError, "input too long");
+return NULL;
+}
+return PyUnicode_DecodeLatin1(knp, (Py_ssize_t)size, NULL);
 }
 }
 
diff -r bd3647e9ac62 Modules/_cursesmodule.c
--- a/Modules/_cursesmodule.c   Tue Oct 16 13:52:53 2012 +0300
+++ b/Modules/_cursesmodule.c   Tue Oct 16 21:54:40 2012 +0300
@@ -1144,12 +1144,20 @@
 return Py_BuildValue("C", rtn);
 } else {
 const char *knp;
+size_t size;
 #if defined(__NetBSD__)
 knp = unctrl(rtn);
 #else
 knp = keyname(rtn);
 #endif
-return PyUnicode_FromString((knp == NULL) ? "" : knp);
+if (knp == NULL)
+return PyUnicode_FromStringAndSize(NULL, 0);
+size = strlen(knp);
+if (size > PY_SSIZE_T_MAX) {
+PyErr_SetString(PyExc_OverflowError, "input too long");
+return NULL;
+}
+return PyUnicode_DecodeLocaleAndSize(knp, (Py_ssize_t)size, NULL);
 }
 }
 
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16103] sys.stdin.readline 'unsupported' (IDLE 2.7.3, Win7, pythonw)

2012-10-16 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Roger, you are partially right -- there are changes, but they were intentional. 
I updated the idlelib part of my installation to match the repository on July 9 
to incorporate the _RPCFile wrapping of of the three stdio files, including 
this:

-sys.stdin = self.console = self.get_remote_proxy("stdin")

+sys.stdin = self.console = _RPCFile(self.get_remote_proxy("stdin"))

>>> import sys
>>> sys.stdin


Sorry about forgetting this. Anyway, I presume you remember that issue. It 
seems that there is still a bug either in that update or its interaction with 
other code. What happens in linux with a fresh 2.7 build?

Serhiy's patch for #9290 replaces _RPCXyxFile with PseudoXyzFile subclasses of 
revised PseudoFile. If it works, it should fix this issue also.

--

___
Python tracker 

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



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

2012-10-16 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 16285c1b4dda by Antoine Pitrou in branch 'default':
Issue #15958: bytes.join and bytearray.join now accept arbitrary buffer objects.
http://hg.python.org/cpython/rev/16285c1b4dda

--
nosy: +python-dev

___
Python tracker 

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



[issue9290] IDLE and Command line present different behavior for sys.stdin

2012-10-16 Thread Terry J. Reedy

Terry J. Reedy added the comment:

I agree with the goal. We need an automated test for these proxies.

--
nosy: +terry.reedy

___
Python tracker 

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



[issue16252] bytes and bytearray methods are undocumented

2012-10-16 Thread Antoine Pitrou

New submission from Antoine Pitrou:

Everything is in the title. I couldn't find any doc for bytes.join, etc. (while 
str methods are documented in library/stdtypes.html#string-methods).

--
assignee: docs@python
components: Documentation
messages: 173074
nosy: docs@python, pitrou
priority: normal
severity: normal
stage: needs patch
status: open
title: bytes and bytearray methods are undocumented
type: behavior
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



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

2012-10-16 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Done now.

--

___
Python tracker 

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



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

2012-10-16 Thread Antoine Pitrou

Changes by Antoine Pitrou :


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



[issue16252] bytes and bytearray methods are undocumented

2012-10-16 Thread Ezio Melotti

Ezio Melotti added the comment:

http://docs.python.org/dev/library/stdtypes.html#bytes-and-bytearray-operations

"""
Due to the common use of ASCII text as the basis for binary protocols, bytes 
and bytearray objects provide almost all methods found on text strings, with 
the exceptions of:
"""

The additional methods are documented after that.

--
nosy: +ezio.melotti

___
Python tracker 

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



[issue16252] bytes and bytearray methods are undocumented

2012-10-16 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Ah, right. I guess a hyperlink to those methods wouldn't hurt, though :)

--

___
Python tracker 

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



[issue16252] bytes and bytearray methods are undocumented

2012-10-16 Thread Antoine Pitrou

Antoine Pitrou added the comment:

For the record, in the SSL socket docs, I listed the supported methods 
explicitly (http://docs.python.org/dev/library/ssl.html#ssl-sockets). I think 
it makes things clearer for the reader.

--

___
Python tracker 

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



[issue16251] pickle special methods are looked up on the instance rather than the type

2012-10-16 Thread Benjamin Peterson

Changes by Benjamin Peterson :


--
title: some special methods are looked up on the instance rather than the type 
-> pickle special methods are looked up on the instance rather than the type

___
Python tracker 

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



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

2012-10-16 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Well done.

However check at top of Objects/stringlib/join.h does not protect from using 
the file with asciilib or ucs1lib.

--

___
Python tracker 

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



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

2012-10-16 Thread Antoine Pitrou

Antoine Pitrou added the comment:

> However check at top of Objects/stringlib/join.h does not protect from using 
> the file with asciilib or ucs1lib.

I'm not sure that's a problem. Someone would have to go out of their way
to use join.h with only UCS1 unicode strings. Also tests would probably
start failing, since str.join doesn't have the right signature :-)

--

___
Python tracker 

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



[issue16253] Docs for PyArg_ParseTupleAndKeywords say it doesn't accept nested tuples

2012-10-16 Thread Roger Upole

New submission from Roger Upole:

The docs for this function state
"Nested tuples cannot be parsed when using keyword arguments!"
but this restriction was removed some time ago.

--
assignee: docs@python
components: Documentation
messages: 173081
nosy: docs@python, rupole
priority: normal
severity: normal
status: open
title: Docs for PyArg_ParseTupleAndKeywords say it doesn't accept nested tuples

___
Python tracker 

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



[issue5223] infinite recursion in PyErr_WriteUnraisable

2012-10-16 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Ok, so I would say this whole issue is out of date now, since maintained 
branches don't show the issue.

--
resolution:  -> out of date
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



[issue16251] pickle special methods are looked up on the instance rather than the type

2012-10-16 Thread Antoine Pitrou

Antoine Pitrou added the comment:

> I'm marking this as a bug rather than a feature since it is a deviation 
> from the specification for special methods.

It may still break some existing code, though (especially for people using 
proxies).

--
nosy: +pitrou

___
Python tracker 

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



[issue9290] IDLE and Command line present different behavior for sys.stdin

2012-10-16 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Unfortunately we have not a unittest framework for IDLE yet. After implementing 
issue15392 I will make tests for these proxies.

--

___
Python tracker 

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



[issue7512] shutil.copystat may fail EOPNOTSUPP

2012-10-16 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Ok, thanks.

--
resolution: accepted -> fixed
status: open -> closed

___
Python tracker 

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



[issue16252] bytes and bytearray methods are undocumented

2012-10-16 Thread Chris Jerdonek

Chris Jerdonek added the comment:

> I couldn't find any doc for bytes.join, etc.

One of the contributing factors to this is that bytes doesn't have its own 
class entry in the same way that, for example, list, dict, and memoryview have.

This creates a stumbling block for readers because they have to know to click 
on the "Bytes and Bytearray Operations" section as opposed to simply clicking 
on the type name as it is done for several other types.

With a class entry, locating where the methods are documented would be quicker 
and more intuitive.

--
nosy: +chris.jerdonek

___
Python tracker 

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



[issue15745] Numerous utime ns tests fail on FreeBSD w/ ZFS (update: and NetBSD w/ FFS, Solaris w/ UFS)

2012-10-16 Thread Trent Nelson

Trent Nelson added the comment:

I've figured out what the primary problem is on these platforms: os.stat() 
returns st_mtime and st_atime values with nanosecond resolution, but without a 
corresponding utimensat(), we can only affect time with microsecond precision 
via utimes().

Therefore, the following logic is faulty:

def _test_utime(self, filename, attr, utime, delta):
# Issue #13327 removed the requirement to pass None as the
# second argument. Check that the previous methods of passing
# a time tuple or None work in addition to no argument.
st0 = os.stat(filename)
# Doesn't set anything new, but sets the time tuple way
utime(filename, (attr(st0, "st_atime"), attr(st0, "st_mtime")))
# Setting the time to the time you just read, then reading again,
# should always return exactly the same times.
st1 = os.stat(filename)
self.assertEqual(attr(st0, "st_mtime"), attr(st1, "st_mtime"))
self.assertEqual(attr(st0, "st_atime"), attr(st1, "st_atime"))

--

___
Python tracker 

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



[issue16254] PyUnicode_AsWideCharString() increases string size

2012-10-16 Thread David Beazley

New submission from David Beazley:

The PyUnicode_AsWideCharString() function is described as creating a new buffer 
of type wchar_t allocated by PyMem_Alloc() (which must be freed by the user).   
However, if you use this function, it causes the size of the original string 
object to permanently increase.  For example, suppose you had some extension 
code like this:

static PyObject *py_receive_wchar(PyObject *self, PyObject *args) {
  PyObject *obj;
  wchar_t *s;
  Py_ssize_t len;

  if (!PyArg_ParseTuple(args, "U", &obj)) {
return NULL;
  }
  if ((s = PyUnicode_AsWideCharString(obj, &len)) == NULL) {
return NULL;
  }
  /* Do nothing */
  PyMem_Free(s);
  Py_RETURN_NONE;
}

Now, try an experiment (assume that the above extension function is available 
as 'receive_wchar'). 

>>> s = "Hell"*1000
>>> len(s)
4000
>>> import sys
>>> sys.getsizeof(s)
4049
>>> receive_wchar(s)
>>> sys.getsizeof(s)
20053
>>>

It seems that PyUnicode_AsWideCharString() may be filling in the wstr field of 
the associated PyASCIIObject structure from PEP393 (I haven't verified).  Once 
filled, it never seems to be discarded.

Background:  I am trying to figure out how to convert from Unicode to (wchar_t, 
int *) that doesn't cause a permanent increase in the memory footprint of the 
original Unicode object.  Also, I'm trying to stay away from deprecated Unicode 
APIs.

--
components: Extension Modules, Interpreter Core, Unicode
messages: 173089
nosy: dabeaz, ezio.melotti
priority: normal
severity: normal
status: open
title: PyUnicode_AsWideCharString() increases string size
versions: Python 3.3

___
Python tracker 

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



[issue10909] thread hang, possibly related to print

2012-10-16 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Is this issue reproduced now, with Python 2.7.3+?

Is this issue reproduced with issue9290 patch?

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue16254] PyUnicode_AsWideCharString() increases string size

2012-10-16 Thread David Beazley

David Beazley added the comment:

I should quickly add, is there any way to simply have this function not keep 
the wchar_t buffer around afterwards?   That would be great.

--

___
Python tracker 

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



[issue16105] Pass read only FD to signal.set_wakeup_fd

2012-10-16 Thread Felipe Cruz

Felipe Cruz added the comment:

I've followed latest suggestions.

Test and code updated.

--
Added file: http://bugs.python.org/file27598/issue16105_v4.patch

___
Python tracker 

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



[issue1529353] Squeezer - squeeze large output in the interpreter

2012-10-16 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
nosy: +serhiy.storchaka
versions: +Python 3.4 -Python 3.2

___
Python tracker 

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



[issue15744] missing tests for {RawIO,BufferedIO,TextIO}.writelines

2012-10-16 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
stage: needs patch -> patch review
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



[issue15745] Numerous utime ns tests fail on FreeBSD w/ ZFS (update: and NetBSD w/ FFS, Solaris w/ UFS)

2012-10-16 Thread Larry Hastings

Larry Hastings added the comment:

Is there a different utime family function on these platforms that *can* write 
atime/mtime with ns resolution?

--

___
Python tracker 

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



[issue16255] subrocess.Popen needs /bin/sh but Android only has /system/bin/sh

2012-10-16 Thread Ben Rousch

New submission from Ben Rousch:

The subprocess.Popen function uses /bin/sh in Unix environments. Android is 
detected as a Unix environemnt, but has moved that executable to 
/system/bin/sh. This can be worked around by adding a parameter 
"executable='/system/bin/sh'" to the call, but it is impractical to do this for 
every call to Popen in every library and codebase. For subprocess.Popen to work 
on Android, Popen needs to be able to detect if /bin/sh is not there and try 
/system/bin/sh instead.

--
components: Library (Lib)
messages: 173093
nosy: brousch
priority: normal
severity: normal
status: open
title: subrocess.Popen needs /bin/sh but Android only has /system/bin/sh
type: crash
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



[issue15745] Numerous utime ns tests fail on FreeBSD w/ ZFS (update: and NetBSD w/ FFS, Solaris w/ UFS)

2012-10-16 Thread Trent Nelson

Trent Nelson added the comment:

There doesn't appear to be on FreeBSD.  Although, on Solaris, -D__EXTENSIONS__ 
opens up access to utimensat() (at least on 11), so I'll factor that into 
configure.ac.

--

___
Python tracker 

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



[issue13220] print function unable while multiprocessing.Process is being run

2012-10-16 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

*nix has the same difference of behavior between interpreter and IDLE shell.

With issue9290 patch the "function f" line also printed. And then the script 
hangs.

--
nosy: +serhiy.storchaka
versions: +Python 2.7, 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



[issue15744] missing tests for {RawIO,BufferedIO,TextIO}.writelines

2012-10-16 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 4c204a61bd79 by Antoine Pitrou in branch '3.2':
Also add tests for TextIOWrapper.writelines() (issue #15744).
http://hg.python.org/cpython/rev/4c204a61bd79

New changeset 2efcaec45697 by Antoine Pitrou in branch '3.3':
Merge for issue #15744: add tests for the writelines() method of file objects.
http://hg.python.org/cpython/rev/2efcaec45697

New changeset e526d67016f0 by Antoine Pitrou in branch 'default':
Merge for issue #15744: add tests for the writelines() method of file objects.
http://hg.python.org/cpython/rev/e526d67016f0

--
nosy: +python-dev

___
Python tracker 

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



[issue15745] Numerous utime ns tests fail on FreeBSD w/ ZFS (update: and NetBSD w/ FFS, Solaris w/ UFS)

2012-10-16 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis :


--
nosy: +Arfrever

___
Python tracker 

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



[issue15853] IDLE crashes selecting Preferences menu with OS X ActiveState Tcl/Tk 8.5.12.1

2012-10-16 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



[issue15744] missing tests for {RawIO,BufferedIO,TextIO}.writelines

2012-10-16 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 5b062bb56037 by Antoine Pitrou in branch '2.7':
Also add tests for TextIOWrapper.writelines() (issue #15744).
http://hg.python.org/cpython/rev/5b062bb56037

--

___
Python tracker 

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



[issue13572] import _curses fails because of UnicodeDecodeError('utf8' codec can't decode byte 0xb5 ...') on ARM Ubuntu 3.x

2012-10-16 Thread Barry A. Warsaw

Barry A. Warsaw added the comment:

I cannot reproduce it with Python 3.3 hg head on my ARM buildbot.  _curses 
builds and imports just fine now.

--

___
Python tracker 

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



[issue15744] missing tests for {RawIO,BufferedIO,TextIO}.writelines

2012-10-16 Thread Antoine Pitrou

Antoine Pitrou added the comment:

I've committed a modified version of your patch. Thank you !

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



[issue16255] subrocess.Popen needs /bin/sh but Android only has /system/bin/sh

2012-10-16 Thread R. David Murray

R. David Murray added the comment:

Android really should not be breaking the standards that way.  We do want to 
support Android, but have you submitted a bug report to them?

--
nosy: +r.david.murray

___
Python tracker 

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



  1   2   >