[issue16676] Segfault under Python 3.3 after PyType_GenericNew

2012-12-14 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis :


--
nosy: +Arfrever

___
Python tracker 

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



[issue16659] Pure Python implementation of random

2012-12-14 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis :


--
nosy: +Arfrever

___
Python tracker 

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



[issue16678] optparse: parse only known options

2012-12-14 Thread anatoly techtonik

New submission from anatoly techtonik:

This following recipe from Optik examples should be added to documentation. It 
is extremely helpful when porting to optparse from getopt or other option 
parsing schemes.

--
assignee: docs@python
components: Documentation
messages: 177447
nosy: docs@python, techtonik
priority: normal
severity: normal
status: open
title: optparse: parse only known options
versions: Python 2.6, Python 2.7

___
Python tracker 

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



[issue16678] optparse: parse only known options

2012-12-14 Thread anatoly techtonik

Changes by anatoly techtonik :


Added file: http://bugs.python.org/file28307/pass_through.py

___
Python tracker 

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



[issue16678] optparse: parse only known options

2012-12-14 Thread anatoly techtonik

anatoly techtonik added the comment:

It allows to port options to and from optparse incrementally.

--

___
Python tracker 

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



[issue16679] Wrong URL path decoding

2012-12-14 Thread Claude Paroz

New submission from Claude Paroz:

In wsgiref/simple_server.py (WSGIRequestHandler.get_environ), Python 3 is 
currently populating the env['PATH_INFO'] variable by decoding the URL path, 
assuming it was encoded with 'iso-8859-1', which appears to be wrong, according 
to RFC 3986/3987.
For example, if you request the path /سلام in any modern browser, PATH_INFO 
will contain "/سلاÙ".
'iso-8859-1' should be replaced by 'utf-8' for decoding.

Note that this was introduced as part of the fix for 
http://bugs.python.org/issue10155

--
components: Library (Lib)
messages: 177449
nosy: claudep
priority: normal
severity: normal
status: open
title: Wrong URL path decoding
type: behavior
versions: Python 3.5

___
Python tracker 

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



[issue16447] SEGFAULT when setting type.__name__

2012-12-14 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis :


--
nosy: +Arfrever

___
Python tracker 

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



[issue16576] ctypes: structure with bitfields as argument

2012-12-14 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis :


--
nosy: +Arfrever

___
Python tracker 

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



[issue16575] ctypes: unions as arguments

2012-12-14 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis :


--
nosy: +Arfrever

___
Python tracker 

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



[issue14894] distutils.LooseVersion fails to compare number and a word

2012-12-14 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis :


--
nosy: +Arfrever

___
Python tracker 

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



[issue16601] Restarting iteration over tarfile continues from where it left off.

2012-12-14 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis :


--
nosy: +Arfrever

___
Python tracker 

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



[issue16631] tarfile.extractall() doesn't extract everything if .next() was used

2012-12-14 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis :


--
nosy: +Arfrever

___
Python tracker 

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



[issue16679] Wrong URL path decoding

2012-12-14 Thread Graham Dumpleton

Graham Dumpleton added the comment:

The requirement per PEP  is that the original byte string needs to be 
converted to native string (Unicode) with the ISO-8891-1 encoding. This is to 
ensure that the original bytes are preserved so that the WSGI application, with 
its own knowledge of what encoding the byte string was in, can then properly 
convert it to the correct encoding.

In other words, the WSGI server is not allowed to assume that the original byte 
string was UTF-8, because in practice it may not be and it cannot know what it 
is. The WSGI server must use ISO-8859-1. The WSGI application if it needs it in 
UTF-8, must then convert it back to a byte string using IS0-8859-1 and then 
from there convert it back to a native string as UTF-8.

So if I understand what you are saying, you are suggesting a change which is 
incompatible with PEP .

Please provide a code snippet or patch to show what you are proposing to be 
changed so it can be determined precisely what you are talking about.

--
nosy: +grahamd

___
Python tracker 

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



[issue16679] Wrong URL path decoding

2012-12-14 Thread Berker Peksag

Changes by Berker Peksag :


--
versions: +Python 3.4 -Python 3.5

___
Python tracker 

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



[issue16679] Wrong URL path decoding

2012-12-14 Thread Claude Paroz

Claude Paroz added the comment:

Attached are my proposed changes.

Also, I just came across http://bugs.python.org/issue3300, which finally led 
Python urllib.parse.quote to default to UTF-8 encoding, after a lengthy 
discussion.

--
keywords: +patch
Added file: http://bugs.python.org/file28308/issue16679-1.diff

___
Python tracker 

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



[issue16680] Line buffering in socket._fileobject is borken

2012-12-14 Thread Kristján Valur Jónsson

New submission from Kristján Valur Jónsson:

socket._fileobject supports line buffering for output with the bufsize=1 
option.  Unfortunately, it is broken and behaves like no buffering.  This patch 
remedies the situation.

--
components: Library (Lib)
files: _fileobject.diff
keywords: patch
messages: 177452
nosy: kristjan.jonsson
priority: normal
severity: normal
status: open
title: Line buffering in socket._fileobject is borken
type: behavior
versions: Python 2.7
Added file: http://bugs.python.org/file28309/_fileobject.diff

___
Python tracker 

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



[issue16677] Hard to find operator precedence in Lang Ref.

2012-12-14 Thread Ezio Melotti

Changes by Ezio Melotti :


--
nosy: +chris.jerdonek, ezio.melotti
stage:  -> needs patch

___
Python tracker 

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



[issue16679] Wrong URL path decoding

2012-12-14 Thread Graham Dumpleton

Graham Dumpleton added the comment:

You can't try UTF-8 and then fall back to ISO-8859-1. PEP  requires it 
always be ISO-8859-1. If an application needs it as something else, it is the 
web applications job to do it.

The relevant part of the PEP is:

"""On Python platforms where the str or StringType type is in fact 
Unicode-based (e.g. Jython, IronPython, Python 3, etc.), all "strings" referred 
to in this specification must contain only code points representable in 
ISO-8859-1 encoding (\u through \u00FF, inclusive). It is a fatal error for 
an application to supply strings containing any other Unicode character or code 
point. Similarly, servers and gateways must not supply strings to an 
application containing any other Unicode characters."""

By converting as UTF-8 you would be breaking the requirement that only code 
points representable in ISO-8859-1 encoding (\u through \u00FF, inclusive) 
are passed through.

So it is inconvenient if your expectation is that will always be UTF-8, but is 
how it has to work. This is because it could be something other than UTF-8, yet 
still be able to be successfully converted as UTF-8. In that case the 
application would get something totally different to the original which is 
wrong.

So, the WSGI server cannot ever make any assumptions and the WSGI application 
always has to be the one which converts it to the correct Unicode string. The 
only way that can be done and still pass through a native string, is that it is 
done as ISO-8859-1 (which is byte preserving), allowing the application to go 
back to bytes and then back to Unicode in correct encoding.

--

___
Python tracker 

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



[issue16680] Line buffering in socket._fileobject is broken

2012-12-14 Thread Berker Peksag

Changes by Berker Peksag :


--
title: Line buffering in socket._fileobject is borken -> Line buffering in 
socket._fileobject is broken

___
Python tracker 

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



[issue16680] Line buffering in socket._fileobject is broken

2012-12-14 Thread Kristján Valur Jónsson

Kristján Valur Jónsson added the comment:

http://www.urbandictionary.com/define.php?term=borken

--

___
Python tracker 

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



[issue2771] Test issue

2012-12-14 Thread Ezio Melotti

Ezio Melotti added the comment:

irker test

--

___
Python tracker 

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



[issue16680] Line buffering in socket._fileobject is broken

2012-12-14 Thread Charles-François Natali

Charles-François Natali added the comment:

It's a duplicate, otherwise the patch LGTM.

--
nosy: +neologix
resolution:  -> duplicate
stage:  -> committed/rejected
status: open -> closed
superseder:  -> socket line buffering

___
Python tracker 

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



[issue16679] Wrong URL path decoding

2012-12-14 Thread Claude Paroz

Claude Paroz added the comment:

I may understand your reasoning when you cannot make any assumptions about the 
encoding of a series of bytes.

I think that the case of PATH_INFO is different, because it should comply with 
standards, and then you *can* make the assumption that the original path is 
'utf-8'-encoded. So either leave the string undecoded, or decode it to what the 
standards say. It would put un unneccessary burden on WSGI apps to always 
require to encode-redecode this string.
Wouldn't it be possible to amend PEP ?

Hopefully we can get some other opinions about this issue.

--

___
Python tracker 

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



[issue879399] socket line buffering

2012-12-14 Thread Kristján Valur Jónsson

Kristján Valur Jónsson added the comment:

Here's a patch for the current 2.7 stuff, from issue #16680 (which was deemed 
duplicate).
Unless anyone objects, I'll commit that to 2.7 soon.  Eight years, this has 
taken.

--
keywords: +patch
nosy: +kristjan.jonsson
Added file: http://bugs.python.org/file28310/_fileobject.diff

___
Python tracker 

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



[issue16676] Segfault under Python 3.3 after PyType_GenericNew

2012-12-14 Thread Jesús Cea Avión

Changes by Jesús Cea Avión :


--
nosy: +jcea

___
Python tracker 

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



[issue15963] Improve ./configure's support for 32/64-bit debug|release|profiled builds w/ vendor (non-gcc) compilers on proprietary UNIX systems (Solaris/HP-UX/AIX et al).

2012-12-14 Thread Trent Nelson

Trent Nelson added the comment:

On Thu, Dec 13, 2012 at 10:28:00PM -0800, Ned Deily wrote:
> 
> Ned Deily added the comment:
> 
> Without having reviewed the proposed change in detail, a couple of
> comments.  On current OS X systems and others, the compiler could be
> clang which perhaps should be treated as gcc for most autoconf
> purposes.

I'm not intending to target OS X in the autoconf block I referred
to; it's a popular platform for developers and users, and doesn't
have any of the problems that the proprietary *NIXes/compilers
have.

This work is solely aimed at Solaris, Tru64, HP-UX, AIX and IRIX.

> Also, why are we putting any effort into supporting IRIX
> anymore?

We?  It's just me :-)  So a more appropriate question might be why
am I bothering to put effort into supporting it?  And the answer to
that is simply because I can; Snakebite has an SGI Origin running
the latest version of IRIX with the MIPSpro compiler suite, which
is all the hardware I need to keep things chugging along.  (IRIX
also has a huge active "fan" base of users that run a lot of OSS
software -- nekoware et al.)

> Both IRIX and the MIPS processor lines it runs on was retired by SGI
> in 2007.  That's why support for IRIX was pulled from Python 3.

Support was pulled for, to quote PEP 11, "IRIX 4 and --with-sgi-dl";

PEP 11 also has a nice clause that basically says platform support
is primarily based on having an active maintainer willing to keep
everything in shape -- I'm happy to be marked as the maintainer for
all the aforementioned *NIX platforms.

Martin made a good point a few weeks ago when we discussed this on
infrastructure@; his concern was the effort involved in supporting
additional platforms could detract developers from more important
tasks.

I agree -- they're esoteric platforms at best, EOL at worst, and
just because I'm maintaining them shouldn't mean other developers
have to worry about breaking them.  They're not anywhere near as
important as the big 3 (Linux/Windows/OSX).  If they do break,
though, I'll keep fixing them as long as I'm actively maintaining
support for that platform.

The motivation behind this particular change is simple: it took
about three days to nail down the exact flags to use on Solaris
SPARC 32-bit to get a working ./python (with lots of referring
to various Sun/Oracle compiler docs).  No-one else should have
to go through this much effort -- ./configure should pick the
right flags out of the box for the following permutations:

32/64 bit debug builds:
./configure --without-gcc --with-pydebug
./configure --without-gcc --with-pydebug --enable-64bit

32/64 bit release builds:
./configure --without-gcc
./configure --without-gcc --enable-64bit

(And again, just to clarify, none of this work will remotely
 affect Linux, OS X or the *BSDs.  It doesn't take three days
 of reading compiler manuals to get working builds on those
 platforms.)

--
title: Improve ./configure's support for 32/64-bit debug|release|profiled 
builds w/ vendor (non-gcc) compilers on   proprietary UNIX systems 
(Solaris/HP-UX/AIX et al). -> Improve ./configure's support for 32/64-bit 
debug|release|profiled builds w/ vendor (non-gcc) compilers  on proprietary 
UNIX systems (Solaris/HP-UX/AIX et al).

___
Python tracker 

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



[issue16678] optparse: parse only known options

2012-12-14 Thread R. David Murray

R. David Murray added the comment:

We aren't encouraging people to use optparse any more.  The recipe isn't needed 
in argparse, as that has a "parse_known_args" method that achieves the same end.

--
nosy: +r.david.murray

___
Python tracker 

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



[issue16421] importlib.machinery.ExtensionFileLoader cannot load several modules from the same shared object

2012-12-14 Thread Andrew Svetlov

Andrew Svetlov added the comment:

Committed. Sorry for delay.
Thanks, Vaclav!

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

___
Python tracker 

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



[issue16377] Fix bisect unittest

2012-12-14 Thread Jesús Cea Avión

Changes by Jesús Cea Avión :


--
nosy: +jcea

___
Python tracker 

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



[issue16421] importlib.machinery.ExtensionFileLoader cannot load several modules from the same shared object

2012-12-14 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 6eefe4d537b3 by Andrew Svetlov in branch 'default':
Issue #16421: allow to load multiple modules from the same shared object.
http://hg.python.org/cpython/rev/6eefe4d537b3

--
nosy: +python-dev

___
Python tracker 

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



[issue16584] unhandled IOError filecmp.cmpfiles() if file not readable

2012-12-14 Thread Andrew Svetlov

Andrew Svetlov added the comment:

The error can be reproduced for 2.7 and 3.2.
Starting from 3.3 os.error and IOError both aliases for OSError and patch 
doesn't needed.

--
nosy: +asvetlov

___
Python tracker 

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



[issue879399] socket line buffering

2012-12-14 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Would be nice to add a test...

--
nosy: +pitrou
versions:  -Python 3.1, Python 3.2

___
Python tracker 

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



[issue15651] PEP 3121, 384 refactoring applied to elementtree module

2012-12-14 Thread Robin Schreiber

Robin Schreiber added the comment:

Patch updated to work with current 3.4 Branch version of elementtree.

--
keywords: +patch
Added file: http://bugs.python.org/file28311/_elementtree_pep3121-384_v1.patch

___
Python tracker 

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



[issue16619] LOAD_GLOBAL used to load `None` under certain circumstances

2012-12-14 Thread STINNER Victor

Changes by STINNER Victor :


--
nosy: +haypo

___
Python tracker 

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



[issue16421] importlib.machinery.ExtensionFileLoader cannot load several modules from the same shared object

2012-12-14 Thread STINNER Victor

STINNER Victor added the comment:

Some tests are failing since the changeset 6eefe4d537b3.

Example:
http://buildbot.python.org/all/builders/x86%20RHEL%206%203.x/builds/1431/steps/test/logs/stdio

Please check buildbots.

[176/371] test_pkgutil
test_getdata_filesys (test.test_pkgutil.PkgutilTests) ... ok
test_getdata_zipfile (test.test_pkgutil.PkgutilTests) ... ok
test_unreadable_dir_on_syspath (test.test_pkgutil.PkgutilTests) ... ok
test_alreadyloaded (test.test_pkgutil.PkgutilPEP302Tests) ... ERROR
test_getdata_pep302 (test.test_pkgutil.PkgutilPEP302Tests) ... ERROR
test_mixed_namespace (test.test_pkgutil.ExtendPathTests) ... ERROR
test_simple (test.test_pkgutil.ExtendPathTests) ... ERROR
test_nested (test.test_pkgutil.NestedNamespacePackageTest) ... ok
test_get_importer_avoids_emulation (test.test_pkgutil.ImportlibMigrationTests) 
... ok
test_get_loader_avoids_emulation (test.test_pkgutil.ImportlibMigrationTests) 
... ok
test_importer_deprecated (test.test_pkgutil.ImportlibMigrationTests) ... ok
test_iter_importers_avoids_emulation 
(test.test_pkgutil.ImportlibMigrationTests) ... ok
test_loader_deprecated (test.test_pkgutil.ImportlibMigrationTests) ... ok

==
ERROR: test_alreadyloaded (test.test_pkgutil.PkgutilPEP302Tests)
--
Traceback (most recent call last):
  File 
"/home/buildbot/buildarea/3.x.coghlan-redhat/build/Lib/test/test_pkgutil.py", 
line 139, in test_alreadyloaded
self.assertEqual(foo.loads, 1)
AttributeError: 'module' object has no attribute 'loads'

==
ERROR: test_getdata_pep302 (test.test_pkgutil.PkgutilPEP302Tests)
--
Traceback (most recent call last):
  File "/home/buildbot/buildarea/3.x.coghlan-redhat/build/Lib/pkgutil.py", line 
502, in find_loader
return importlib.find_loader(fullname, path)
  File 
"/home/buildbot/buildarea/3.x.coghlan-redhat/build/Lib/importlib/__init__.py", 
line 64, in find_loader
loader = sys.modules[name].__loader__
AttributeError: 'module' object has no attribute '__loader__'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File 
"/home/buildbot/buildarea/3.x.coghlan-redhat/build/Lib/test/test_pkgutil.py", 
line 131, in test_getdata_pep302
self.assertEqual(pkgutil.get_data('foo', 'dummy'), "Hello, world!")
  File "/home/buildbot/buildarea/3.x.coghlan-redhat/build/Lib/pkgutil.py", line 
625, in get_data
loader = get_loader(package)
  File "/home/buildbot/buildarea/3.x.coghlan-redhat/build/Lib/pkgutil.py", line 
480, in get_loader
return find_loader(fullname)
  File "/home/buildbot/buildarea/3.x.coghlan-redhat/build/Lib/pkgutil.py", line 
508, in find_loader
raise ImportError(msg.format(fullname, type(ex), ex)) from ex
ImportError: Error while finding loader for 'foo' (: 
'module' object has no attribute '__loader__')

==
ERROR: test_mixed_namespace (test.test_pkgutil.ExtendPathTests)
--
Traceback (most recent call last):
  File "", line 1523, in _find_and_load_unlocked
AttributeError: 'module' object has no attribute '__path__'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File 
"/home/buildbot/buildarea/3.x.coghlan-redhat/build/Lib/test/test_pkgutil.py", 
line 198, in test_mixed_namespace
import foo.bar
ImportError: No module named 'foo.bar'; foo is not a package

==
ERROR: test_simple (test.test_pkgutil.ExtendPathTests)
--
Traceback (most recent call last):
  File "", line 1523, in _find_and_load_unlocked
AttributeError: 'module' object has no attribute '__path__'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File 
"/home/buildbot/buildarea/3.x.coghlan-redhat/build/Lib/test/test_pkgutil.py", 
line 170, in test_simple
import foo.bar
ImportError: No module named 'foo.bar'; foo is not a package

--
Ran 13 tests in 0.027s

--
nosy: +haypo
resolution: fixed -> 
status: closed -> open

___
Python tracker 

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



[issue3871] cross and native build of python for mingw* hosts

2012-12-14 Thread Jason Huntley

Jason Huntley added the comment:

I'm attempting to build Python-3.3.0 with mingw64. I get a minute or two into 
the build and fail with this error:

./Include/pythonrun.h:178:1: warning: function declaration isn't a prototype [-W
strict-prototypes]
./Modules/getpath.c: In function 'isfile':
./Modules/getpath.c:153:5: warning: implicit declaration of function '_Py_wstat'
 [-Wimplicit-function-declaration]
./Modules/getpath.c: In function 'find_env_config_value':
./Modules/getpath.c:298:17: error: too many arguments to function 'wcstok'
In file included from c:\projects\tools\osm\dev\mapnik\custom\environment\instal
l\mingw64\bin\../lib/gcc/x86_64-w64-mingw32/4.7.2/../../../../x86_64-w64-mingw32
/include/io.h:10:0,
 from ./PC/pyconfig.h:68,
 from ./Include/Python.h:8,
 from ./Modules/getpath.c:3:

It seems some people here were using this patch against 3.3.0 at one point. Did 
you guys ever succeed? Once I've applied the patch, i can get a little further, 
but the build eventually fails again. Also, conftest continually fails to run 
during configure.

I'm using the following settings to get the build going:

export "CFLAGS=-I/mingw/include"
export "LDFLAGS=-L/mingw/lib"
export "CPPFLAGS=-I/mingw/include" 
export "CFLAGS=$CFLAGS -I./PC -DMS_WIN64 -D__MINGW32__"


#http://bugs.python.org/issue3871
#wget http://bugs.python.org/file27474/py3k-20121004-MINGW.patch
wget http://bugs.python.org/file26572/python-py3k-20120729-MINGW.patch

#patch -t -p1 < "py3k-20121004-MINGW.patch"
patch -t -p1 < python-py3k-20120729-MINGW.patch

./configure --host=x86_64-w64-mingw32 --build=x86_64-w64-mingw32 --prefix=/mingw

make

If I patch before configure, I get the following exception when running 
./configure:

bad word @INITSYS@ in @INITSYS@ posixmodule.c
mv: cannot stat `config.c': No such file or directory

After configure, is where it gets further, until it finally fails on:

c:\projects\tools\osm\dev\mapnik\custom\environment\install\mingw64\bin\../lib/g
cc/x86_64-w64-mingw32/4.7.2/../../../../x86_64-w64-mingw32/include/io.h:311:15:
note: previous declaration of 'chmod' was here
./Modules/posixmodule.c:262:32: error: unknown type name 'uid_t'
./Modules/posixmodule.c:262:39: error: unknown type name 'gid_t'

You can replicate my environment exactly by running the following deployment 
scripts from my project here:

https://github.com/onepremise/MinGW-AD64S/

Just open dos in admin mode and run setup.bat.

Any help is greatly appreciated. Thanks!

--
nosy: +jhuntley

___
Python tracker 

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



[issue16656] os.walk ignores international dirs on Windows

2012-12-14 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Thanks, Anatoly. I see an actual bug. FindFirstFile and FindNextFile return 
broken name if file unicode name can't be represented in current codepage.

I don't know what is perfect solution for this issue.

On 2.7 we can decode listdir() argument to unicode and then encode result names 
to str with sys.getfilesystemencoding() only if it is possible. Therefore 
listdir() with str argument will return unicode for non-encodable names. This 
should not make many new problems in addition to those which 2.7 already have 
with Unicode.

But on 3.x listdir() with bytes argument can returns only bytes objects. I 
don't know what to do with non-encodable names in such case. Perhaps an 
exception should be raised. Fortunately listdir() with bytes argument is rarely 
used on 3.x.

--
components: +Extension Modules, Unicode, Windows -Library (Lib)
nosy: +ezio.melotti, larry, loewis

___
Python tracker 

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



[issue6331] Add unicode script info to the unicode database

2012-12-14 Thread Pander

Pander added the comment:

Please, also consider reviewing functionality offered by:
  http://pypi.python.org/pypi/unicodescript/
and
  http://pypi.python.org/pypi/unicodeblocks/
which could be used to improve and extend the proposed patch.

--
nosy: +PanderMusubi

___
Python tracker 

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



[issue16669] Docstrings for namedtuple

2012-12-14 Thread Giampaolo Rodola'

Giampaolo Rodola' added the comment:

> I don't think it is worth complicating the API for this.  There have 
> been zero requests for this functionality.  Even the doc field of 
> property() is rarely used.

+1

--
nosy: +giampaolo.rodola

___
Python tracker 

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



[issue879399] socket line buffering

2012-12-14 Thread Kristján Valur Jónsson

Kristján Valur Jónsson added the comment:

Good point, will do.

--

___
Python tracker 

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



[issue16656] os.walk ignores international dirs on Windows

2012-12-14 Thread R. David Murray

R. David Murray added the comment:

That's what surrogateescape is for, on linux.  I thought Victor dealt with this 
a different way in Windows.  Maybe by deprecating the bytes interface :)

--
nosy: +haypo

___
Python tracker 

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



[issue16676] Segfault under Python 3.3 after PyType_GenericNew

2012-12-14 Thread Mark Shannon

Changes by Mark Shannon :


--
nosy: +Mark.Shannon

___
Python tracker 

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



[issue16681] Documentation 'bidirectional category' should be 'bidirectional class' in unicodedata package

2012-12-14 Thread Pander

New submission from Pander:

Documentation in
  docs.python.org/3/library/unicodedata.html
on 'bidirectional category' should be 'bidirectional class' in unicodedata 
package. Please see
  www.unicode.org/Public/UNIDATA/PropertyValueAliases.txt
where only bidirectional class is being referred to.

--
components: Unicode
messages: 177473
nosy: PanderMusubi, ezio.melotti
priority: normal
severity: normal
status: open
title: Documentation 'bidirectional category' should be 'bidirectional class' 
in unicodedata package
type: enhancement
versions: Python 3.5

___
Python tracker 

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



[issue16682] Document that audioop works with bytes, not strings

2012-12-14 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

The audioop module documentation says that functions works with Python strings. 
This was right in 2.x, but in 3.x here should be bytes objects (actually the 
functions accept strings too, but this is an implementation detail, meaningless 
in general).

--
assignee: docs@python
components: Documentation
messages: 177474
nosy: docs@python, serhiy.storchaka
priority: normal
severity: normal
stage: patch review
status: open
title: Document that audioop works with bytes, not strings
type: enhancement
versions: Python 3.2, Python 3.3, Python 3.4

___
Python tracker 

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



[issue16682] Document that audioop works with bytes, not strings

2012-12-14 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
keywords: +patch
Added file: http://bugs.python.org/file28312/audioop_docs_bytes.patch

___
Python tracker 

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



[issue16683] Resort audioop documentation

2012-12-14 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

Functions in the audioop module documentation enumerated in alphabetic order. 
Only one function out of order. Here is a patch that fixes this.

--
assignee: docs@python
components: Documentation
files: audioop_docs_resort.patch
keywords: patch
messages: 177475
nosy: docs@python, serhiy.storchaka
priority: normal
severity: normal
stage: patch review
status: open
title: Resort audioop documentation
type: enhancement
versions: Python 2.7, Python 3.2, Python 3.3, Python 3.4
Added file: http://bugs.python.org/file28313/audioop_docs_resort.patch

___
Python tracker 

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



[issue16684] Unicode property value abbreviated names and long names

2012-12-14 Thread Pander

New submission from Pander:

The package unicodedata
  http://docs.python.org/3/library/unicodedata.html
offers looking up of property values in terms of general category, 
bidirectional class and east asian width for Unicode characters
  unicodedata.category(unichr)
  unicodedata.bidirectional(unichr)
  unicodedata.east_asian_width(chr)

The abbreviated name of the specific category is returned. However, for certain 
applications it is important to be able to get the from abbreviated name to the 
long name and vice versa.

The data needed to do this can be found at
  http://www.unicode.org/Public/UNIDATA/PropertyValueAliases.txt
under sections
  # General_Category (gc)
  # Bidi_Class (bc)
  # East_Asian_Width (ea)
Use only the second (abbreviated name) and third (long name) fields and 
ignoring other fields and possible comments.

For general category, also support translation back and forth of the one-letter 
abbreviations which are groups representing two-letter general categories 
abbreviations with the same initial letter.

Please extend this package with a way of translating back and forth between 
abbreviated name and long name for property values defined in Unicode for 
general category, bidirectional class and East Asian width. This functionality 
should be independent of retrieving the abbreviated names for Unicode character 
as is available now and should be accessible via separate methods or 
dictionaries in which developers can perform lookups themselves.

Implementing the functionality requested in this issue allows Python developers 
to get from an abbreviated property value to a meaningful property value name 
and vice versa without having to retrieve this information from the Unicode 
Consortium and/or shipping this information with their code with the risk of 
using outdated information.

--
components: Unicode
messages: 177476
nosy: PanderMusubi, ezio.melotti
priority: normal
severity: normal
status: open
title: Unicode property value abbreviated names and long names
type: enhancement
versions: Python 3.5

___
Python tracker 

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



[issue16685] Deprecate accepting strings as arguments in audioop functions

2012-12-14 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

Inadvertently strings accepted as arguments of audioop functions. This is a 
meaningless behavior and remnant of Python 2. We should drop string support.

--
components: Extension Modules
messages: 177477
nosy: serhiy.storchaka
priority: normal
severity: normal
stage: needs patch
status: open
title: Deprecate accepting strings as arguments in audioop functions
type: enhancement
versions: Python 3.4

___
Python tracker 

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



[issue16685] Deprecate accepting strings as arguments in audioop functions

2012-12-14 Thread STINNER Victor

Changes by STINNER Victor :


--
nosy: +haypo

___
Python tracker 

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



[issue15651] PEP 3121, 384 refactoring applied to elementtree module

2012-12-14 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis :


--
nosy: +Arfrever

___
Python tracker 

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



[issue16656] os.walk ignores international dirs on Windows

2012-12-14 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Surrogateescape is for non-decodable names. Here we have a problem with 
non-encodable names.

I know that naive approach with using only Unicode API inside is not work 
because Windows use complex logic for filename encoding (for example dropping 
diacritics). Perhaps Martin have more to say.

--

___
Python tracker 

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



[issue16684] Unicode property value abbreviated names and long names

2012-12-14 Thread Ezio Melotti

Ezio Melotti added the comment:

> for certain applications it is important to be able to get the from 
> abbreviated name to the long name and vice versa.

What kind of application?  I have a module where I defined my own dict that 
maps categories with their full names, but I'm not sure this feature is common 
enough that should be included and maintained in the stdlib.

If it's added, a dict is probably enough, but a script to parse the file you 
mentioned and update this dict should also be included.

--
stage:  -> needs patch
versions: +Python 3.4 -Python 3.5

___
Python tracker 

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



[issue16626] Infinite recursion in glob.glob('*:') on Windows

2012-12-14 Thread Éric Araujo

Éric Araujo added the comment:

Patch contains unrelated changes.

--
nosy: +eric.araujo

___
Python tracker 

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



[issue16685] Deprecate accepting strings as arguments in audioop functions

2012-12-14 Thread Jesús Cea Avión

Changes by Jesús Cea Avión :


--
nosy: +jcea

___
Python tracker 

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



[issue16681] Documentation 'bidirectional category' should be 'bidirectional class' in unicodedata package

2012-12-14 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 02de73bae814 by Ezio Melotti in branch '2.7':
#16681: use "bidirectional class" instead of "bidirectional category".
http://hg.python.org/cpython/rev/02de73bae814

New changeset 97688292bfe5 by Ezio Melotti in branch '3.2':
#16681: use "bidirectional class" instead of "bidirectional category".
http://hg.python.org/cpython/rev/97688292bfe5

New changeset e9d59cca31fc by Ezio Melotti in branch '2.7':
#16681: use "bidirectional class" instead of "bidirectional category" in the 
docstring too.
http://hg.python.org/cpython/rev/e9d59cca31fc

New changeset f34d3ba955d1 by Ezio Melotti in branch '3.2':
#16681: use "bidirectional class" instead of "bidirectional category" in the 
docstring too.
http://hg.python.org/cpython/rev/f34d3ba955d1

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

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

--
nosy: +python-dev

___
Python tracker 

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



[issue16681] Documentation 'bidirectional category' should be 'bidirectional class' in unicodedata package

2012-12-14 Thread Ezio Melotti

Ezio Melotti added the comment:

Fixed, thanks for the report!

--
assignee:  -> ezio.melotti
components: +Documentation
resolution:  -> fixed
stage:  -> committed/rejected
status: open -> closed
versions: +Python 2.7, Python 3.2, Python 3.3, Python 3.4 -Python 3.5

___
Python tracker 

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



[issue16686] audioop overflow issues

2012-12-14 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

The audioop module has some issues with an overflow.

1. It uses post-checks for an integer overflow. This means using an undefined 
behavior.

2. When the result truncated in case of overflow, -maxval used as minimal 
value. But real minimum value is less (-maxval - 1). This means not using full 
possible range and causes an odd result of some operations (for example 
add(b'\x80', '\x00', 1) returns b'\x81').

3. Some operations (for example bias()) does not truncating and just overflow.

4. lin2lin() conversion from 4 to 4 (should do nothing) loses 16 lowest bits.

--
components: Extension Modules
messages: 177482
nosy: mark.dickinson, serhiy.storchaka
priority: normal
severity: normal
stage: needs patch
status: open
title: audioop overflow issues
type: behavior
versions: Python 2.7, Python 3.2, Python 3.3, Python 3.4

___
Python tracker 

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



[issue16683] Resort audioop documentation

2012-12-14 Thread Roundup Robot

Roundup Robot added the comment:

New changeset e451901e6243 by Ezio Melotti in branch '2.7':
#16683: restore alphabetical order in audioop docs.  Patch by Serhiy Storchaka.
http://hg.python.org/cpython/rev/e451901e6243

New changeset 5777ac884919 by Ezio Melotti in branch '3.2':
#16683: restore alphabetical order in audioop docs.  Patch by Serhiy Storchaka.
http://hg.python.org/cpython/rev/5777ac884919

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

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

--
nosy: +python-dev

___
Python tracker 

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



[issue16626] Infinite recursion in glob.glob('*:') on Windows

2012-12-14 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

> Patch contains unrelated changes.

Sorry, my fault.

Here is a cleaned patch.

--
Added file: http://bugs.python.org/file28314/glob_magic_in_drive.patch

___
Python tracker 

___diff -r ece75a3b942c Lib/glob.py
--- a/Lib/glob.py   Wed Dec 05 17:59:29 2012 +0200
+++ b/Lib/glob.py   Thu Dec 06 13:07:58 2012 +0200
@@ -28,7 +28,7 @@
 if not dirname:
 yield from glob1(None, basename)
 return
-if has_magic(dirname):
+if dirname != pathname and has_magic(dirname):
 dirs = iglob(dirname)
 else:
 dirs = [dirname]
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16683] Resort audioop documentation

2012-12-14 Thread Ezio Melotti

Ezio Melotti added the comment:

Fixed, thanks for the report!

--
assignee: docs@python -> ezio.melotti
nosy: +ezio.melotti
resolution:  -> fixed
stage: patch review -> committed/rejected
status: open -> closed

___
Python tracker 

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



[issue16626] Infinite recursion in glob.glob('*:') on Windows

2012-12-14 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


Removed file: http://bugs.python.org/file28221/glob_magic_in_drive.patch

___
Python tracker 

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



[issue16685] Deprecate accepting strings as arguments in audioop functions

2012-12-14 Thread Ezio Melotti

Ezio Melotti added the comment:

What happens if you pass strings?
If it doesn't work we can just fix it to raise an exception and stop returning 
random results, if it works but bytes should be used instead, we should go 
through a deprecation process.

--
nosy: +ezio.melotti

___
Python tracker 

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



[issue16686] audioop overflow issues

2012-12-14 Thread Jesús Cea Avión

Changes by Jesús Cea Avión :


--
nosy: +jcea

___
Python tracker 

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



[issue16685] Deprecate accepting strings as arguments in audioop functions

2012-12-14 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

> What happens if you pass strings?

They are encoded with UTF-8. See 's#' and 's*' formats in PyArg_ParseTuple() 
('y*' recommended for bytes).

--

___
Python tracker 

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



[issue15671] PEP 3121, 384 Refactoring applied to struct module

2012-12-14 Thread Robin Schreiber

Robin Schreiber added the comment:

Updated patch to work with 3.4 Branch version of _struct.c

--
keywords: +patch
Added file: http://bugs.python.org/file28315/_struct_pep3121-384_v1.patch

___
Python tracker 

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



[issue15690] PEP 3121, 384 Refactoring applied to parser module

2012-12-14 Thread Robin Schreiber

Robin Schreiber added the comment:

Updated parsermodule patch to work with 3.4 Branch version.

--
keywords: +patch
Added file: http://bugs.python.org/file28316/parser_pep3121-384_v1.patch

___
Python tracker 

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



[issue15671] PEP 3121, 384 Refactoring applied to struct module

2012-12-14 Thread Stefan Krah

Stefan Krah added the comment:

Robin, if you use ...

[diff]
git = on


... in your .hgrc, then the bug tracker will automatically generate
a Rietveld review link (At least I think that's what prevents links
from being generated).

--
nosy: +skrah

___
Python tracker 

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



[issue16656] os.walk ignores international dirs on Windows

2012-12-14 Thread R. David Murray

R. David Murray added the comment:

Ah, I misunderstood your comment.

So, listdir is returning the "correct" the filename, it's just that we can't 
encode it to the console encoding.  So, it is working as expected within the 
current windows console limitations, if not in a particularly useful fashion.

(That is, listdir/os.walk are *not* ignoring the international dirs.)

--

___
Python tracker 

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



[issue15691] PEP 3121, 384 Refactoring applied to posix module

2012-12-14 Thread Robin Schreiber

Robin Schreiber added the comment:

Updated posixmodule to work with the 3.4 Branch version.

--
keywords: +patch
Added file: http://bugs.python.org/file28317/posix_pep3121-384_v1.patch

___
Python tracker 

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



[issue16656] os.walk ignores international dirs on Windows

2012-12-14 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

> Ah, I misunderstood your comment.

Ah, you misunderstood my comment right now.

> So, listdir is returning the "correct" the filename, it's just that we can't 
> encode it to the console encoding.

listdir() returns already irremediably broken filename (all Cyrillic
letters replaced with '?'). My test script outputs only ascii data, you
see literally what you get, there is no output encoding issues.

--

___
Python tracker 

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



[issue16656] os.listdir() returns unusable bytes result on Windows

2012-12-14 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
title: os.walk ignores international dirs on Windows -> os.listdir() returns 
unusable bytes result on Windows

___
Python tracker 

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



[issue16612] Integrate "Argument Clinic" specialized preprocessor into CPython trunk

2012-12-14 Thread Stefan Krah

Stefan Krah added the comment:

Larry Hastings  wrote:
> Finally, since you have not addressed it directly, let me ask you:
> are you interested in Clinic having a more boilerplate-friendly macro
> processing mode, with templates or recycling old entries or something?
> Or do you not care?  If it doesn't help you then I may as well not bother.

Thanks for the offer. -- Currently I think that for me the easiest option is
to add the signature information manually. So unless other people want this
feature, I'd say don't bother implementing it.

--

___
Python tracker 

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



[issue16656] os.listdir() returns unusable bytes result on Windows

2012-12-14 Thread R. David Murray

R. David Murray added the comment:

Oh, I remember Victor complaining about that behavior of Windows.  I'm pretty 
sure it is the windows API and not python that is doing that mangling.  But 
Victor would know for sure.

--

___
Python tracker 

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



[issue16612] Integrate "Argument Clinic" specialized preprocessor into CPython trunk

2012-12-14 Thread Antoine Pitrou

Antoine Pitrou added the comment:

I'll ask again, do you plan to write a PEP to iron out the functional
details? I don't think a tracker entry is the right format for this.

Le vendredi 14 décembre 2012 à 07:21 +, Larry Hastings a écrit :
> Larry Hastings added the comment:
> 
> I don't think we can solve the problem of the output being too long
> for your liking.  Personally I like the output; I find it eminently
> readable, and making it shorter would impair that.  I think in the
> majority of uses Clinic will be a win for readability.

--

___
Python tracker 

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



[issue16678] optparse: parse only known options

2012-12-14 Thread Éric Araujo

Éric Araujo added the comment:

I agree with David and suggest closing this as outdated.  Thanks for the 
suggestion nonetheless.

--
nosy: +eric.araujo

___
Python tracker 

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



[issue16612] Integrate "Argument Clinic" specialized preprocessor into CPython trunk

2012-12-14 Thread Larry Hastings

Larry Hastings added the comment:

I have no current plan to write a PEP.  I don't know how to settle the 
difference of opinion here; the easiest thing would be if you convinced Guido 
we needed one.

--

___
Python tracker 

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



[issue16612] Integrate "Argument Clinic" specialized preprocessor into CPython trunk

2012-12-14 Thread Gregory P. Smith

Gregory P. Smith added the comment:

There's a bit of an impasse here on the PEP front.  Guido said it wasn't 
needed.  Antoine brings up the point that CPython developers will have to live 
with the result of this work so maybe something more easy to read and see in 
one place like a PEP would be valuable...

That said, I think a lot of that has been done if you look at the clinic.txt 
file within the patch.  That already contains the meat of what would go into a 
PEP.

What more is required?  I personally think we should iterate on this via 
checked in code in 3.4.

--
nosy: +gvanrossum

___
Python tracker 

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



[issue16612] Integrate "Argument Clinic" specialized preprocessor into CPython trunk

2012-12-14 Thread Antoine Pitrou

Antoine Pitrou added the comment:

> I have no current plan to write a PEP.  I don't know how to settle the
> difference of opinion here; the easiest thing would be if you
> convinced Guido we needed one.

This is silly. Nobody is opposed to you writing a PEP and a couple
people would like you to do it. What needs settling exactly?

--

___
Python tracker 

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



[issue16612] Integrate "Argument Clinic" specialized preprocessor into CPython trunk

2012-12-14 Thread Gregory P. Smith

Gregory P. Smith added the comment:

PEPs are perceived as a hurdle. Regardless, clinic.txt would turn into one
pretty easily so just doing it may be easiest. :)

On Fri, Dec 14, 2012 at 12:11 PM, Antoine Pitrou wrote:

>
> Antoine Pitrou added the comment:
>
> > I have no current plan to write a PEP.  I don't know how to settle the
> > difference of opinion here; the easiest thing would be if you
> > convinced Guido we needed one.
>
> This is silly. Nobody is opposed to you writing a PEP and a couple
> people would like you to do it. What needs settling exactly?
>
> --
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue16656] os.listdir() returns unusable bytes result on Windows

2012-12-14 Thread Larry Hastings

Larry Hastings added the comment:

I'm a little confused.  FindFirstFile is an ANSI API, so we get a narrow string 
back.  We call PyBytes_FromString(), which expects a narrow string and returns 
a bytes object.  Who's trying (and failing) to encode the filename?

--

___
Python tracker 

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



[issue16678] optparse: parse only known options

2012-12-14 Thread Andrew Svetlov

Andrew Svetlov added the comment:

+1 for closing as "won't fix"

--
nosy: +asvetlov

___
Python tracker 

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



[issue16612] Integrate "Argument Clinic" specialized preprocessor into CPython trunk

2012-12-14 Thread Antoine Pitrou

Antoine Pitrou added the comment:

> That said, I think a lot of that has been done if you look at the
> clinic.txt file within the patch.  That already contains the meat of
> what would go into a PEP.

Certainly. A PEP doesn't have to be a 100% new text.

--

___
Python tracker 

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



[issue6331] Add unicode script info to the unicode database

2012-12-14 Thread Pander

Pander added the comment:

The latest version of the respective sources can be found here:
  https://github.com/ConradIrwin/unicodescript
and here:
  https://github.com/simukis/unicodeblocks

--

___
Python tracker 

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



[issue16678] optparse: parse only known options

2012-12-14 Thread R. David Murray

Changes by R. David Murray :


--
resolution:  -> out of date
stage:  -> committed/rejected
status: open -> closed

___
Python tracker 

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



[issue16687] Fix small gramatical error and add reference link in hashlib documentation

2012-12-14 Thread Jeff Knupp

New submission from Jeff Knupp:

Original text is: 

> Feeding string objects is to update is not supported

Should be "... objects in to update" instead of "is to"

Also, mark "GIL" as a :term: to provide a link to its definition, as it's used 
without much context in the following note:

> .. note::
>
>   For better multithreading performance, the Python :term:`GIL` is 
>   released for strings of more than 2047 bytes at object creation or
>   on update.

--
assignee: docs@python
components: Documentation
files: patch.txt
messages: 177507
nosy: Jeff.Knupp, docs@python
priority: normal
severity: normal
status: open
title: Fix small gramatical error and add reference link in hashlib 
documentation
versions: Python 3.5
Added file: http://bugs.python.org/file28318/patch.txt

___
Python tracker 

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



[issue15743] test_urllib2/test_urllib use deprecated urllib.Request methods

2012-12-14 Thread Jeff Knupp

Changes by Jeff Knupp :


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

___
Python tracker 

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



[issue16656] os.listdir() returns unusable bytes result on Windows

2012-12-14 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

> Who's trying (and failing) to encode the filename?

Windows. File created using Unicode API and stored UTF-16 encoded in
NTFS. Windows fails to represent this filename using ANSI API.

Here is a patch against 2.7 which always uses Unicode API in listdir()
and tries to encode filenames to str if str argument used.

--
keywords: +patch
Added file: http://bugs.python.org/file28319/listdir_unicode-2.7.patch

___
Python tracker 

___diff -r 45cd2d816f4d Modules/posixmodule.c
--- a/Modules/posixmodule.c Sun Jul 08 02:22:44 2012 -0700
+++ b/Modules/posixmodule.c Fri Dec 14 22:48:53 2012 +0200
@@ -2099,120 +2099,74 @@
 PyObject *d, *v;
 HANDLE hFindFile;
 BOOL result;
-WIN32_FIND_DATA FileData;
 char namebuf[MAX_PATH+5]; /* Overallocate for \\*.*\0 */
 char *bufptr = namebuf;
 Py_ssize_t len = sizeof(namebuf)-5; /* only claim to have space for 
MAX_PATH */
-
 PyObject *po;
-if (PyArg_ParseTuple(args, "U:listdir", &po)) {
-WIN32_FIND_DATAW wFileData;
-Py_UNICODE *wnamebuf;
-/* Overallocate for \\*.*\0 */
-len = PyUnicode_GET_SIZE(po);
-wnamebuf = malloc((len + 5) * sizeof(wchar_t));
-if (!wnamebuf) {
-PyErr_NoMemory();
+PyObject *decoded = NULL;
+WIN32_FIND_DATAW wFileData;
+Py_UNICODE *wnamebuf;
+
+if (!PyArg_ParseTuple(args, "U:listdir", &po)) {
+if (!PyArg_ParseTuple(args, "et#:listdir",
+  Py_FileSystemDefaultEncoding, &bufptr, &len))
 return NULL;
-}
-wcscpy(wnamebuf, PyUnicode_AS_UNICODE(po));
-if (len > 0) {
-Py_UNICODE wch = wnamebuf[len-1];
-if (wch != L'/' && wch != L'\\' && wch != L':')
-wnamebuf[len++] = L'\\';
-wcscpy(wnamebuf + len, L"*.*");
-}
-if ((d = PyList_New(0)) == NULL) {
-free(wnamebuf);
+po = decoded = PyUnicode_Decode(bufptr, len,
+Py_FileSystemDefaultEncoding, NULL);
+if (po == NULL)
 return NULL;
-}
-Py_BEGIN_ALLOW_THREADS
-hFindFile = FindFirstFileW(wnamebuf, &wFileData);
-Py_END_ALLOW_THREADS
-if (hFindFile == INVALID_HANDLE_VALUE) {
-int error = GetLastError();
-if (error == ERROR_FILE_NOT_FOUND) {
-free(wnamebuf);
-return d;
-}
-Py_DECREF(d);
-win32_error_unicode("FindFirstFileW", wnamebuf);
-free(wnamebuf);
-return NULL;
-}
-do {
-/* Skip over . and .. */
-if (wcscmp(wFileData.cFileName, L".") != 0 &&
-wcscmp(wFileData.cFileName, L"..") != 0) {
-v = PyUnicode_FromUnicode(wFileData.cFileName, 
wcslen(wFileData.cFileName));
-if (v == NULL) {
-Py_DECREF(d);
-d = NULL;
-break;
-}
-if (PyList_Append(d, v) != 0) {
-Py_DECREF(v);
-Py_DECREF(d);
-d = NULL;
-break;
-}
-Py_DECREF(v);
-}
-Py_BEGIN_ALLOW_THREADS
-result = FindNextFileW(hFindFile, &wFileData);
-Py_END_ALLOW_THREADS
-/* FindNextFile sets error to ERROR_NO_MORE_FILES if
-   it got to the end of the directory. */
-if (!result && GetLastError() != ERROR_NO_MORE_FILES) {
-Py_DECREF(d);
-win32_error_unicode("FindNextFileW", wnamebuf);
-FindClose(hFindFile);
-free(wnamebuf);
-return NULL;
-}
-} while (result == TRUE);
-
-if (FindClose(hFindFile) == FALSE) {
-Py_DECREF(d);
-win32_error_unicode("FindClose", wnamebuf);
-free(wnamebuf);
-return NULL;
-}
+}
+
+/* Overallocate for \\*.*\0 */
+len = PyUnicode_GET_SIZE(po);
+wnamebuf = malloc((len + 5) * sizeof(wchar_t));
+if (!wnamebuf) {
+Py_XDECREF(decoded);
+PyErr_NoMemory();
+return NULL;
+}
+wcscpy(wnamebuf, PyUnicode_AS_UNICODE(po));
+if (len > 0) {
+Py_UNICODE wch = wnamebuf[len-1];
+if (wch != L'/' && wch != L'\\' && wch != L':')
+wnamebuf[len++] = L'\\';
+wcscpy(wnamebuf + len, L"*.*");
+}
+if ((d = PyList_New(0)) == NULL) {
 free(wnamebuf);
-return d;
-}
-/* Drop the argument parsing error as narrow strings
-   are also valid. */
-PyErr_Clear();
-
-if (!PyArg_ParseTuple(args, "et#:listdir",
-  Py_FileSystemDefaultEncoding, &bufptr, &len))
-return NULL

[issue16656] os.listdir() returns unusable bytes result on Windows

2012-12-14 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I can't test (and even compile) the patch as I don't have a Windows,
please test it for me.

--

___
Python tracker 

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



[issue16684] Unicode property value abbreviated names and long names

2012-12-14 Thread Pander

Pander added the comment:

I myself have a lot of Python applications that process font files and interact 
with fonttools and FontForge, which are both written in Python too. As you also 
have your own dict for this purpose and probably other people too, it would be 
justified to add these three small dicts in the standard lib. Especially since 
this package in the standard lib follows the definitions from Unicode 
Consortium.

When this is shipped in one package developers will always have an in sync 
translation from abbreviated names to long names and vice versa. Over the last 
years I needed to adjust my dicts regularly for the added definitions by 
Unicode Consortium which are supported by stdlib.

At the moment, translation from Unicode codes U+1234 to human-readable Unicode 
names and vice versa is offered at the moment. Providing human-readable names 
for the property values is a service of the same level and will be catering to 
approximately the same user group.

If you agree that these dicts can be added I am willing to provide a script 
that will parse the aforementioned file.

--

___
Python tracker 

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



[issue16656] os.listdir() returns unusable bytes result on Windows

2012-12-14 Thread STINNER Victor

STINNER Victor added the comment:

On Windows with Python 2, unencodable characters are replaced with "?". It is 
the default behaviour of WideCharToMultiByte() and so all ANSI functions have 
this behaviour. Python doesn't try to behave differently, it just exposes 
system function as Python functions.

So for example, os.listdir(bytes) returns filename with "?" if some characters 
are not encodable to the ANSI codepage. It's a choice in the design of Windows.

> This critical bug is one of the reasons that non-English speaking
> communities doesn't adopt Python as broadly as it happens in
> English world compared to other technologies (PHP etc.).

I don't understand this point.

PHP doesn't have a Unicode type, I'm quite sure that PHP have exactly the same 
issue. And this issue is only solved in Python 3... except if you explicitly 
uses a bytes filename (for os.listdir/os.walk), but the bytes filename API has 
been deprecated in Python 3.3.

In Python 2, you can use Unicode filenames to workaround this issue. But it 
doesn't work as well as Python 3: on UNIX, you will get a similar issue with 
undecodable filenames (which is the opposite of unencodable filenames).

Read my book for more information: https://github.com/haypo/unicode_book/wiki

--

About listdir_unicode-2.7.patch: Python chose to work as Windows with 
unencodable characters. If you want to change the behaviour, you must change 
*all* calls to the Windows ANSI API (which is not trivial). Anyway, as I wrote, 
the bytes API is deprecated for filenames in Python 3.3. I prefer to not change 
anything in Python 2, because it may break existing applications. For example, 
os.listdir(bytes) doesn't fail in Python 2.7 with unencodable names, whereas it 
fails with your patch.

Nothing interesting in this issue, I'm closing it. If your consider the 
redirection issue important, please open a new issue.

--
status: open -> closed

___
Python tracker 

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



[issue16656] os.listdir() returns unusable bytes result on Windows

2012-12-14 Thread STINNER Victor

Changes by STINNER Victor :


--
resolution:  -> wont fix

___
Python tracker 

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



[issue16656] os.listdir() returns unusable bytes result on Windows

2012-12-14 Thread STINNER Victor

STINNER Victor added the comment:

> And this issue is only solved in Python 3...

Ooops, I mean: this issue is *already* solved in Python 3

--

___
Python tracker 

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



[issue16685] Deprecate accepting strings as arguments in audioop functions

2012-12-14 Thread STINNER Victor

STINNER Victor added the comment:

Accepting Unicode strings is surprising and must fail. I don't think that a 
deprecation process is required here.

--

___
Python tracker 

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



[issue16656] os.listdir() returns unusable bytes result on Windows

2012-12-14 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

> For example, os.listdir(bytes) doesn't fail in Python 2.7 with unencodable 
> names, whereas it fails with your patch.

No. The purpose of this patch is that it doesn't fail and should return
a usable result.

--

___
Python tracker 

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



[issue16685] Deprecate accepting strings as arguments in audioop functions

2012-12-14 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

> Accepting Unicode strings is surprising and must fail. I don't think that a 
> deprecation process is required here.

Should it be fixed in 3.4 only or in all 3.x?

--

___
Python tracker 

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



[issue16612] Integrate "Argument Clinic" specialized preprocessor into CPython trunk

2012-12-14 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis :


--
nosy: +Arfrever

___
Python tracker 

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



[issue16685] Deprecate accepting strings as arguments in audioop functions

2012-12-14 Thread Ezio Melotti

Ezio Melotti added the comment:

The deprecation process can be avoided only if passing strings results in a 
meaningless result.  If there are cases where users are passing strings and 
everything works fine -- even if they should be passing bytes instead -- we 
should deprecate strings first to warn the users that the "feature" is going to 
be removed.

--

___
Python tracker 

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



[issue16685] Deprecate accepting strings as arguments in audioop functions

2012-12-14 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

In 2.x it was have a little sense (if you use some 8-bit encoding as default 
encoding, but the default was 7-bit ascii). But with utf-8 it doesn't have 
sense and should quickly lead to an unexpected result (or just fail in most 
cases).

--
dependencies: +Document that audioop works with bytes, not strings

___
Python tracker 

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



[issue16688] Backreferences make case-insensitive regex fail on non-ASCII strings.

2012-12-14 Thread pyos

New submission from pyos:

The title says it all: if a regular expression that makes use of backreferences 
is compiled with `re.I` flag, it will always fail when matched against a string 
that contains characters outside of U+-U+00FF range. I've been unable to 
further narrow the bug down.

A simple example:

>>> import re
>>> r = re.compile(r'(a)\1', re.I)  # should match "aa", "aA", "Aa", or "AA"
>>> r.findall('aa')  # works as expected
['a']
>>> r.findall('aa bcd')  # still works
['a']
>>> r.findall('aa Ā')  # ord('Ā') == 0x0100
[]

The same code works as expected in Python 3.2:

>>> r.findall('aa Ā')
['a']

--
components: Regular Expressions
messages: 177518
nosy: ezio.melotti, mrabarnett, pitrou, pyos
priority: normal
severity: normal
status: open
title: Backreferences make case-insensitive regex fail on non-ASCII strings.
type: behavior
versions: Python 3.3

___
Python tracker 

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



[issue16688] Backreferences make case-insensitive regex fail on non-ASCII strings.

2012-12-14 Thread STINNER Victor

Changes by STINNER Victor :


--
nosy: +haypo

___
Python tracker 

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



  1   2   >