[issue16218] Python launcher does not support unicode characters

2012-11-05 Thread STINNER Victor

STINNER Victor added the comment:

 It tests nothing on utf-8 locale (test passed even when bug is not fixed).

The issue is about Windows and UTF-8 is never used as filesystem encoding on 
Windows.

--

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



[issue16218] Python launcher does not support unicode characters

2012-11-05 Thread STINNER Victor

STINNER Victor added the comment:

The test is still failing on Mac OS X:




==
FAIL: test_non_ascii (test.test_cmd_line_script.CmdLineTest)
--
Traceback (most recent call last):
  File 
/Volumes/bay2/buildslave/cpython/3.x.snakebite-mountainlion-amd64/build/Lib/test/test_cmd_line_script.py,
 line 380, in test_non_ascii
rc, stdout, stderr = assert_python_ok(script_name)
  File 
/Volumes/bay2/buildslave/cpython/3.x.snakebite-mountainlion-amd64/build/Lib/test/script_helper.py,
 line 54, in assert_python_ok
return _assert_python(True, *args, **env_vars)
  File 
/Volumes/bay2/buildslave/cpython/3.x.snakebite-mountainlion-amd64/build/Lib/test/script_helper.py,
 line 46, in _assert_python
stderr follows:\n%s % (rc, err.decode('ascii', 'ignore')))
AssertionError: Process return code is 2, stderr follows:
/Volumes/bay2/buildslave/cpython/3.x.snakebite-mountainlion-amd64/build/python.exe:
 can't open file './@test_63568_tmp.py': [Errno 2] No such file or directory

http://buildbot.python.org/all/builders/AMD64%20Mountain%20Lion%20%5BSB%5D%203.x/builds/410/steps/test/logs/stdio

--

If I remember correctly, the command line is always decoded from 
UTF-8/surrogateescape on Mac OS X. That's why we have the function 
_Py_DecodeUTF8_surrogateescape() (for bootstrap reasons).

Such example should not work if the locale encoding is not UTF-8 on Mac OS X:
---
arg = _Py_DecodeUTF8_surrogateescape(...);
filename = _Py_wchar2char(arg);
fp = fopen(filename, r);
---

run_file() uses a different strategy:

unicode = PyUnicode_FromWideChar(filename, wcslen(filename));
if (unicode != NULL) {
bytes = PyUnicode_EncodeFSDefault(unicode);
Py_DECREF(unicode);
}
if (bytes != NULL)
filename_str = PyBytes_AsString(bytes);
else {
PyErr_Clear();
filename_str = encoding error;
}

run_file() looks to be right. Py_Main() should use similar code.

We should probably not encode and then decode the filename in each function, 
but this is another problem.

--

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



[issue9584] Allow curly brace expansion

2012-11-05 Thread Tim Golden

Tim Golden added the comment:

I've got a patch for this which applies cleanly to the 3.4 tip. I still need to 
sort out the Windows issues (which I don't think will be difficult; it looks 
like a test issue, not a code issue)

--
assignee:  - tim.golden

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



[issue9584] Allow curly brace expansion

2012-11-05 Thread Mathieu Bridon

Mathieu Bridon added the comment:

I have to apologize for not following up on this patch. At first I had no time 
to go on pushing for it, and then (after a change of job), I completely forgot 
about it. :(

I guess rebasing the patch on the latest tip is not that useful if you already 
have done it Tim, and I don't have access to a Windows box to figure out the 
issue in the tests.

At this point is there anything else I can do to help getting it integrated?

--

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



[issue16218] Python launcher does not support unicode characters

2012-11-05 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

 The issue is about Windows and UTF-8 is never used as filesystem encoding
 on Windows.

The issue exists on Linux as I reported in msg173373.

--

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



[issue9584] Allow curly brace expansion

2012-11-05 Thread Tim Golden

Tim Golden added the comment:

I'm planning to refactor the tests and the code very slightly. When I've
got a reworked patch I'll ping it back to you to ensure it matches your
intent. IIUC you're implementing comma-separated lists {abc,def} and
nested braces {a{b,c}d,efg} but not ranges {a..z}.

--

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



[issue9584] Allow curly brace expansion

2012-11-05 Thread Mathieu Bridon

Mathieu Bridon added the comment:

  IIUC you're implementing comma-separated lists {abc,def} and nested braces 
 {a{b,c}d,efg} but not ranges {a..z}.

Exactly.

Although that's just because at the time I sent the patch, I didn't know about 
ranges in shells.

So I just implemented the part of curly brace expansion that I knew of and felt 
would be useful.

If ranges are an expected feature from shells, then it would probably be a 
worthwhile addition.

--

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



[issue16281] TODO in tailmatch(): it does not support backward in all cases

2012-11-05 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

 Oh, PyUnicode_Tailmatch() documentation doesn't mention that the function
 can fail.

But it does.

.. c:function:: int PyUnicode_Tailmatch(PyObject *str, PyObject *substr, \
Py_ssize_t start, Py_ssize_t end, int direction)

   Return 1 if *substr* matches ``str[start:end]`` at the given tail end
   (*direction* == -1 means to do a prefix match, *direction* == 1 a suffix 
match),
   0 otherwise. Return ``-1`` if an error occurred.

--

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



[issue16353] add function to os module for getting path to default shell

2012-11-05 Thread Andrew Svetlov

Andrew Svetlov added the comment:

Christian,
Is there ``os.confstr`` supported by MaxOS X?
Is there using of environ['PATH'] makes sense as good callback if former is not 
present?

About COMSPEC. From my point of view it's useful if we need default path.
Or if we have Win9x, where shell is command.com (not supported by 3.4)

I guess to hardcode ``cmd.exe`` for Windows for the same reason as we hardcode 
``sh`` for Unix systems.

I agree to moving code to ``os`` if we no need to use ``shutil.which``.
The function name is still the question: getdefaultshell, getshell, get_shell 
etc.

Adding shutil.getdefaultshell function is interesting suggestion. It function 
intended to return user shell (from SHELL env var or COMSPEC for Windows) and 
not used in subprocess if shell=True (but can be passed as executable param if 
need).

--

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



[issue16353] add function to os module for getting path to default shell

2012-11-05 Thread Chris Jerdonek

Chris Jerdonek added the comment:

 Any interest in doing like os.get_terminal_size/shutil.get_terminal_size

If functions with two different behaviors are needed, I think the two functions 
should probably have different names (e.g. get_shell() and get_user_shell()).  
Otherwise, it may create confusion as to which to call (or which is being 
called when reading code).

Moreover, it doesn't seem like the following guidance in the docs for which 
get_terminal_size() to use would hold in parallel for the shell variants: 
shutil.get_terminal_size() is the high-level function which should normally be 
used, os.get_terminal_size is the low-level implementation.

--

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



[issue10050] urllib.request still has old 2.x urllib primitives

2012-11-05 Thread anatoly techtonik

anatoly techtonik added the comment:

Please note that changes to urlretrieve to return block size 0 in callback 
breaks existing PyPI apps, such as http://pypi.python.org/pypi/wget

It would be nice if you revert this part from 
http://hg.python.org/cpython/rev/53715804dc71

Also if you change semantics of block size (which is assumed to be fixed) to 
data read size then the count of blocks transferred losses any sense.

Changed callback semantics without renaming function or introducing a different 
type of callback doesn't add clarity to the code that should be maintained for 
both Python 2 and Python 3 version.

Please add issue #16409 as affected by this bug.

--
nosy: +techtonik

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



[issue10050] urllib.request still has old 2.x urllib primitives

2012-11-05 Thread anatoly techtonik

Changes by anatoly techtonik techto...@gmail.com:


--
versions: +Python 3.4

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



[issue2636] Adding a new regex module (compatible with re)

2012-11-05 Thread Nick Coghlan

Nick Coghlan added the comment:

I've been working through the known crashers list in the stdlib. The 
recursive import one was fixed with the migration to importlib in 3.3, the 
compiler one will be fixed in 3.3.1 (with an enforced nesting limit). One of 
those remaining is actually a pathological failure in the re module rather than 
a true crasher (i.e. it doesn't segfault, and in 2.7 and 3.3 you can interrupt 
it with Ctrl-C):
http://hg.python.org/cpython/file/default/Lib/test/crashers/infinite_loop_re.py

I mention it here as another problem that adopting the regex module could 
resolve (as regex promptly returns None for this case).

--

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



[issue16411] zlib.Decompress.decompress() retains pointer to input buffer without acquiring reference to it

2012-11-05 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

The decompressor does not hold a reference to the data object, but it holds a 
reference to the data. It's the unconsumed_tail attribute.

The patch is simple.

--
keywords: +patch
Added file: http://bugs.python.org/file27891/issue16411.patch

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



[issue16411] zlib.Decompress.decompress() retains pointer to input buffer without acquiring reference to it

2012-11-05 Thread Serhiy Storchaka

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


--
stage: needs patch - patch review

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



[issue16413] Non cross-platform behavior of os.path.split

2012-11-05 Thread anatoly techtonik

New submission from anatoly techtonik:

os.path.split('c:foo') gives ('c:', 'foo') on Windows and ('', 'c:foo') on 
Linux, which is not documented. IIUC, the behavior change in os module is not 
possible, so a documentation note will be appreciated.

--
assignee: docs@python
components: Documentation, Library (Lib)
messages: 174890
nosy: docs@python, techtonik
priority: normal
severity: normal
status: open
title: Non cross-platform behavior of os.path.split
versions: Python 2.7, Python 3.1, Python 3.2, Python 3.3, Python 3.4

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



[issue16413] Non cross-platform behavior of os.path.split

2012-11-05 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

.. note::

   Since different operating systems have different path name conventions, there
   are several versions of this module in the standard library.  The
   :mod:`os.path` module is always the path module suitable for the operating
   system Python is running on, and therefore usable for local paths.  However,
   you can also import and use the individual modules if you want to manipulate
   a path that is *always* in one of the different formats.  They all have the
   same interface:

   * :mod:`posixpath` for UNIX-style paths
   * :mod:`ntpath` for Windows paths
   * :mod:`macpath` for old-style MacOS paths

--
nosy: +serhiy.storchaka
resolution:  - invalid

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



[issue6717] Some problem with recursion handling

2012-11-05 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 0dfa3b09a6fe by Nick Coghlan in branch '3.2':
Record a known crasher from #6717
http://hg.python.org/cpython/rev/0dfa3b09a6fe

New changeset 509f7a53f8cc by Nick Coghlan in branch '3.3':
Merge #6717 crasher from 3.2
http://hg.python.org/cpython/rev/509f7a53f8cc

New changeset 47943fe516ec by Nick Coghlan in branch 'default':
Merge #6717 crasher from 3.3
http://hg.python.org/cpython/rev/47943fe516ec

--
nosy: +python-dev

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



[issue16281] TODO in tailmatch(): it does not support backward in all cases

2012-11-05 Thread STINNER Victor

STINNER Victor added the comment:

 Oh, PyUnicode_Tailmatch() documentation doesn't mention that the function
 can fail.

 But it does.

 .. c:function:: int PyUnicode_Tailmatch(PyObject *str, PyObject *substr, \
 Py_ssize_t start, Py_ssize_t end, int direction)

Return 1 if *substr* matches ``str[start:end]`` at the given tail end
(*direction* == -1 means to do a prefix match, *direction* == 1 a suffix 
 match),
0 otherwise. Return ``-1`` if an error occurred.

Oh, I read the documentation in unicodeobject.h:

/* Return 1 if substr matches str[start:end] at the given tail end, 0
   otherwise. */

The problem is that tailmatch() returns 0 if PyUnicode_READY() failed.
It is a bug, even if it cannot occur because PyUnicode_Tailmatch()
checks that the both strings are ready.

--

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



[issue9405] Test fix for past crash when calling urllib.getproxies() under OSX with subprocess / particular memory usage

2012-11-05 Thread Nick Coghlan

Nick Coghlan added the comment:

Changing the type, since the crash bug has been fixed for a long time.

--
nosy: +ncoghlan
stage:  - test needed
title: crash when calling urllib.getproxies() under OSX with subprocess / 
particular memory usage - Test fix for past crash when calling 
urllib.getproxies() under OSX with subprocess / particular memory usage
type: crash - enhancement

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



[issue3367] Uninitialized value read in parsetok.c

2012-11-05 Thread Nick Coghlan

Changes by Nick Coghlan ncogh...@gmail.com:


--
nosy: +ncoghlan

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



[issue16413] Non cross-platform behavior of os.path.split

2012-11-05 Thread R. David Murray

Changes by R. David Murray rdmur...@bitdance.com:


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

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



[issue16413] Non cross-platform behavior of os.path.split

2012-11-05 Thread anatoly techtonik

anatoly techtonik added the comment:

Historically os.path.split() on Windows is able to grok UNIX paths easily.

Don't you think that Python language reference for the os.path should include 
less vague definition of Windows, UNIX-style and old-style MacOS paths it works 
with?

--
resolution: invalid - 
status: closed - open

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



[issue16413] Non cross-platform behavior of os.path.split

2012-11-05 Thread anatoly techtonik

anatoly techtonik added the comment:

User story: as a Python programmer working with different systems, I'd like to 
know how os.path module threats paths on these systems.

--

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



[issue16414] Add support.NONASCII to test non-ASCII characters

2012-11-05 Thread STINNER Victor

New submission from STINNER Victor:

Attached patch adds support.NONASCII to have a portable non-ASCII character 
that can be used to test non-ASCII strings. The patch uses it in some existing 
functions.

I wrote the patch on the default branch, we may start to use it since Python 
3.2.

--
components: Tests
files: support_non_ascii.patch
keywords: patch
messages: 174897
nosy: haypo, serhiy.storchaka
priority: normal
severity: normal
status: open
title: Add support.NONASCII to test non-ASCII characters
versions: Python 3.3, Python 3.4
Added file: http://bugs.python.org/file27892/support_non_ascii.patch

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



[issue15001] segmentation fault with del sys.module['__main__']

2012-11-05 Thread Nick Coghlan

Changes by Nick Coghlan ncogh...@gmail.com:


--
nosy: +ncoghlan

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



[issue16218] Python launcher does not support unicode characters

2012-11-05 Thread STINNER Victor

STINNER Victor added the comment:

It skipped on locales which does not support £ (cp1006, cp1250, cp1251, 
cp737, cp852, cp855, cp866, cp874, cp949, euc_kr, gb2312, gbk, hz, iso2022_kr, 
iso8859_10, iso8859_11, iso8859_16, iso8859_2, iso8859_4, iso8859_5, iso8859_6, 
johab, koi8_r, koi8_u, mac_arabic, mac_farsi, ptcp154, tis_620).  But the bug 
is actual on such locales.

This issue is not specific to this test: I create the issue #16414 to improve 
the situation.

--

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



[issue16218] Python launcher does not support unicode characters

2012-11-05 Thread STINNER Victor

STINNER Victor added the comment:

 It tests nothing on utf-8 locale (test passed even when bug is not fixed).
 The issue is about Windows and UTF-8 is never used as filesystem encoding on 
 Windows.
 The issue exists on Linux as I reported in msg173373.

I don't understand your problem. Non-ASCII filenames were already supported 
with UTF-8 locale encoding. The new test checks that there is no regression 
with UTF-8 locale encoding. The test pass without the fix because it was not 
supported.

--

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



[issue16414] Add support.NONASCII to test non-ASCII characters

2012-11-05 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I think you should ensure that os.fsdecode(os.fsencode(character)) == character.

--

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



[issue16218] Python launcher does not support unicode characters

2012-11-05 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

 Non-ASCII filenames were already supported with UTF-8 locale encoding.

Test the example in msg173373.  It fails without fix.

--

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



[issue8913] Document that datetime.__format__ is datetime.strftime

2012-11-05 Thread Eric V. Smith

Eric V. Smith added the comment:

To Heikki Partanen excellent point in the review about date __format__ strings 
allowing you to combine date formatting with other types of formatting:

This is a great point. It's the lack of this that (for example) requires the 
logging module to have a separate datefmt parameter. With %-formatting, there's 
no easy way to say:

'{timestamp:%Y%m%d-%H%M%S} {hostname:^40} {count:02d}'.format(timestamp=ts, 
hostname=host, count=count)

That is, with %-formatting you can't have a single string that specifies both a 
date/time format and other formatting as well as other formatting specifiers.

I don't think the example in the patch is great, but I do think that it's a 
good point that needs to be emphasized.

--

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



[issue5364] documentation in epub format

2012-11-05 Thread Kristof Csillag

Kristof Csillag added the comment:

I have prepared a patch to build the 2.7 docs in EPUB format, too.
(Since this was already done on Python 3; this is only a very simple backport 
of a few lines in a Makefile, a readme and a HTML download page.)

--
keywords: +patch
nosy: +csillag
Added file: http://bugs.python.org/file27893/docs_in_epub_for_2.7.patch

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



[issue14266] pyunit script as shorthand for python -m unittest

2012-11-05 Thread Andrew Svetlov

Andrew Svetlov added the comment:

Is it should be separate binary? 
Or problem can be solved by regular python script with executable bit? What's 
about Windows?

--

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



[issue16339] Document exec(stmt, global_dict, local_dict) form in Python 2?

2012-11-05 Thread Mark Dickinson

Mark Dickinson added the comment:

Thread on #python-dev:  
http://mail.python.org/pipermail/python-dev/2012-November/122543.html

If this is documented, direct tests for this form of exec should also be added.

--

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



[issue14266] pyunit script as shorthand for python -m unittest

2012-11-05 Thread Michael Foord

Michael Foord added the comment:

A python script should be fine - this is what unittest2 does and I haven't had 
any requests from Windows users for a binary.

--

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



[issue8243] curses writing to window's bottom right position raises: `_curses.error: addstr() returned ERR'

2012-11-05 Thread Ramchandra Apte

Changes by Ramchandra Apte maniandra...@gmail.com:


--
components: +Library (Lib)

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



[issue8243] curses writing to window's bottom right position raises: `_curses.error: addstr() returned ERR'

2012-11-05 Thread Ramchandra Apte

New submission from Ramchandra Apte:

AutoBump™.

--
nosy: +ramchandra.apte

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



[issue4887] environment inspection and manipulation API is buggy, inconsistent with Python philosophy for wrapping native APIs

2012-11-05 Thread Ramchandra Apte

Changes by Ramchandra Apte maniandra...@gmail.com:


--
versions: +Python 3.4 -Python 2.7, Python 3.1, Python 3.2

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



[issue7292] Multiprocessing Joinable race condition?

2012-11-05 Thread Ramchandra Apte

Ramchandra Apte added the comment:

Buu..mp

--
nosy: +ramchandra.apte

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



[issue16350] zlib.Decompress.decompress() after EOF discards existing value of unused_data

2012-11-05 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

These were not idle questions.  I wrote the patch, and I had to know what 
behavior is correct.

Here's the patch.  It fixes potential memory bug (unconsumed_tail sets to NULL 
in case of out of memory), resets the unconsumed_tail to b'' after EOF, updates 
unconsumed_tail and unused_data in flush().

I a little changed test for the previous case (here was O(N^2) for large data). 
 I checked it on non-fixed Python, bug was catched.

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

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



[issue8243] curses writing to window's bottom right position raises: `_curses.error: addstr() returned ERR'

2012-11-05 Thread Serhiy Storchaka

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


--
components: +Extension Modules -Library (Lib)
versions: +Python 2.7, Python 3.2, Python 3.3, Python 3.4 -Python 2.6

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



[issue14965] super() and property inheritance behavior

2012-11-05 Thread Andrew Svetlov

Andrew Svetlov added the comment:

I would say

@x.deleter
def x(self):
del super().x

confuses me a bit. 
But I'm only -0, let's see other developers for their opinions.

--

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



[issue15955] gzip, bz2, lzma: add option to limit output size

2012-11-05 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

unconsumed_tail should be private hidden attribute, which automatically 
prepends any consumed data.  This should not be very complicated.  But 
benchmarks needed to show what kind of approach is more efficient.

--

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



[issue16409] urlretrieve regression: first call returns block size as 0

2012-11-05 Thread akira

akira added the comment:

The summary assumes that issue 10050 is valid i.e., urlretrieve is
reimplemented using new urlopen and 2.x FancyURLopener is deprecated.

It might not be so [1]. In this case the summary is incorrect.

Old implementation is available as:

  opener = FancyURLopener()
  urlretrieve = opener.retrieve

btw, the new implementation doesn't prevent you to estimate the 
progress:

  def make_reporthook():
  read = 0  # number of bytes read so far
  def reporthook(blocknum, blocksize, totalsize):
  nonlocal read
  read += blocksize
  if totalsize  0:
  percent = read * 1e2 / totalsize
  print(%5.1f%% %*d / %d % (
  percent, len(str(totalsize)), read, totalsize))
  else:
  print(read %d % (read,))
  return reporthook


[1]: http://mail.python.org/pipermail/python-dev/2011-March/109450.html

--

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



[issue16408] zipfile.testzip() opens file but does not close it.

2012-11-05 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Quite the contrary.  The ZipExtFile closes the file descriptor if the ZipFile 
is constructed on a filename.

--
nosy: +serhiy.storchaka

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



[issue16415] eventlet.monkey_patch() breaks subprocess.Popen on Windows

2012-11-05 Thread Alessandro Pilotti

New submission from Alessandro Pilotti:

eventlet.monkey_patch() breaks subprocess.Popen on Windows with error:

NotImplementedError: set_nonblocking() on a file object with no setblocking() 
method (Windows pipes don't support non-blocking I/O)

Here's the full stack trace:
http://paste.openstack.org/show/24032/

Workaround: eventlet.monkey_patch(os=False)

--
components: IO, Interpreter Core, Library (Lib)
messages: 174915
nosy: alexpilotti
priority: normal
severity: normal
status: open
title: eventlet.monkey_patch() breaks subprocess.Popen on Windows
type: behavior
versions: Python 2.7

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



[issue9584] Allow curly brace expansion

2012-11-05 Thread Tim Golden

Tim Golden added the comment:

Attached is a refactored version of Mathieu's patch which, when applied to tip, 
passes all tests.

--
Added file: http://bugs.python.org/file27894/0003-reworked-issue9584.patch

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



[issue16415] eventlet.monkey_patch() breaks subprocess.Popen on Windows

2012-11-05 Thread R. David Murray

R. David Murray added the comment:

eventlet is not a part of the Python standard library.  Please report this bug 
to the project's bug tracker.

--
nosy: +r.david.murray
resolution:  - invalid
stage:  - committed/rejected
status: open - closed

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



[issue16389] re._compiled_typed's lru_cache causes significant degradation of the mako_v2 bench

2012-11-05 Thread Ezio Melotti

Ezio Melotti added the comment:

Attached a proof of concept that removes the caching for re.compile, as 
suggested in msg174599.

--
Added file: http://bugs.python.org/file27895/issue16389.diff

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



[issue9584] Allow curly brace expansion

2012-11-05 Thread Tim Golden

Tim Golden added the comment:

Something went wrong with that patch; it doesn't include all the changes to 
test_glob. I'll upload a newer patch later.

--

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



[issue16385] evaluating literal dict with repeated keys gives no warnings/errors

2012-11-05 Thread Raymond Hettinger

Raymond Hettinger added the comment:

FWIW, I agree with this rejection.

--
nosy: +rhettinger
stage:  - committed/rejected

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



[issue16404] Uses of PyLong_FromLong that don't check for errors

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

Changes by Jesús Cea Avión j...@jcea.es:


--
nosy: +jcea

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



[issue16408] zipfile.testzip() opens file but does not close it.

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

Jesús Cea Avión added the comment:

I think this is a duplicate of issue #16183. Are you sure python 3 is affected?.

--
nosy: +jcea

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



[issue16414] Add support.NONASCII to test non-ASCII characters

2012-11-05 Thread Chris Jerdonek

Chris Jerdonek added the comment:

+# NONASCII: non-ASCII character encodable by os.fsencode(),
+# or None if there is no such character.
+NONASCII = None

Can you use a name that reflects that this is a specific type of non-ASCII 
character having a special property (e.g. FS_NONASCII)?  I think ASCII should 
be reserved for a generic non-ASCII character.  Moreover, there may be other 
types of non-ASCII we can add in the future.

--
nosy: +chris.jerdonek

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



[issue16408] zipfile.testzip() opens file but does not close it.

2012-11-05 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

No, this is not a duplicate.  ZipExtFile.close() closes a file handle, but 
ZipExtFile.close() is not used here.  I see also some possible FD leaks in 
ZipFile.open().  It will be good to fix all them in this issue.  If no one will 
make a patch for this easy issue, I'll do it.

--

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



[issue7292] Multiprocessing Joinable race condition?

2012-11-05 Thread Richard Oudkerk

Changes by Richard Oudkerk shibt...@gmail.com:


--
nosy: +sbt

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



[issue16389] re._compiled_typed's lru_cache causes significant degradation of the mako_v2 bench

2012-11-05 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Ezio, I agree with you, but I think this should be a separate issue.

--

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



[issue3754] cross-compilation support for python build

2012-11-05 Thread Ambroz Bizjak

Ambroz Bizjak added the comment:

I've applied all patches from py3k-20121004-CROSS.tgz to Python 3.3.0 except 2, 
4, and 9 (which didn't apply), but it's not working. After it builds the built 
in modules, it tries to run the parser generator which was cross-compiled.

make Parser/pgen
make[1]: Entering directory `/root/Python-3.3.0'
armv5tel-softfloat-linux-gnueabi-gcc -c -Wno-unused-result -DNDEBUG -g -fwrapv 
-O3 -Wall -Wstrict-prototypes-I. -I./Include-DPy_BUILD_CORE -o 
Python/dynamic_annotations.o Python/dynamic_annotations.c
armv5tel-softfloat-linux-gnueabi-gcc -c -Wno-unused-result -DNDEBUG -g -fwrapv 
-O3 -Wall -Wstrict-prototypes-I. -I./Include-DPy_BUILD_CORE -o 
Python/mysnprintf.o Python/mysnprintf.c
armv5tel-softfloat-linux-gnueabi-gcc -c -Wno-unused-result -DNDEBUG -g -fwrapv 
-O3 -Wall -Wstrict-prototypes-I. -I./Include-DPy_BUILD_CORE -o 
Python/pyctype.o Python/pyctype.c
armv5tel-softfloat-linux-gnueabi-gcc -c -Wno-unused-result -DNDEBUG -g -fwrapv 
-O3 -Wall -Wstrict-prototypes-I. -I./Include-DPy_BUILD_CORE -o 
Parser/tokenizer_pgen.o Parser/tokenizer_pgen.c
armv5tel-softfloat-linux-gnueabi-gcc -c -Wno-unused-result -DNDEBUG -g -fwrapv 
-O3 -Wall -Wstrict-prototypes-I. -I./Include-DPy_BUILD_CORE -o 
Parser/printgrammar.o Parser/printgrammar.c
armv5tel-softfloat-linux-gnueabi-gcc -c -Wno-unused-result -DNDEBUG -g -fwrapv 
-O3 -Wall -Wstrict-prototypes-I. -I./Include-DPy_BUILD_CORE -o 
Parser/parsetok_pgen.o Parser/parsetok_pgen.c
armv5tel-softfloat-linux-gnueabi-gcc -c -Wno-unused-result -DNDEBUG -g -fwrapv 
-O3 -Wall -Wstrict-prototypes-I. -I./Include-DPy_BUILD_CORE -o 
Parser/pgenmain.o Parser/pgenmain.c
armv5tel-softfloat-linux-gnueabi-gcc -DNDEBUG -g -fwrapv -O3 -Wall 
-Wstrict-prototypes   Parser/acceler.o Parser/grammar1.o Parser/listnode.o 
Parser/node.o Parser/parser.o Parser/bitset.o Parser/metagrammar.o 
Parser/firstsets.o Parser/grammar.o Parser/pgen.o Objects/obmalloc.o 
Python/dynamic_annotations.o Python/mysnprintf.o Python/pyctype.o 
Parser/tokenizer_pgen.o Parser/printgrammar.o Parser/parsetok_pgen.o 
Parser/pgenmain.o -lpthread -ldl  -lpthread -lutil -o Parser/pgen
make[1]: Leaving directory `/root/Python-3.3.0'
Parser/pgen ./Grammar/Grammar ./Include/graminit.h ./Python/graminit.c
Parser/pgen: Parser/pgen: cannot execute binary file
make: *** [Include/graminit.h] Error 126

--
nosy: +ambrop7

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



[issue3754] cross-compilation support for python build

2012-11-05 Thread Ambroz Bizjak

Ambroz Bizjak added the comment:

Forgot to mention: I did run autoreconf after applying the patches. I'm 
attaching the full output.

--
Added file: http://bugs.python.org/file27896/log

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



[issue16389] re._compiled_typed's lru_cache causes significant degradation of the mako_v2 bench

2012-11-05 Thread Ezio Melotti

Ezio Melotti added the comment:

I think the lru_cache should be kept if possible (i.e. I'm -0.5 on your patch). 
 If this result in a slowdown (as the mako_v2 benchmark indicates), then there 
are two options:
  1) optimize lru_cache;
  2) avoid using it for regular expressions compiled with re.compile;
Both the changes should improve the performances.
This issue is about the re module, so I think it's ok to cover any changes to 
the re module here, and improvements to lru_cache (e.g. a faster make_key) 
should be moved to a new issue.
If this is not enough to restore the performances we might decide to go back to 
a custom cache instead of using lru_cache.

--

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



[issue3754] cross-compilation support for python build

2012-11-05 Thread Ambroz Bizjak

Ambroz Bizjak added the comment:

A minor issue: if only --host= is specified on command line but not --build=, 
then cross_compiling variable is only defined after AC_PROG_CC is called. 
However, configure.ac uses it before that (e.g. the part at the top which looks 
for a python interpreter). Well, more precisely, something in autoconf sets it 
to cross_compiling=maybe.

--

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



[issue16353] add function to os module for getting path to default shell

2012-11-05 Thread Taras Lyapun

Taras Lyapun added the comment:

Updated patch.
Moved function to os and used Christian Heimes implementation.
Updated doc, and test.
Also renamed function to get_shell.

Test passes on mac os and windows.

--
Added file: http://bugs.python.org/file27897/issue16353.diff

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



[issue16353] add function to os module for getting path to default shell

2012-11-05 Thread Christian Heimes

Christian Heimes added the comment:

I've tested confstr(CS_PATH) on Linux, Mac OS X, Solaris, HP-UX and BSD. It 
works and the path to `sh` is always included.

Taras:
You don't have to perform the platform inside the get_shell() function. I 
suggest that you define the function depending on the value of `name`.

if name == posix:
def get_shell():
...
elif name in {nt, ce}:
def get_shell():
...

--

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



[issue16413] Non cross-platform behavior of os.path.split

2012-11-05 Thread Georg Brandl

Georg Brandl added the comment:

Please submit a patch.

--
nosy: +georg.brandl

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



[issue16353] add function to os module for getting path to default shell

2012-11-05 Thread Taras Lyapun

Taras Lyapun added the comment:

Updated patch in regards to Christian Heimes remark.

--
Added file: http://bugs.python.org/file27898/issue16353.diff

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



[issue16353] add function to os module for getting path to default shell

2012-11-05 Thread Chris Jerdonek

Chris Jerdonek added the comment:

Is someone able to test the patch on Android (the impetus for this issue)?

--

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



[issue8745] zipimport is a bit slow

2012-11-05 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I suggest to use fseek(fp, relative_offset, SEEK_CUR).  It doesn't force a 
system call (at least on Linux) and may be a little faster than fread() or 
multiple getc().

--
nosy: +serhiy.storchaka

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



[issue16408] zipfile.testzip() opens file but does not close it.

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

Jesús Cea Avión added the comment:

Serhiy Storchaka, go for it.

--

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



[issue16391] terminator argument for logging.FileHandlers

2012-11-05 Thread Taras Lyapun

Taras Lyapun added the comment:

Hello!

I don't understand issue - FileHandler is a subclass of StreamHandler, so you 
can use terminator for FileHandler instances in the same way as for 
StreamHandler instances.

--
nosy: +lyapun

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



[issue16353] add function to os module for getting path to default shell

2012-11-05 Thread Chris Jerdonek

Chris Jerdonek added the comment:

Some minor comments.

+.. function :: get_shell()
+
+  Return the path to default shell.

Three leading spaces needed.  Also, Return the path to the default shell.

+  For unix system returns path to ``sh``, for windows returns path to 
``cmd.exe``.

On Unix systems returns the path to ``sh``, and on Windows returns the path to 
``cmd.exe``.  I would also document and test FileNotFound (e.g. by temporarily 
changing os.confstr).

+Return the path to default shell for Unix.

the default shell

+Return the path to default shell for Windows.

the default shell

+class TestGetShell(unittest.TestCase):
+def test_get_shell(self):
+shell = os.get_shell()
+param = /c if sys.platform == 'win32' else -c
+s = subprocess.Popen([shell, param, echo test],
+stdout=subprocess.PIPE)

Alignment should be:

+s = subprocess.Popen([shell, param, echo test],
+ stdout=subprocess.PIPE)

--

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



[issue9584] Allow curly brace expansion

2012-11-05 Thread Tim Golden

Tim Golden added the comment:

Scratch that last comment: the patch does apply. I've tested it against Windows 
 Ubuntu. If no one comes in with any objections I'll commit it within the next 
day.

--

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



[issue16392] import crashes on circular imports in ext modules

2012-11-05 Thread Antoine Pitrou

Antoine Pitrou added the comment:

 Maybe we should add a warning in some documentation somewhere about
 this and then close the issue?

I don't really know where to add it, in the C API docs perhaps,

--

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



[issue16327] subprocess.Popen leaks file descriptors on os.fork() failure

2012-11-05 Thread Mark Gius

Mark Gius added the comment:

My contributor form has been accepted.  Anything else I should be doing to work 
towards getting a fix applied?

--

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



[issue10395] new os.path function to extract common prefix based on path components

2012-11-05 Thread Rafik Draoui

Rafik Draoui added the comment:

Here is a new patch addressing some of storchaka review comments, and 
implementing a version in ntpath.

For the Windows version, I did as proposed in msg174819, but as I am not 
familiar with the semantics and subtleties of paths in Windows maybe this 
version of ntpath.commonpath is too simplistic and would return wrong results 
in some cases. I would like someone more knowledgeable in Windows to take care 
of it, or maybe just provide a test suite with lots of different corner cases 
that I could use to provide a better implementation.

--
Added file: http://bugs.python.org/file27899/patch10395-2

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



[issue16408] FD leaks in zipfile

2012-11-05 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Here is a patch.  In additional to leaks in testzip and ZipFile.open() I fixed 
possible leaks in other places.

--
keywords: +patch
stage: needs patch - patch review
title: zipfile.testzip() opens file but does not close it. - FD leaks in 
zipfile
Added file: http://bugs.python.org/file27900/zipfile_fd_leaks.patch

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



[issue16408] FD leaks in zipfile

2012-11-05 Thread Serhiy Storchaka

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


Added file: http://bugs.python.org/file27901/zipfile_fd_leaks-3.2.patch

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



[issue16408] FD leaks in zipfile

2012-11-05 Thread Serhiy Storchaka

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


Added file: http://bugs.python.org/file27902/zipfile_fd_leaks-2.7.patch

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



[issue16416] Mac OS X: don't use the locale encoding but UTF-8 to encode and decode filenames

2012-11-05 Thread STINNER Victor

New submission from STINNER Victor:

Since the changeset 45079ad1e260 (issue #4388), command line arguments are 
decoded from UTF-8 instead of the locale encoding. Functions of 
Python/fileutils.c are still using the locale encoding.

It does not work: see issue #16218. On Mac OS X, in the command line python 
script.py, the filename script.py is decoded from UTF-8 (by 
_Py_DecodeUTF8_surrogateescape) but then it is passed to _Py_fopen() which 
encodes the filename to the locale encoding (ex: ISO-8859-1 if $LANG, $LC_CTYPE 
and $LC_ALL environment variables are not set). The result is mojibake and 
Python fails to open the script.

Attached patch modifies function of Python/fileutils.c to use UTF-8 to encode 
and decode filenames, instead of the locale encoding on Mac OS X.

I don't know yet if Module/getpath.c should also decode paths from UTF-8 
instead of the locale encoding on Mac OS X. We may expose _Py_decode_filename().

--
assignee: ronaldoussoren
components: Macintosh
files: macosx.patch
keywords: patch
messages: 174943
nosy: haypo, ronaldoussoren
priority: normal
severity: normal
status: open
title: Mac OS X: don't use the locale encoding but UTF-8 to encode and decode 
filenames
versions: Python 3.4
Added file: http://bugs.python.org/file27903/macosx.patch

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



[issue16218] Python launcher does not support unicode characters

2012-11-05 Thread STINNER Victor

STINNER Victor added the comment:

I created the issue #16416 to fix the Mac OS X case.

--

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



[issue16416] Mac OS X: don't use the locale encoding but UTF-8 to encode and decode filenames

2012-11-05 Thread STINNER Victor

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


--
nosy: +serhiy.storchaka

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



[issue16417] Integer converted in tuple without request

2012-11-05 Thread Rosa Maria

New submission from Rosa Maria:

in instruction:
  b = int(input('Dame valor (mayor) de b = '))

later is an instruction:
  while b  0:

and the result is:
  Traceback (most recent call last):
  File H:\Soft_nuevo\Reptil\GCD_MCD_Euclides_Extendido-0.py, line 39, in 
module
while b  0:
TypeError: unorderable types: tuple()  int()

--
components: IDLE
files: GCD_MCD_Euclides_Extendido-0.py
messages: 174945
nosy: Gravitania
priority: normal
severity: normal
status: open
title: Integer converted in tuple without request
type: crash
versions: Python 3.3
Added file: http://bugs.python.org/file27904/GCD_MCD_Euclides_Extendido-0.py

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



[issue16418] argparse with many choices can generate absurdly long usage message

2012-11-05 Thread Juraj Variny

New submission from Juraj Variny:

Example:

parser.add_argument(-p,--port, help=Listening port, type=int, 
choices=range(1, 65535),default=8007,required = False)

generates this usage text:

usage: agent.py [-h]
[-p 
{1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,
 ...snip... 
,65522,65523,65524,65525,65526,65527,65528,65529,65530,65531,65532,65533,65534}]

optional arguments:
  -h, --helpshow this help message and exit
  -p {1,2,3,4,5,6,7,8,9,10,11,12,13,14, ...snip... 
,65525,65526,65527,65528,65529,65530,65531,65532,65533,65534}
Listening port

--
components: Library (Lib)
messages: 174947
nosy: Juraj.Variny
priority: normal
severity: normal
status: open
title: argparse with many choices can generate absurdly long usage message
type: behavior
versions: Python 2.7

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



[issue16414] Add support.NONASCII to test non-ASCII characters

2012-11-05 Thread STINNER Victor

STINNER Victor added the comment:

 If NONASCII is None I suggest the followed fallback code

I prefer to not brute force Unicode because it would slow down any test, even 
tests not using FS_NONASCII. I wrote attached brute.py script to compute an 
exhaustive list of non-ASCII characters encodable to any locale encoding. My 
locale encoding list is not complete, but it should be enough for our purpose. 
The list can be completed later.

--
Added file: http://bugs.python.org/file27906/brute.py

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



[issue16414] Add support.NONASCII to test non-ASCII characters

2012-11-05 Thread STINNER Victor

STINNER Victor added the comment:

I tested support_non_ascii-2.patch on Windows with cp932 ANSI code page (FS 
encoding), and on Linux with ASCII, ISO-8859-1, ISO-8859-15 and UTF-8 locale 
encodings.

--

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



[issue16414] Add support.NONASCII to test non-ASCII characters

2012-11-05 Thread STINNER Victor

STINNER Victor added the comment:

 I think you should ensure that os.fsdecode(os.fsencode(character)) == 
 character.

Chosen characters respect this property, but it doesn't hurt to add such check.

 Can you use a name that reflects that this is a specific type
 of non-ASCII character having a special property (e.g. FS_NONASCII)?

Done.

--
Added file: http://bugs.python.org/file27905/support_non_ascii-2.patch

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



[issue16414] Add support.NONASCII to test non-ASCII characters

2012-11-05 Thread STINNER Victor

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


Removed file: http://bugs.python.org/file27892/support_non_ascii.patch

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



[issue16417] Integer converted in tuple without request

2012-11-05 Thread R. David Murray

R. David Murray added the comment:

You did request a tuple:

  r = a - q * b,

That is equivalent to

  r = (a - q * b,)

which is a single element tuple.

I had to put in some print statements in your loop to find that, it wasn't 
obvious.  This is perhaps a disadvantage of Python's tuple notation, but the 
benefits of the notation outweigh this small disadvantage, I think.

--
nosy: +r.david.murray
resolution:  - invalid
stage:  - committed/rejected
status: open - closed
type: crash - behavior

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



[issue6280] calendar.timegm() belongs in time module, next to time.gmtime()

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

Changes by Jesús Cea Avión j...@jcea.es:


--
nosy: +jcea

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



[issue16418] argparse with many choices can generate absurdly long usage message

2012-11-05 Thread R. David Murray

R. David Murray added the comment:

I don't think choices is a good choice there (pardon the pun).  You really want 
a custom type.  I'm inclined to think that that applies to any 'choices' value 
that is 'too large' for the help display.  Part of the point of choices is that 
you *want* the help display to list all the choices.

I'm inclined to close this as invalid.

--
nosy: +r.david.murray

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



[issue16419] email.message._headers is a list

2012-11-05 Thread DDarko

New submission from DDarko:

in Python 3.3 lib.email.message


  File email/message.py, line 151, in as_string
g.flatten(self, unixfrom=unixfrom)
  File email/generator.py, line 112, in flatten
self._write(msg)
  File email/generator.py, line 171, in _write
self._write_headers(msg)
  File email/generator.py, line 197, in _write_headers
for h, v in msg.raw_items():
  File email/message.py, line 441, in raw_items
return iter(self._headers.copy())
AttributeError: 'list' object has no attribute 'copy'




http://hg.python.org/cpython/file/ec00f8570c55/Lib/email/message.py
in line 443 is:
return iter(self._headers.copy())
I think that it should be:
return iter(self._headers[:])

--
components: Library (Lib)
messages: 174952
nosy: DDarko
priority: normal
severity: normal
status: open
title: email.message._headers is a list
type: crash
versions: Python 3.3

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



[issue16419] email.message._headers is a list

2012-11-05 Thread Ezio Melotti

Ezio Melotti added the comment:

Lists have a new copy method starting from Python 3.3:
Python 3.3.0+ (3.3:549f7b5baa83+, Nov  4 2012, 23:18:06) 
[GCC 4.6.3] on linux
Type help, copyright, credits or license for more information.
 list.copy
method 'copy' of 'list' objects

--
nosy: +ezio.melotti, r.david.murray
resolution:  - invalid
stage:  - committed/rejected
status: open - closed
type: crash - behavior

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



[issue16391] add terminator ctor argument to logging.StreamHandlers derived handlers

2012-11-05 Thread Nikolay Bryskin

Nikolay Bryskin added the comment:

Hello, Taras.

I've renamed the issue - StreamHandler should also have a terminator __init__ 
keyword argument.

This argument is mostly needed for automatic logging configuration using 
logging.config.dictConfig or logging.config.fileConfig.

--
title: terminator argument for logging.FileHandlers - add terminator ctor 
argument to logging.StreamHandlers derived handlers

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



[issue16385] evaluating literal dict with repeated keys gives no warnings/errors

2012-11-05 Thread Lukas Lueg

Lukas Lueg added the comment:

PyLint or PyChecker can only do this if the keys are all simple objects like 
ints or strings. Consider a class with a custom __hash__

--

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



[issue16418] argparse with many choices can generate absurdly long usage message

2012-11-05 Thread Chris Jerdonek

Chris Jerdonek added the comment:

I agree with David.  Another sign that using choices isn't the right approach 
is that it requires constructing a list of 66,000 elements.  There are better 
ways of checking if a provided argument is an integer between 1 and 65,535.

--
nosy: +chris.jerdonek

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



[issue16418] argparse with many choices can generate absurdly long usage message

2012-11-05 Thread Chris Jerdonek

Chris Jerdonek added the comment:

The argparse documentation says in one part, The choices keyword argument may 
be more convenient for type checkers that simply check against a range of 
values.

Thus, I wouldn't object to language clarifying that choices is meant for lists 
of choices that should be displayed in the command-line help (e.g. smaller 
lists and human-readable).

--

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



[issue13349] Non-informative error message in index() and remove() functions

2012-11-05 Thread Sean Ochoa

Sean Ochoa added the comment:

Tests updated for coverage and to use assertRaisesRegex.

--
Added file: http://bugs.python.org/file27907/issue13349.patch.1

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