[issue19619] Blacklist base64, hex, ... codecs from bytes.decode() and str.encode()

2014-02-12 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Is a bug which allows easily make DDOS attacks important enough? Every Python 
HTTP server, mail or news client is affected.

--

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



[issue20564] test_threadsignals.py failed on OpenBSD because too slow ( 3sec)

2014-02-12 Thread Charles-François Natali

Charles-François Natali added the comment:

Well, then it's definitely an OpenBSD bug, and we can't do anything
more than skip the test.

--

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



[issue20596] Support for alternate wcstok syntax for Windows compilers

2014-02-12 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

LGTM.

But perhaps it would be better to increase indent to 4 spaces in consistency 
with other indented code in this file.

--
stage:  - commit review

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



[issue6815] UnicodeDecodeError in os.path.expandvars

2014-02-12 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Brian, could you please test it on Windows?

--

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



[issue1529353] Squeezer - squeeze large output in the interpreter

2014-02-12 Thread Tal Einat

Changes by Tal Einat talei...@gmail.com:


--
nosy: +roger.serwy, terry.reedy

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



[issue17671] io.BufferedRWPair can use uninitialized members

2014-02-12 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 712b4665955d by Serhiy Storchaka in branch '2.7':
Issue #17671: Fixed a crash when use non-initialized io.BufferedRWPair.
http://hg.python.org/cpython/rev/712b4665955d

New changeset 25ff4625680d by Serhiy Storchaka in branch '3.3':
Issue #17671: Fixed a crash when use non-initialized io.BufferedRWPair.
http://hg.python.org/cpython/rev/25ff4625680d

New changeset f003ef13c555 by Serhiy Storchaka in branch 'default':
Issue #17671: Fixed a crash when use non-initialized io.BufferedRWPair.
http://hg.python.org/cpython/rev/f003ef13c555

--
nosy: +python-dev

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



[issue17671] io.BufferedRWPair can use uninitialized members

2014-02-12 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Thank you Stephen for your patch.

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

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



[issue6143] IDLE - an extension to clear the shell window

2014-02-12 Thread Tal Einat

Tal Einat added the comment:

Terry, if I wrote an appropriate patch, would it have a chance of being 
accepted?

--

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



[issue6143] IDLE - an extension to clear the shell window

2014-02-12 Thread Tal Einat

Changes by Tal Einat talei...@gmail.com:


--
nosy: +terry.reedy

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



[issue6143] IDLE - an extension to clear the shell window

2014-02-12 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Without having read the dialog to know what you mean by appropriate, and how a 
new patch would be different from Roger's 5 year old patch, or how this issue 
relates toSqueezer, yes. I have occasionally closed the shell and reopened 
(perhaps by running a file) to clear the shell. I would like to reduce the need 
for that by putting help output in a separate read-only output window. But 
there is still the occasional 2000 line traceback for hitting the recursion 
limit, and other mishaps.

--
versions:  -Python 3.2

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



[issue1529353] Squeezer - squeeze large output in the interpreter

2014-02-12 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Expanded text still makes IDLE unresponsible. Try print('a'*1000).

I think it will be better to output first 100 lines and a button More, 
pressing on which expands next 100 lines.

--

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



[issue20596] Support for alternate wcstok syntax for Windows compilers

2014-02-12 Thread STINNER Victor

STINNER Victor added the comment:

I don't think that #ifdef MS_WINDOWS is very useful, you can drop it. So get 
something simpler:

/* Portable macro for wcstok(): on Windows, it is not thread-safe, the state
 * argument is ignored, except if Visual Studio is used. */
#ifdef _MSC_VER
#  define Py_WCSTOK(str, tok, state)  wcstok_s(str, tok, state)
#elif defined(MS_WINDOWS)  !defined(__WATCOMC__)
#  define Py_WCSTOK(str, tok, state)  wcstok(str, tok)
#else
#  define Py_WCSTOK(str, tok, state)  wcstok(str, tok, state)
#endif

But I don't like #elif defined(MS_WINDOWS)  !defined(__WATCOMC__): what are 
the other compilers on Windows which provide wcstok() with 2 parameters?

--

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



[issue19466] Clear state of threads earlier in Python shutdown

2014-02-12 Thread STINNER Victor

STINNER Victor added the comment:

A new bug was found because of changes of this issue: #20526. IMO it is safer 
to revert changes of this issue in Python 3.4, it's too late to analyze such 
tricky bug. See #20526 for the discussion.

--
resolution: fixed - 
status: closed - open

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



[issue20526] python: Modules/gcmodule.c:379: visit_decref: Assertion `((gc)-gc.gc_refs (1)) != 0' failed.

2014-02-12 Thread STINNER Victor

STINNER Victor added the comment:

revert_19466.patch: Patch to revert changes of issue #19466. It restores how 
Python cleared threads in Python 3.3.

--
keywords: +patch
Added file: http://bugs.python.org/file34056/revert_19466.patch

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



[issue1529353] Squeezer - squeeze large output in the interpreter

2014-02-12 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

During experiments I got following message on terminal:

Exception in Tkinter callback
Traceback (most recent call last):
  File /home/serhiy/py/cpython/Lib/tkinter/__init__.py, line 1482, in __call__
return self.func(*args)
  File /home/serhiy/py/cpython/Lib/tkinter/__init__.py, line 534, in callit
func(*args)
  File /home/serhiy/py/cpython/Lib/idlelib/ToolTip.py, line 44, in showtip
x = self.button.winfo_rootx() + 20
  File /home/serhiy/py/cpython/Lib/tkinter/__init__.py, line 845, in 
winfo_rootx
self.tk.call('winfo', 'rootx', self._w))
_tkinter.TclError: bad window path name .3066068076.3066068332.text.3048812460

May be it is unrelated.

--

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



[issue6143] IDLE - an extension to clear the shell window

2014-02-12 Thread Tal Einat

Tal Einat added the comment:

The relation to Squeezer is that both of these can be useful when you've had a 
large amount of output written in the IDLE shell. I prefer Squeezer as a 
solution for this issue, for two reasons:

1. Squeezer catches long outputs before they are ever written in the Text 
widget, so the performance degradation doesn't happen at all. This also means 
that for truly huge outputs, Squeezer will still work, while otherwise IDLE may 
become completely stuck before a user would have a chance to clear the shell 
history.

2. Squeezer gives the user access to squeezed text in several ways: copy to 
the clipboard, open in an external viewer or expand into the shell. Otherwise 
the user must choose between a shell with some useless output hiding the useful 
history, or erasing the entire history.

Still, I still think clearing the history could be a useful feature, though. 
This is a common feature in terminals and it has been requested relatively 
often.

Note that making ClearWindow and Squeezer play together nicely is non-trivial. 
I'm likely going to have ClearWindow include special support for Squeezer.

--

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



[issue20526] python: Modules/gcmodule.c:379: visit_decref: Assertion `((gc)-gc.gc_refs (1)) != 0' failed.

2014-02-12 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com:


--
nosy: +Arfrever

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



[issue6143] IDLE - an extension to clear the shell window

2014-02-12 Thread Tal Einat

Tal Einat added the comment:

Also, note that the new version of Squeezer allows squeezing tracebacks as well 
as normal output! It does not squeeze them automatically, though; the user must 
do so manually.

--

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



[issue1529353] Squeezer - squeeze large output in the interpreter

2014-02-12 Thread Tal Einat

Tal Einat added the comment:

Regarding the tooltip traceback, seems like that could be related. I added a 
tooltip to the squeezed text buttons, with no delay, so perhaps there's some 
kind of race condition?

Could you try changing delay=0 in the code to delay=50 and see if the issue 
goes away?

I would test this myself if you could specify how to reproduce that error.

--

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



[issue1529353] Squeezer - squeeze large output in the interpreter

2014-02-12 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I'm not able to reproduce the problem after the first time (even with 
delay=0).

--

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



[issue13886] readline-related test_builtin failure

2014-02-12 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

This happens even when run test_builtin twice.

./python -E -m test -v test_builtin test_builtin

or

./python -E -m test -Fv test_builtin

--
nosy: +serhiy.storchaka

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



[issue20599] test_cleanup() of test_builtin failed

2014-02-12 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Unfortunately I can't reproduce this failure. We should look at how often this 
happens on buildbots. It is possible that adding flush=True in print() will 
solve the issue.

--
components: +Tests
keywords: +patch
type:  - behavior
Added file: http://bugs.python.org/file34057/issue20599_print_flush.patch

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



[issue20606] Operator Documentation Example doesn't work

2014-02-12 Thread silentbat

New submission from silentbat:

In the Docs for Python3.3
http://docs.python.org/3.3/library/operator.html#operator.__setitem__

the following example doesn't work.

--
assignee: docs@python
components: Documentation
messages: 211079
nosy: docs@python, silent.bat
priority: normal
severity: normal
status: open
title: Operator Documentation Example doesn't work
type: behavior
versions: Python 3.3

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



[issue20599] test_cleanup() of test_builtin failed

2014-02-12 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 7ecee9e0dc58 by Serhiy Storchaka in branch 'default':
Try to fix test_cleanup (issue #20599).
http://hg.python.org/cpython/rev/7ecee9e0dc58

--
nosy: +python-dev

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



[issue20583] Hide underscored parameters

2014-02-12 Thread Serhiy Storchaka

Changes by Serhiy Storchaka storch...@gmail.com:


--
resolution:  - rejected
stage:  - committed/rejected
status: open - closed

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



[issue20599] test_cleanup() of test_builtin failed

2014-02-12 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Failed builtbots:

http://buildbot.python.org/all/builders/AMD64%20Windows7%20SP1%203.x/builds/4072/steps/test/logs/stdio
http://buildbot.python.org/all/builders/x86%20XP-4%203.x/builds/10154/steps/test/logs/stdio
http://buildbot.python.org/all/builders/x86%20Windows%20Server%202008%20%5BSB%5D%203.x/builds/2308/steps/test/logs/stdio

--

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



[issue20605] test_socket (testGetaddrinfo) failing on OS X 10.6.8 (32-bit)

2014-02-12 Thread Geoffrey Spear

Geoffrey Spear added the comment:

Ned:

 socket.gethostbyname(localhost)
'127.0.0.1'

 socket.getaddrinfo(localhost, 00, 0, 0, 0, socket.AI_NUMERICSERV)
Traceback (most recent call last):
  File stdin, line 1, in module
  File /usr/local/lib/python3.4/socket.py, line 530, in getaddrinfo
for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno 8] nodename nor servname provided, or not known


And to show that using AI_NUMERICSERV isn't *completely* broken on my machine:

 socket.getaddrinfo(localhost, 80, 0, 0, 0, socket.AI_NUMERICSERV)
[(AddressFamily.AF_INET: 2, SocketType.SOCK_DGRAM: 2, 17, '', ('127.0.0.1', 
80)), (AddressFamily.AF_INET: 2, SocketType.SOCK_STREAM: 1, 6, '', 
('127.0.0.1', 80)), (AddressFamily.AF_INET6: 30, SocketType.SOCK_DGRAM: 2, 
17, '', ('::1', 80, 0, 0)), (AddressFamily.AF_INET6: 30, 
SocketType.SOCK_STREAM: 1, 6, '', ('::1', 80, 0, 0)), 
(AddressFamily.AF_INET6: 30, SocketType.SOCK_DGRAM: 2, 17, '', 
('fe80::1%lo0', 80, 0, 1)), (AddressFamily.AF_INET6: 30, 
SocketType.SOCK_STREAM: 1, 6, '', ('fe80::1%lo0', 80, 0, 1))]

--

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



[issue1529353] Squeezer - squeeze large output in the interpreter

2014-02-12 Thread Tal Einat

Tal Einat added the comment:

Indeed, expanding very long texts still degrades the performance of IDLE. But 
the user has to explicitly expand the text (by double-clicking the button) and 
can easily squeeze the text again.

As for your suggestion to show just the first several lines and a more... 
button, that would be a significantly more complex solution. It is already easy 
to preview the squeezed text, either by launching an external viewer or by 
copying the text to the clipboard.

Yes, a user could still get large amount of text in the shell by expanding 
large squeezed text. In other words, a user can still shoot himself in the 
foot; but now he'd have to purposefully aim the shotgun at his foot first.

--

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



[issue20599] test_cleanup() of test_builtin failed

2014-02-12 Thread STINNER Victor

STINNER Victor added the comment:

 It is possible that adding flush=True in print() will solve the issue.

I tried. It does not fix the issue.

Hint: On Windows, sys.stdout.encoding is a codec implemented in pure Python 
(ex: cp850). You should try to reproduce the issue on Linux using 
PYTHONIOENCODING=cp850.

Note: It looks like open() is no more available when C.__del__() is called.

--

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



[issue20591] Let braces be a constant

2014-02-12 Thread DhilipSiva

DhilipSiva added the comment:

While both of you disagree, I really liked STINNER Victor (haypo)'s comment. I 
feel dumb sending this patch. It makes myself think that this was a totally 
wrong thing to do. But Benjamin Peterson (benjamin.peterson)'s comment make me 
feel sad and Hurtful.

--

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



[issue20591] Let braces be a constant

2014-02-12 Thread SilentGhost

Changes by SilentGhost ghost@gmail.com:


--
resolution:  - rejected
status: open - closed

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



[issue20596] Support for alternate wcstok syntax for Windows compilers

2014-02-12 Thread Jeffrey Armstrong

Jeffrey Armstrong added the comment:

I know that Borland/Embarcadero also uses the two-argument version like 
Microsoft.  As I said earlier, MinGW uses the two-argument version, although it 
is currently marked as deprecated.  Just from searching, it appears that Pelles 
C/LCC uses the POSIX-like three-argument version.   I'm having trouble thinking 
of any further Windows C compilers at the moment.

The purpose of wrapping the definition in MS_WINDOWS originally was to preserve 
any behavior that already existed when building with a compiler that uses the 
two-argument version on Windows without any explicit case being called out for 
said compiler.

--

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



[issue20606] Operator Documentation Example doesn't work

2014-02-12 Thread Gareth Rees

Gareth Rees added the comment:

The failing example is:

d = {}
keys = range(256)
vals = map(chr, keys)
map(operator.setitem, [d]*len(keys), keys, vals)   

which works in Python 2 where map returns a list, but not in Python 3 where map 
returns an iterator.

Doc/library/operator.rst follows the example with this note:

.. XXX: find a better, readable, example

Additional problems with the example:

1. It's poorly motivated because a dictionary comprehension would be simpler 
and shorter:

d = {i: chr(i) for i in range(256)}

2. It's also unclear why you'd need this dictionary when you could just call 
the function chr (but I suppose some interface might require a dictionary 
rather than a function).

3. To force the map to be evaluated, you need to write list(map(...)) which 
allocates an unnecessary list object and then throws it away. To avoid the 
unnecessary allocation you could use the consume recipe from the itertools 
documentation and write collections.deque(map(...), maxlen=0) but this is 
surely too obscure to use as an example.

I had a look through the Python sources, and made an Ohloh Code search for 
operator.setitem and I didn't find any good examples of its use, so I think 
the best thing to do is just to delete the example.

http://code.ohloh.net/search?s=%22operator.setitem%22pp=0fl=Pythonmp=1ml=1me=1md=1ff=1filterChecked=true

--
nosy: +Gareth.Rees

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



[issue20606] Operator Documentation Example doesn't work

2014-02-12 Thread Gareth Rees

Changes by Gareth Rees g...@garethrees.org:


--
keywords: +patch
Added file: http://bugs.python.org/file34059/operator.patch

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



[issue20604] Missing invalid mode in error message of socket.makefile.

2014-02-12 Thread Berker Peksag

Changes by Berker Peksag berker.pek...@gmail.com:


--
nosy: +pitrou
versions:  -Python 3.5

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



[issue20607] multiprocessing cx_Freeze windows GUI bug ( easy fixes)

2014-02-12 Thread Mark Summerfield

New submission from Mark Summerfield:

I have a Python Windows GUI application (using PySide) that uses 
multiprocessing.

When I freeze the application I get error messages, in particular that 
mulitprocessing cannot call flush on a null object.

ISTM That in a Windows GUI application, sys.stdout and sys.stderr may well be 
None since there is no attached console.

So, I added guards to accesses to sys.stdout and sys.stderr and the problems 
went away.

I'm not used to creating patch diffs but hopefully the attached (with just a 
few lines of changes) will be easy to understand.

--
components: Windows
files: multiprocessing.diff
keywords: patch
messages: 211089
nosy: mark
priority: normal
severity: normal
status: open
title: multiprocessing cx_Freeze windows GUI bug ( easy fixes)
versions: Python 3.3
Added file: http://bugs.python.org/file34060/multiprocessing.diff

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



[issue20608] 'SyntaxError: invalid token' is unfriendly

2014-02-12 Thread Marius Gedminas

New submission from Marius Gedminas:

Type something like the following at the interpreter prompt:

 04208
  File stdin, line 1
04208
^
SyntaxError: invalid token


This is not very descriptive.  I suggest SyntaxError: invalid octal digit.

--
components: Interpreter Core
messages: 211090
nosy: mgedmin
priority: normal
severity: normal
status: open
title: 'SyntaxError: invalid token' is unfriendly
versions: Python 3.5

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



[issue20599] test_cleanup() of test_builtin failed

2014-02-12 Thread STINNER Victor

STINNER Victor added the comment:

Sorry, issue20599_ascii_ioencoding.patch doesn't fix the issue. (I also tested 
issue20599_ascii_ioencoding.patch + flush=True for print, it still fails 
sometimes.)

--

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



[issue20608] 'SyntaxError: invalid token' is unfriendly

2014-02-12 Thread Marius Gedminas

Marius Gedminas added the comment:

I was looking at the current hg tip.  The lexer emits E_TOKEN errors for the 
following cases:
- invalid hex digit
- invalid octal digit
- invalid binary digit
- invalid digit in float exponent
- old-style octal constant (e.g. 001), which is no longer accepted

I think I can come up with a patch that replaces them all with different error 
codes (E_BAD_HEX_DIGIT etc.) and different error messages.  Does that sound 
like an acceptable change?  (I never contributed non-documentation patches to 
CPython before.)

--

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



[issue20609] Always running kill_python breaks building x64 on 32-bit Windows machine

2014-02-12 Thread Zachary Ware

Changes by Zachary Ware zachary.w...@gmail.com:


--
nosy: +zach.ware

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



[issue20609] Always running kill_python breaks building x64 on 32-bit Windows machine

2014-02-12 Thread Stephan R.A. Deibel

New submission from Stephan R.A. Deibel:

The changes made in Issue19788 break the ability to build x64 build target on a 
32-bit Windows machine because PreBuildEvent entries in pythoncore.vcxproj end 
up trying to run the 64-bit kill_python.exe, causing critical build steps to 
fail.  Removing those PreBuildEvents by manually editing pythoncore.vcxproj 
served as a work-around.

--
components: Build
messages: 211093
nosy: sdeibel
priority: normal
severity: normal
status: open
title: Always running kill_python breaks building x64 on 32-bit Windows machine
type: compile error
versions: Python 3.4

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



[issue20610] Documentation with two slashes in URL links to v2.6.5c2

2014-02-12 Thread Daniel Ellis

New submission from Daniel Ellis:

I was searching for the documentation for itertools via Google and was sent 
here:

http://www.python.org/doc//current/library/itertools.html

After glancing at the upper-left hand corner, I wondered why Google was sending 
people to the 2.6 documentation, and a release candidate at that.  After 
checking out the URL, it became obvious that there's an issue somewhere in the 
Python docs that is causing this.

Quite a bizarre and obscure bug, but probably should be fixed since a major 
search engine is passing front-page search traffic there.

--
assignee: docs@python
components: Documentation
messages: 211094
nosy: Daniel.Ellis, docs@python
priority: normal
severity: normal
status: open
title: Documentation with two slashes in URL links to v2.6.5c2
versions: Python 2.7

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



[issue20611] socket.create_connection() doesn't handle EINTR properly

2014-02-12 Thread Florent Xicluna

New submission from Florent Xicluna:

I had this sporadic traceback in a project:

  File test.py, line 62, in module
result = do_lqs(client, str(dnvn))
  File test.py, line 25, in do_lqs
qualif_service_id = client.create('ti.qualif.service', {})
  File /srv/openerp/.buildout/eggs/ERPpeek-1.4.5-py2.6.egg/erppeek.py, line 
894, in wrapper
return self.execute(obj, method, *params, **kwargs)
  File /srv/openerp/.buildout/eggs/ERPpeek-1.4.5-py2.6.egg/erppeek.py, line 
636, in execute
res = self._execute(obj, method, *params)
  File /srv/openerp/.buildout/eggs/ERPpeek-1.4.5-py2.6.egg/erppeek.py, line 
361, in lambda
wrapper = lambda s, *args: s._dispatch(name, args)
  File /usr/lib/python2.6/xmlrpclib.py, line 1489, in __request
verbose=self.__verbose
  File /usr/lib/python2.6/xmlrpclib.py, line 1235, in request
self.send_content(h, request_body)
  File /usr/lib/python2.6/xmlrpclib.py, line 1349, in send_content
connection.endheaders()
  File /usr/lib/python2.6/httplib.py, line 908, in endheaders
self._send_output()
  File /usr/lib/python2.6/httplib.py, line 780, in _send_output
self.send(msg)
  File /usr/lib/python2.6/httplib.py, line 739, in send
self.connect()
  File /usr/lib/python2.6/httplib.py, line 1112, in connect
sock = socket.create_connection((self.host, self.port), self.timeout)
  File /usr/lib/python2.6/socket.py, line 561, in create_connection
raise error, msg
socket.error: [Errno 4] Interrupted system call



It seems that the EINTR should be caught by the standard library in all cases: 
http://bugs.python.org/issue1628205

But it's not the case for the socket.create_connection method (verified in 
3.3 and 2.7 source code).

--
components: IO, Library (Lib)
messages: 211095
nosy: flox
priority: normal
severity: normal
status: open
title: socket.create_connection() doesn't handle EINTR properly
type: behavior
versions: Python 2.7, Python 3.3, Python 3.4

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



[issue20611] socket.create_connection() doesn't handle EINTR properly

2014-02-12 Thread STINNER Victor

Changes by STINNER Victor victor.stin...@gmail.com:


--
nosy: +haypo, neologix

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



[issue20611] socket.create_connection() doesn't handle EINTR properly

2014-02-12 Thread Florent Xicluna

Changes by Florent Xicluna florent.xicl...@gmail.com:


--
nosy: +gregory.p.smith, pitrou

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



[issue15227] Fatal Python error: PyEval_RestoreThread: NULL tstate on example script..

2014-02-12 Thread T. Maslach

T. Maslach added the comment:

I just tried this in Python 2.7.6 and it works... So, it looks to be fixed!

--

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



[issue20587] sqlite3 converter not being called

2014-02-12 Thread Kathryn M Kowalski

Kathryn M Kowalski added the comment:

See attached file with output from both python versions.  It is using the 
converter as shown in demo2a.  The code using the converter was working on 2.5 
for years - it quit working on the move to 2.7 because it couldn't compare a 
datetime to the text string returned from the database.

--
Added file: http://bugs.python.org/file34061/demo2a.py

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



[issue20607] multiprocessing cx_Freeze windows GUI bug ( easy fixes)

2014-02-12 Thread Mark Summerfield

Mark Summerfield added the comment:

My change to managers.py is redundant; sorry about that.

--

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



[issue20526] python: Modules/gcmodule.c:379: visit_decref: Assertion `((gc)-gc.gc_refs (1)) != 0' failed.

2014-02-12 Thread Guido van Rossum

Changes by Guido van Rossum gu...@python.org:


--
nosy:  -gvanrossum

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



[issue20601] tracing and tests that raise an exception in a SIGALRM handler

2014-02-12 Thread Xavier de Gaye

Xavier de Gaye added the comment:

The following code shows that the trace function is removed when an alarm 
raises an exception and prints: 'trace function: None'

import sys, signal, time

def trace(frame, event, arg):
if frame.f_code.co_name == 'foo':
while 1:
time.sleep(.02)
return trace

def foo(): pass

def handler(*args):
1/0

sys.settrace(trace)
signal.signal(signal.SIGALRM, handler)
signal.alarm(1)
try:
foo()
except ZeroDivisionError:
pass

print('trace function:', sys.gettrace())

--

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



[issue20601] tracing and tests that raise an exception in a SIGALRM handler

2014-02-12 Thread STINNER Victor

STINNER Victor added the comment:

 Therefore, tests that raise an exception in an alarm handler should use the 
 support.no_tracing decorator as it is done in test_io.py at 
 check_reentrant_write().

I would prefer to fix the issue instead. A signal should not remove the trace 
function.

--
nosy: +haypo

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



[issue6815] UnicodeDecodeError in os.path.expandvars

2014-02-12 Thread Brian Curtin

Brian Curtin added the comment:

Sorry, I don't have a Windows environment setup right now.

--

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



[issue20591] Let braces be a constant

2014-02-12 Thread Benjamin Peterson

Benjamin Peterson added the comment:

It should be noted that foolish consistency is simply a reference to the 
quote in PEP 8, not a personal insult.

--

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



[issue20599] test_cleanup() of test_builtin failed

2014-02-12 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

What if use -u flag? utf-8 or utf_8 encoding?

--

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



[issue20608] 'SyntaxError: invalid token' is unfriendly

2014-02-12 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Note that invalid token is emitted only on invalid first digit:

 0b2
  File stdin, line 1
0b2
 ^
SyntaxError: invalid token
 0b02
  File stdin, line 1
0b02
   ^
SyntaxError: invalid syntax


See also issue1634034.

--
nosy: +serhiy.storchaka

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



[issue20599] test_cleanup() of test_builtin failed

2014-02-12 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 10ea3125d7b8 by Victor Stinner in branch 'default':
Issue #20599: Force ASCII encoding for stdout in test_cleanup() of test_builtin
http://hg.python.org/cpython/rev/10ea3125d7b8

--

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



[issue20599] test_cleanup() of test_builtin failed

2014-02-12 Thread STINNER Victor

STINNER Victor added the comment:

 Sorry, issue20599_ascii_ioencoding.patch doesn't fix the issue.

Sorry again, I didn't read issue20599_ascii_ioencoding.patch carefully: it 
doesn't make sense to use the isolated mode and to set a Python environment 
variable (PYTHONIOENCODING). The purpose of the isolated mode is to ignore all 
Python environment variables...

I (hope I) fixed the test, but in fact, the test showed another bug: print() 
cannot be used during Python exit in destructor. It means for example that 
Python may not be able to display errors at exit.

I don't know if this issue should be closed. Maybe a new issue should be opened 
to address the codec issue at exit?

--

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



[issue20609] Always running kill_python breaks building x64 on 32-bit Windows machine

2014-02-12 Thread Zachary Ware

Zachary Ware added the comment:

Oops...

Can you try out this patch and see if it will work for you?  It looks like it 
should work, but I'm not set up to build 64-bit at all yet, much less on 32-bit.

Tim, would you mind also taking a look since you tested #19788 for me and we're 
in RC for 3.4?

--
nosy: +tim.peters
versions: +Python 3.3

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



[issue20609] Always running kill_python breaks building x64 on 32-bit Windows machine

2014-02-12 Thread Stephan R.A. Deibel

Stephan R.A. Deibel added the comment:

There's no patch attached... or am I just confused?

--

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



[issue20609] Always running kill_python breaks building x64 on 32-bit Windows machine

2014-02-12 Thread Zachary Ware

Zachary Ware added the comment:

Forgot to attach the patch...

--
keywords: +patch
Added file: http://bugs.python.org/file34062/issue20609.diff

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



[issue20602] sys.flags and sys.float_info disappear at shutdown

2014-02-12 Thread STINNER Victor

Changes by STINNER Victor victor.stin...@gmail.com:


--
nosy: +haypo

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



[issue20609] Always running kill_python breaks building x64 on 32-bit Windows machine

2014-02-12 Thread Stephan R.A. Deibel

Stephan R.A. Deibel added the comment:

Yes, thanks, that patch fixes it so it builds successfully.  Tried w/ Python 
3.4rc1 on Windows 7 w/ VS2010.

Of course maybe it should really be building kill_python.exe for the matching 
architecture and running that, but I'm not sure how to do that and your fix is 
certainly far better than current behavior.

--

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



[issue20599] test_cleanup() of test_builtin failed

2014-02-12 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Now test fails with mystical error.

http://buildbot.python.org/all/builders/AMD64%20Windows7%20SP1%203.x/builds/4074/steps/test/logs/stdio
http://buildbot.python.org/all/builders/x86%20Windows%20Server%202008%20%5BSB%5D%203.x/builds/2312/steps/test/logs/stdio

==
FAIL: test_cleanup (test.test_builtin.ShutdownTest)
--
Traceback (most recent call last):
  File C:\buildbot.python.org\3.x.kloth-win64\build\lib\test\test_builtin.py, 
line 1628, in test_cleanup
__cleanenv=True)
  File 
C:\buildbot.python.org\3.x.kloth-win64\build\lib\test\script_helper.py, line 
69, in assert_python_ok
return _assert_python(True, *args, **env_vars)
  File 
C:\buildbot.python.org\3.x.kloth-win64\build\lib\test\script_helper.py, line 
55, in _assert_python
stderr follows:\n%s % (rc, err.decode('ascii', 'ignore')))
AssertionError: Process return code is 2147483651, stderr follows:
Fatal Python error: Failed to initialize Windows random API (CryptoGen)

--

--

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



[issue20599] test_cleanup() of test_builtin failed

2014-02-12 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

May be setting PYTHONHASHSEED will silence this error. But I afraid there is a 
real bug in initialization on Windows.

--

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



[issue20610] Documentation with two slashes in URL links to v2.6.5c2

2014-02-12 Thread Berker Peksag

Changes by Berker Peksag berker.pek...@gmail.com:


--
nosy: +georg.brandl

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



[issue20599] test_cleanup() of test_builtin failed

2014-02-12 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

 I (hope I) fixed the test, but in fact, the test showed another bug: print() 
 cannot be used during Python exit in destructor. It means for example that 
 Python may not be able to display errors at exit.

print() can be used during Python exit in destructor if destructor called 
before cleaning up the builtins and sys modules and encoding module with the 
encoding of sys.stdout.

Cleaning up the builtins and sys modules are delayed after wiping other 
modules, this decreases the chance of print() failure.

--

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



[issue20612] cElementTree has problems with StringIO object containing unicode content

2014-02-12 Thread Allan Crooks

New submission from Allan Crooks:

There seems to be a specific issue when using cElementTree.parse on a StringIO 
object containing unicode text - it generates a ParseError.

I've tried variations of ElementTree and cElementTree, variations of StringIO 
and cStringIO, and used str and unicode types. It seems there is one 
combination of these that generates the problem. I tried this on Python 2.7.5 - 
this bit of code shows the inconsistency we've got:

 from xml.etree import ElementTree as ET, cElementTree as CET
 from StringIO import StringIO as SIO
 from cStringIO import StringIO as CSIO
 xml, uxml = 'simple /', u'simple /'
 
 def parse(etree_impl, strio_class, text):
... try:
... return etree_impl.parse(strio_class(text))
... except Exception as e:
... return 'ERROR: ' + repr(e)
... 
 for etree_var in 'ET CET'.split():
... for sio_var in 'SIO CSIO'.split():
... for xml_var in 'xml uxml'.split():
... print etree_var, sio_var, xml_var,
... print parse(vars()[etree_var], vars()[sio_var], vars()[xml_var])
... 
ET SIO xml xml.etree.ElementTree.ElementTree object at 0x7f92c795ec90
ET SIO uxml xml.etree.ElementTree.ElementTree object at 0x7f92c795ec90
ET CSIO xml xml.etree.ElementTree.ElementTree object at 0x7f92c795ec90
ET CSIO uxml xml.etree.ElementTree.ElementTree object at 0x7f92c795ec90
CET SIO xml ElementTree object at 0x7f92c795ec90
CET SIO uxml ERROR: ParseError('no element found: line 1, column 0',)
CET CSIO xml ElementTree object at 0x7f92c795ec90
CET CSIO uxml ElementTree object at 0x7f92c795ec90

--
components: XML
messages: 24
nosy: amcone
priority: normal
severity: normal
status: open
title: cElementTree has problems with StringIO object containing unicode content
type: behavior
versions: Python 2.7

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



[issue20607] multiprocessing cx_Freeze windows GUI bug ( easy fixes)

2014-02-12 Thread Ned Deily

Changes by Ned Deily n...@acm.org:


--
nosy: +sbt

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



[issue20612] cElementTree has problems with StringIO object containing unicode content

2014-02-12 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

cStringIO.StringIO() can contains only str (unicode automatically coerced to 
str), while StringIO.StringIO() can contain str or unicode.

 SIO(uxml).read()
u'simple /'
 CSIO(uxml).read()
'simple /'

cElementTree.parse() works only with binary streams.

--
nosy: +serhiy.storchaka

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



[issue20609] Always running kill_python breaks building x64 on 32-bit Windows machine

2014-02-12 Thread Zachary Ware

Zachary Ware added the comment:

 Yes, thanks, that patch fixes it so it builds successfully.  Tried w/
 Python 3.4rc1 on Windows 7 w/ VS2010.

Ok, good.

 Of course maybe it should really be building kill_python.exe for the
 matching architecture and running that, but I'm not sure how to do that
 and your fix is certainly far better than current behavior.

kill_python(_d).exe looks for a Python from the same directory as it is run 
from (with the same debug status) which should always mean that if 
kill_python(_d).exe can't run, neither can the Python it would look for.  My 
goal with this patch is to make running kill_python a best effort thing and 
make it obvious when it didn't run properly, without killing the build.  If it 
should have run but wasn't able to, there will be louder errors later on, and 
the warning from the attempt to run it should help point out what went wrong.

--

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



[issue20609] Always running kill_python breaks building x64 on 32-bit Windows machine

2014-02-12 Thread Stephan R.A. Deibel

Stephan R.A. Deibel added the comment:

OK, sounds reasonable to me.

--

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



[issue7247] test_fcntl_64_bit from test_fcntl.py fails in Python 2.6.4

2014-02-12 Thread Geoffrey Spear

Geoffrey Spear added the comment:

Reproduced this on a Cr-48 Chromebook running ChrUbuntu 3.4.0 in Python 3.3.4 
and 3.4.0RC1. The kernel does appear to have been compiled with 
CONFIG_DNOTIFY=y, so that's not a complete solution.

--
nosy: +geoffreyspear
versions: +Python 3.3, Python 3.4

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



[issue20591] Let braces be a constant

2014-02-12 Thread Raymond Hettinger

Raymond Hettinger added the comment:

+0 This seems like a harmless refactoring that makes the code slightly more 
consistent and readable.

--
nosy: +rhettinger

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



[issue20605] test_socket (testGetaddrinfo) failing on OS X 10.6.8 (32-bit)

2014-02-12 Thread Ned Deily

Ned Deily added the comment:

OK, OK, it's not just your machine :=)  I was finally able to reproduce the 
same failure on a different 10.6 system.  I'm still not sure what the 
difference between them is but it really doesn't matter.  I have a patch 
forthcoming to make the test work in either case.

--
assignee:  - ned.deily
stage:  - needs patch

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



[issue9694] argparse required arguments displayed under optional arguments

2014-02-12 Thread Raymond Hettinger

Raymond Hettinger added the comment:

 How about calling required arguments required arguments?
 ...
 Clear and unambiguous. With this approach the user does 
 not have to bloat the help to state This is required.

+1 This is straight-forward, logical, and easy-to-read.

--
nosy: +rhettinger

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



[issue20566] asyncio as_completed() thrashes adding and removing callbacks

2014-02-12 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 6e04027ed53e by Guido van Rossum in branch 'default':
asyncio: Change as_completed() to use a Queue, to avoid O(N**2) behavior. Fixes 
issue #20566.
http://hg.python.org/cpython/rev/6e04027ed53e

--
nosy: +python-dev

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



[issue20566] asyncio as_completed() thrashes adding and removing callbacks

2014-02-12 Thread Guido van Rossum

Changes by Guido van Rossum gu...@python.org:


--
resolution:  - fixed
status: open - closed

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



[issue20596] Support for alternate wcstok syntax for Windows compilers

2014-02-12 Thread Jeffrey Armstrong

Jeffrey Armstrong added the comment:

I've included a revised patch that is far simpler than the others I've 
proposed.  In this example, the preprocess checks for MSVC or 
Borland/Embarcadero and, if found, uses three-argument wcstok_s().  If neither 
is detected, it checks for MinGW and, if found, defaults to old two-argument 
wcstok().  Otherwise, it defaults to three-argument wcstok().

The default in this case effectively encompasses all other OSes where 
POSIX-like wcstok() is available.  Additionally, it also allows this default 
for Open Watcom on Windows or any other theoretically possible compilers on 
Windows that may provide this more common wcstok() syntax.

--
Added file: http://bugs.python.org/file34063/wcstok.default.patch

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



[issue20613] Wrong line information in bytecode generated by compiler module

2014-02-12 Thread Arnaud Fontaine

New submission from Arnaud Fontaine:

I know that compiler module is deprecated since 2.6, but I found a regression 
introduced in version 2.7 by the following cleanup commit (replacing pyassem.py 
modified in this commit by the one just before does not trigger this bug):

http://hg.python.org/releasing/2.7.6/rev/42faa8054c3d

Actually, there is nothing wrong when executing the generated bytecode, it's 
just that tracebacks and anything that display source code from the generated 
bytecode object gets sometimes completely wrong when there is if/elif/else 
because of compiler.pyassem.order_blocks().

This issue was found when noticing that tracebacks in Zope Python Script (using 
RestrictedPython which in turn uses compiler module) were displaying completely 
wrong line information and stepping with pdb into the source code was 
displaying wrong source code and line information too.

After investigating, I found out that the problem is actually in compiler 
module and wrote a small program triggering the bug (I know that some variables 
are undefined but it does not matter here):

if if1:
  if1_entered = 1

if if2:
  if subif1:
subif1_entered = 1
  elif subif2:
subif2_entered = 1

  subif_ended = 1

Using compiler module to generate the bytecode with the program attached 
returns two different bytecodes:

$ python2.7 compiler_wrong_ordering_block_test.py 

  1   0 LOAD_NAME0 (if1)
  3 POP_JUMP_IF_FALSE   30

  2   6 LOAD_CONST   1 (1)
  9 STORE_NAME   1 (if1_entered)
 12 JUMP_FORWARD15 (to 30)

  715 LOAD_NAME2 (subif2)
 18 POP_JUMP_IF_FALSE   51

  8  21 LOAD_CONST   1 (1)
 24 STORE_NAME   3 (subif2_entered)
 27 JUMP_FORWARD21 (to 51)
   30 LOAD_NAME4 (if2)
 33 POP_JUMP_IF_FALSE   60
 36 LOAD_NAME5 (subif1)
 39 POP_JUMP_IF_FALSE   15
 42 LOAD_CONST   1 (1)
 45 STORE_NAME   6 (subif1_entered)
 48 JUMP_FORWARD 0 (to 51)

 1051 LOAD_CONST   1 (1)
 54 STORE_NAME   7 (subif_ended)
 57 JUMP_FORWARD 0 (to 60)
   60 LOAD_CONST   0 (None)
 63 RETURN_VALUE

  1   0 LOAD_NAME0 (if1)
  3 POP_JUMP_IF_FALSE   15

  2   6 LOAD_CONST   1 (1)
  9 STORE_NAME   1 (if1_entered)
 12 JUMP_FORWARD 0 (to 15)

  415 LOAD_NAME2 (if2)
 18 POP_JUMP_IF_FALSE   60

  5  21 LOAD_NAME3 (subif1)
 24 POP_JUMP_IF_FALSE   36

  6  27 LOAD_CONST   1 (1)
 30 STORE_NAME   4 (subif1_entered)
 33 JUMP_FORWARD15 (to 51)

  736 LOAD_NAME5 (subif2)
 39 POP_JUMP_IF_FALSE   51

  8  42 LOAD_CONST   1 (1)
 45 STORE_NAME   6 (subif2_entered)
 48 JUMP_FORWARD 0 (to 51)

 1051 LOAD_CONST   1 (1)
 54 STORE_NAME   7 (subif_ended)
 57 JUMP_FORWARD 0 (to 60)
   60 LOAD_CONST   0 (None)
 63 RETURN_VALUE

As you can see from the output above, the first generated bytecode gets all the 
line numbers (lnotab) messed up because 'subif2' block (and its children too) 
is emitted *before* its 'dominator' block, namely 'if2'.

Now, compiler.pyassem.order_blocks() arranges blocks to be emitted within a 
'dominators' dict where the key is a block and the value a list of blocks which 
must be emitted *before* that one. However, for at least 'if/elif' blocks 
(created by compiler.pycodegen.CodeGenerator().visitIf()), the 'elif' block 
(subif2) does not have prev/next (where prev and next define respectively the 
parent and children blocks) sets to its parent (if2) as it is only set for the 
first 'if' (subif1) and furthermore for some reasons I don't know the code 
asserts that next list length must be equal to 1 anyway (anyone knows why 
BTW?)...

Thus, when creating 'dominators' dict using next/prev block attributes, the 
'elif' block (subif2) ends up being considered kind of an orphan block because 
next/prev is not set and thus could be emitted anytime... Enabling debug mode 
in compiler.pyassem and adding a print call in order_blocks() to display 
'dominators' dict confirms this (eg 'subif2' block (block id=9) dominators 
value list is empty):

= Blocks:
('SET_LINENO', 0)
('SET_LINENO', 1)
('LOAD_NAME', 'if1')

[issue9694] argparse required arguments displayed under optional arguments

2014-02-12 Thread paul j3

paul j3 added the comment:

As Steven pointed out, the existing `add_argument_group` mechanism can be used 
to group required arguments.  For example

- temp.py --
parser = argparse.ArgumentParser(description = 'Do something')
group1 = parser.add_argument_group('required arguments')
group1.add_argument('--reqarg', '-r', required=True)
parser.add_argument('--optarg','-o')
parser.add_argument('foo')
parser.print_help()

usage: ipython [-h] --reqarg REQARG [--optarg OPTARG] foo
Do something
positional arguments:
  foo
optional arguments:
  -h, --helpshow this help message and exit
  --optarg OPTARG, -o OPTARG
required arguments:
  --reqarg REQARG, -r REQARG

Positional 'foo' can also be put in the 'required' group:

group1.add_argument('foo')

required arguments:
  --reqarg REQARG, -r REQARG
  foo

The distinction between 'positionals' and 'optionals' (or flagged) is essential 
to the parsing, but it is not necessary for Help Formatting.

I can imagine grouping arguments by 'required/not-required' properties.  It 
might be worth constructing an alternative HelpFormatter class that regroups 
the arguments in this way.  Subclassing the HelpFormatter is the established 
way of adding features to the help display.

The existing HelpFormatter flags 'required' arguments in the usage line with 
'[]'.  There it is has the added task of flagging Mutually Exclusive Groups in 
the same way.

It's worth keeping in mind that whether an argument is 'required' or not is 
determined in 2 different ways.  There is an optional 'required' flag (default 
False).  But this flag is not allowed for 'positionals'.  Instead with those 
'argparse' looks at 'nargs' ('?*' are not required).

The 'required' attribute of an argument (Action) is ignored during 'parse_args' 
until the end.  At that time it makes an inventory of 'required' arguments that 
have not been seen, and potentially raises an error.  That testing was changed 
in a relatively recent patch, and produced an unintended change in whether 
'subparsers' were required or not. (I could look up those issues in needed).

I'll think about creating the alternative HelpFormatter.

--

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



[issue15657] Error in Python 3 docs for PyMethodDef

2014-02-12 Thread Cimarron Mittelsteadt

Cimarron Mittelsteadt added the comment:

Appears to be a duplicate of issue 11587 but better explanation here

--
nosy: +cimarron

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



[issue20199] status of module_for_loader and utils._module_to_load

2014-02-12 Thread R. David Murray

R. David Murray added the comment:

Here is another one:

There's a news entry for the introduction of 
importlib.abc.Loader.init_module_attrs, but no news entry for its removal (but 
it is gone).  There is still a whatsnew entry that mentions it.

IMO there should be a NEWS entry that mentions the removal, since there is one 
that mentions the add.  Similarly for module_to_load.

Based on the deprecation warning in the module_for_loader code, I'm changing 
the whatsnew entry for its deprecation to the same text (that the import system 
handles it automatically) and referencing the pep 451 entry.  I get the 
impression from that entry that there are quite a few more importlib methods 
and functions that need to be listed there as deprecated.

--

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



[issue20611] socket.create_connection() doesn't handle EINTR properly

2014-02-12 Thread Charles-François Natali

Charles-François Natali added the comment:

 It seems that the EINTR should be caught by the standard library in all
cases:
 http://bugs.python.org/issue1628205

Yes, it should.

 But it's not the case for the socket.create_connection method (verified
in 3.3 and 2.7 source code).

It's not the case for *almost all* syscalls.
See http://bugs.python.org/issue18885

--

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



[issue20591] Let braces be a constant

2014-02-12 Thread DhilipSiva

DhilipSiva added the comment:

Apologies for misunderstanding the reference Benjamin Peterson 
(benjamin.peterson). You are right :)

--

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



[issue20167] Exception on IDLE closing

2014-02-12 Thread Tal Einat

Tal Einat added the comment:

Good catches, Terry and Serhiy!

--

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