[issue11678] Add support for Arch Linux to platform.linux_distributions()

2011-09-04 Thread Westley Martínez

Westley Martínez  added the comment:

Is there anything preventing the patch from being committed?

--

___
Python tracker 

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



[issue12892] UTF-16 and UTF-32 codecs should reject (lone) surrogates

2011-09-04 Thread Ezio Melotti

New submission from Ezio Melotti :

>From Chapter 03 of the Unicode Standard 6[0], D91:
"""
• UTF-16 encoding form: The Unicode encoding form that assigns each Unicode 
scalar value in the ranges U+..U+D7FF and U+E000..U+ to a single 
unsigned 16-bit code unit with the same numeric value as the Unicode scalar 
value, and that assigns each Unicode scalar value in the range 
U+1..U+10 to a surrogate pair, according to Table 3-5.
• Because surrogate code points are not Unicode scalar values, isolated UTF-16 
code units in the range 0xD800..0xDFFF are ill-formed.
"""
I.e. UTF-16 should be able to decode correctly a valid surrogate pair, and 
encode a non-BMP character using a  valid surrogate pair, but it should reject 
lone surrogates both during encoding and decoding.

On Python 3, the utf-16 codec can encode all the codepoints from U+ to 
U+10 (including (lone) surrogates), but it's not able to decode lone 
surrogates (not sure if this is by design or if it just fails because it 
expects another (missing) surrogate).

--

>From Chapter 03 of the Unicode Standard 6[0], D90:
"""
• UTF-32 encoding form: The Unicode encoding form that assigns each Unicode 
scalar value to a single unsigned 32-bit code unit with the same numeric value 
as the Unicode scalar value.
• Because surrogate code points are not included in the set of Unicode scalar 
values, UTF-32 code units in the range 0xD800..0xDFFF are ill-formed.
"""
I.e. UTF-32 should reject both lone surrogates and valid surrogate pairs, both 
during encoding and during decoding.

On Python 3, the utf-32 codec can encode and decode all the codepoints from 
U+ to U+10 (including surrogates).

--

I think that:
  * this should be fixed in 3.3;
  * it's a bug, so the fix /might/ be backported to 3.2.  Hoverver it's also a 
fairly big change in behavior, so it might be better to leave it for 3.3 only;
  * it's better to leave 2.7 alone, even the utf-8 codec is broken there;
  * the surrogatepass error handler should work with the utf-16 and utf-32 
codecs too.


Note that this has been already reported in #3672, but eventually only the 
utf-8 codec was fixed.

[0]: http://www.unicode.org/versions/Unicode6.0.0/ch03.pdf

--
assignee: ezio.melotti
components: Unicode
messages: 143490
nosy: ezio.melotti, gvanrossum, haypo, lemburg, loewis, tchrist
priority: high
severity: normal
stage: test needed
status: open
title: UTF-16 and UTF-32 codecs should reject (lone) surrogates
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



[issue11816] Refactor the dis module to provide better building blocks for bytecode analysis

2011-09-04 Thread Nick Coghlan

Nick Coghlan  added the comment:

Regenerated the get_opinfo patch against current 3.3 tip.

Still haven't fixed the missing doc updates mentioned in my last message, 
though.

--
Added file: 
http://bugs.python.org/file23095/issue11816_get_opinfo_branch_20110904.diff

___
Python tracker 

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



[issue11682] PEP 380 reference implementation for 3.3

2011-09-04 Thread Nick Coghlan

Nick Coghlan  added the comment:

Uploaded a patch that should be complete. Note that my pep380 branch is based 
on my get_opinfo branch (see #11816), so if you're applying patches manually 
rather than updating directly from my sandbox with hg, you'll need to apply the 
latest patch from #11816 before applying this one.

Raymond: assigning to you, since you said you wanted to review the 
dis.get_opinfo changes before they went in, and those changes are a dependency 
for the updated PEP 380 test suite.

--
Added file: 
http://bugs.python.org/file23096/issue11682_pep380_branch_20110904.diff

___
Python tracker 

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



[issue11682] PEP 380 reference implementation for 3.3

2011-09-04 Thread Nick Coghlan

Nick Coghlan  added the comment:

Actually, not assigning to Raymond for review yet, after all - I just noticed 
there are some of Benjamin's review comments relating to cosmetic details 
rather than functionality that I still need to address.

I'll kick it in Raymond's direction once I've dealt with those (probably next 
weekend, but possibly some time this week)

--

___
Python tracker 

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



[issue12871] Disable sched_get_priority_min/max if Python is compiled without threads

2011-09-04 Thread Charles-François Natali

Charles-François Natali  added the comment:

Here's a patch adding a configure-time check. Since the functions are
checked without being linked explicitely with pthread, it should do
the trick (I couldn't test it on OpenBSD though).
I also added a skipTest to test_posix.test_sched_priority().

--
keywords: +patch
title: Disable sched_get_priority_min/max if Python is compiled without threads 
-> Disable sched_get_priority_min/max if Python is compiled without threads
Added file: http://bugs.python.org/file23097/sched_get_priority.diff

___
Python tracker 

___diff -r a29b72950795 Lib/test/test_posix.py
--- a/Lib/test/test_posix.pyThu Sep 01 23:08:21 2011 +0200
+++ b/Lib/test/test_posix.pySat Sep 03 18:08:01 2011 +0200
@@ -840,6 +840,8 @@
 posix.sched_yield()
 
 @requires_sched_h
+@unittest.skipUnless(hasattr(posix, 'sched_get_priority_max'),
+ "requires sched_get_priority_max()")
 def test_sched_priority(self):
 # Round-robin usually has interesting priorities.
 pol = posix.SCHED_RR
diff -r a29b72950795 Modules/posixmodule.c
--- a/Modules/posixmodule.c Thu Sep 01 23:08:21 2011 +0200
+++ b/Modules/posixmodule.c Sat Sep 03 18:08:01 2011 +0200
@@ -4555,6 +4555,8 @@
 
 #ifdef HAVE_SCHED_H
 
+#ifdef HAVE_SCHED_GET_PRIORITY_MAX
+
 PyDoc_STRVAR(posix_sched_get_priority_max__doc__,
 "sched_get_priority_max(policy)\n\n\
 Get the maximum scheduling priority for *policy*.");
@@ -4589,6 +4591,8 @@
 return PyLong_FromLong(min);
 }
 
+#endif /* HAVE_SCHED_GET_PRIORITY_MAX */
+
 #ifdef HAVE_SCHED_SETSCHEDULER
 
 PyDoc_STRVAR(posix_sched_getscheduler__doc__,
@@ -10452,8 +10456,10 @@
 {"fork",posix_fork, METH_NOARGS, posix_fork__doc__},
 #endif /* HAVE_FORK */
 #ifdef HAVE_SCHED_H
+#ifdef HAVE_SCHED_GET_PRIORITY_MAX
 {"sched_get_priority_max", posix_sched_get_priority_max, METH_VARARGS, 
posix_sched_get_priority_max__doc__},
 {"sched_get_priority_min", posix_sched_get_priority_min, METH_VARARGS, 
posix_sched_get_priority_min__doc__},
+#endif
 #ifdef HAVE_SCHED_SETPARAM
 {"sched_getparam", posix_sched_getparam, METH_VARARGS, 
posix_sched_getparam__doc__},
 #endif
@@ -10474,7 +10480,7 @@
 {"sched_setaffinity", posix_sched_setaffinity, METH_VARARGS, 
posix_sched_setaffinity__doc__},
 {"sched_getaffinity", posix_sched_getaffinity, METH_VARARGS, 
posix_sched_getaffinity__doc__},
 #endif
-#endif
+#endif /* HAVE_SCHED_H */
 #if defined(HAVE_OPENPTY) || defined(HAVE__GETPTY) || defined(HAVE_DEV_PTMX)
 {"openpty", posix_openpty, METH_NOARGS, posix_openpty__doc__},
 #endif /* HAVE_OPENPTY || HAVE__GETPTY || HAVE_DEV_PTMX */
diff -r a29b72950795 configure.in
--- a/configure.in  Thu Sep 01 23:08:21 2011 +0200
+++ b/configure.in  Sat Sep 03 18:08:01 2011 +0200
@@ -2538,7 +2538,8 @@
  select sem_open sem_timedwait sem_getvalue sem_unlink sendfile setegid 
seteuid \
  setgid sethostname \
  setlocale setregid setreuid setresuid setresgid setsid setpgid setpgrp 
setpriority setuid setvbuf \
- sched_setaffinity sched_setscheduler sched_setparam sched_rr_get_interval \
+ sched_get_priority_max sched_setaffinity sched_setscheduler sched_setparam \
+ sched_rr_get_interval \
  sigaction sigaltstack siginterrupt sigpending sigrelse \
  sigtimedwait sigwait sigwaitinfo snprintf strftime strlcpy symlinkat sync \
  sysconf tcgetpgrp tcsetpgrp tempnam timegm times tmpfile tmpnam tmpnam_r \
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12892] UTF-16 and UTF-32 codecs should reject (lone) surrogates

2011-09-04 Thread Marc-Andre Lemburg

Marc-Andre Lemburg  added the comment:

Ezio Melotti wrote:
> 
> New submission from Ezio Melotti :
> 
>>From Chapter 03 of the Unicode Standard 6[0], D91:
> """
> • UTF-16 encoding form: The Unicode encoding form that assigns each Unicode 
> scalar value in the ranges U+..U+D7FF and U+E000..U+ to a single 
> unsigned 16-bit code unit with the same numeric value as the Unicode scalar 
> value, and that assigns each Unicode scalar value in the range 
> U+1..U+10 to a surrogate pair, according to Table 3-5.
> • Because surrogate code points are not Unicode scalar values, isolated 
> UTF-16 code units in the range 0xD800..0xDFFF are ill-formed.
> """
> I.e. UTF-16 should be able to decode correctly a valid surrogate pair, and 
> encode a non-BMP character using a  valid surrogate pair, but it should 
> reject lone surrogates both during encoding and decoding.
> 
> On Python 3, the utf-16 codec can encode all the codepoints from U+ to 
> U+10 (including (lone) surrogates), but it's not able to decode lone 
> surrogates (not sure if this is by design or if it just fails because it 
> expects another (missing) surrogate).
> 
> --
> 
>>From Chapter 03 of the Unicode Standard 6[0], D90:
> """
> • UTF-32 encoding form: The Unicode encoding form that assigns each Unicode 
> scalar value to a single unsigned 32-bit code unit with the same numeric 
> value as the Unicode scalar value.
> • Because surrogate code points are not included in the set of Unicode scalar 
> values, UTF-32 code units in the range 0xD800..0xDFFF are ill-formed.
> """
> I.e. UTF-32 should reject both lone surrogates and valid surrogate pairs, 
> both during encoding and during decoding.
> 
> On Python 3, the utf-32 codec can encode and decode all the codepoints from 
> U+ to U+10 (including surrogates).
> 
> --
> 
> I think that:
>   * this should be fixed in 3.3;
>   * it's a bug, so the fix /might/ be backported to 3.2.  Hoverver it's also 
> a fairly big change in behavior, so it might be better to leave it for 3.3 
> only;
>   * it's better to leave 2.7 alone, even the utf-8 codec is broken there;
>   * the surrogatepass error handler should work with the utf-16 and utf-32 
> codecs too.
> 
> 
> Note that this has been already reported in #3672, but eventually only the 
> utf-8 codec was fixed.

All UTF codecs should reject lone surrogates in strict error mode,
but let them pass using the surrogatepass error handler (the UTF-8
codec already does) and apply the usual error handling for ignore
and replace.

--

___
Python tracker 

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



[issue12885] distutils.filelist.findall() fails on broken symlink in Py2.x

2011-09-04 Thread Alexander Dutton

Alexander Dutton  added the comment:

I've come across it as I'm creating a Debian package of the Python package in 
the same tree — I'm happy to be told this is a Bad Idea and that they should be 
in different places.

The broken symlinks are relative and in debian/tmp, and will point to locations 
provided by other Debian packages once my package is installed in the right 
location.

FWIW, I'm getting round it at the moment by walking the directory tree and 
removing the files is os.path.islink(filename) and not 
os.path.exists(os.path.join(filename, os.readlink(filename))).

I'm happy to provide tests and a patch if necessary.

--

___
Python tracker 

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



[issue12871] Disable sched_get_priority_min/max if Python is compiled without threads

2011-09-04 Thread Remi Pointel

Remi Pointel  added the comment:

Hi,

it seems to solve the problem (tested on OpenBSD 4.9 and OpenBSD-current).

* test_posix.py on OpenBSD 4.9:
[...]
Ran 79 tests in 0.508s
OK (skipped=35)

* test_posix.py on OpenBSD-current:
it continues to segfault, but I have opened an other ticket for this problem 
(issue 12852).

Thanks a lot,

Remi.

--

___
Python tracker 

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



[issue10914] Python sub-interpreter test

2011-09-04 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> It is possible to install the _testembed.c file alongside xxmodule.c
> and compile it at test time.

We probably could, using the approach from the distutils patch. But it feels 
really quirky to me. Granted, the Makefile is quirky as well.

> To test under Windows, I’ve re-read your first patch using distutils
> and it’s not that long or hard to read after all.

Except that it didn't work under Windows...

--

___
Python tracker 

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



[issue12893] Invitation to connect on LinkedIn

2011-09-04 Thread Nadeem Vawda

Changes by Nadeem Vawda :


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

___
Python tracker 

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



[issue11155] multiprocessing.Queue's put() signature differs from docs

2011-09-04 Thread Westley Martínez

Westley Martínez  added the comment:

¡Hola!
Just checking in.  The documentation is still incorrect for all versions.  
There's a patch that fixes it ready to be reviewed.

--

___
Python tracker 

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



[issue11340] test_distutils fails because of borked compress program

2011-09-04 Thread Westley Martínez

Westley Martínez  added the comment:

I emailed the Arch Linux people to get more information on this particular 
issue.  If they decide that the compress program will stay as is I will write 
attempt to write a patch to skip the test based on the output of compress's 
--version flag.

--

___
Python tracker 

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



[issue12894] pydoc help("modules keyword") is failing when a module throws an exception at the import time

2011-09-04 Thread Christian S. Perone

New submission from Christian S. Perone :

Pydoc is failing when running the ModuleScanner().run() when you execute:

help("modules keyword")

... if some module throws an exception at the import time.
See this example:

>>> help("modules convolve")

Here is a list of matching modules.  Enter any module name to get more help.

numpy.numarray.convolve
scipy.fftpack.convolve
Traceback (most recent call last):
  File "", line 1, in 
  File "C:\Python27\lib\site.py", line 467, in __call__
return pydoc.help(*args, **kwds)
  File "C:\Python27\lib\pydoc.py", line 1727, in __call__
self.help(request)
  File "C:\Python27\lib\pydoc.py", line 1768, in help
self.listmodules(split(request)[1])
  File "C:\Python27\lib\pydoc.py", line 1873, in listmodules
apropos(key)
  File "C:\Python27\lib\pydoc.py", line 1975, in apropos
ModuleScanner().run(callback, key)
  File "C:\Python27\lib\pydoc.py", line 1938, in run
for importer, modname, ispkg in pkgutil.walk_packages(onerror=onerror):
  File "C:\Python27\lib\pkgutil.py", line 125, in walk_packages
for item in walk_packages(path, name+'.', onerror):
  File "C:\Python27\lib\pkgutil.py", line 125, in walk_packages
for item in walk_packages(path, name+'.', onerror):
  File "C:\Python27\lib\pkgutil.py", line 125, in walk_packages
for item in walk_packages(path, name+'.', onerror):
  File "C:\Python27\lib\pkgutil.py", line 125, in walk_packages
for item in walk_packages(path, name+'.', onerror):
  File "C:\Python27\lib\pkgutil.py", line 110, in walk_packages
__import__(name)
  File 
"C:\Python27\lib\site-packages\wx-2.8-msw-unicode\wx\lib\pubsub\core\arg1\__init__.py",
 line 16, in 
raise RuntimeError(msg)
RuntimeError: Should not import this directly, used by pubsub.core if applicable

After suppressing the exception by changing the "apropos()" method inside the 
pydoc.py:

Line:
ModuleScanner().run(callback, key)

To:
ModuleScanner().run(callback, key, onerror=lambda error: error)

The problem is fixed, but I really don't know if this is the best way to 
suppress this and if we should suppress these exceptions, I think that as the 
intent of the help("modules keyword") is to find things with the keyword in the 
name, we shouldn't let the exception be propagated to the user.

--
components: Library (Lib)
messages: 143502
nosy: Christian.S..Perone
priority: normal
severity: normal
status: open
title: pydoc help("modules keyword") is failing when a module throws an 
exception at the import time
type: behavior
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



[issue12895] In MSI/EXE installer, allow installing Python modules in free path

2011-09-04 Thread Ram Rachum

New submission from Ram Rachum :

Currently, when you use an MSI installer (and possibly also EXE) for a Python 
module, it automatically detects the location of your various system's Python 
installations. This is very convenient.

However, this can be a problem sometimes, if your Python installation doesn't 
conform to what's required by the installer. For example, if you want to 
install the module in a virtualenv:

http://serverfault.com/questions/305008/installing-compiled-python-modules-on-windows-on-a-virtual-env

The installer doesn't give you any option to manually enter a path of a Python 
installation, so you just can't install!

The installer's automatic Python-finding mechanism should degrade gracefully; 
it should offer to automatically find your Python installation, but it should 
allow you to bypass it and type it in yourself.

--
assignee: tarek
components: Distutils2
messages: 143503
nosy: alexis, cool-RR, eric.araujo, tarek
priority: normal
severity: normal
status: open
title: In MSI/EXE installer, allow installing Python modules in free path
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



[issue12894] pydoc help("modules keyword") is failing when a module throws an exception at the import time

2011-09-04 Thread Ned Deily

Ned Deily  added the comment:

Thanks for the suggested fix.  It looks like the problem and fix have already 
been documented in Issue7425.  Merging this into the existing issue.

--
nosy: +ned.deily
resolution:  -> duplicate
stage:  -> committed/rejected
status: open -> closed
superseder:  -> [PATCH] Improve the robustness of "pydoc -k" in the face of 
broken modules

___
Python tracker 

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



[issue7425] [PATCH] Improve the robustness of "pydoc -k" in the face of broken modules

2011-09-04 Thread Ned Deily

Changes by Ned Deily :


--
nosy: +Christian.S..Perone, ned.deily
versions: +Python 3.3 -Python 3.1

___
Python tracker 

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



[issue3132] implement PEP 3118 struct changes

2011-09-04 Thread Meador Inge

Meador Inge  added the comment:

Is this work something that might be suitable for the features/pep-3118 repo 
(http://hg.python.org/features/pep-3118/) ?

--

___
Python tracker 

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



[issue9969] tokenize: add support for tokenizing 'str' objects

2011-09-04 Thread Meador Inge

Meador Inge  added the comment:

Attached is a first cut at a patch.

--
keywords: +patch
stage: needs patch -> patch review
Added file: http://bugs.python.org/file23099/issue9969.patch

___
Python tracker 

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



[issue1172711] long long support for array module

2011-09-04 Thread Meador Inge

Meador Inge  added the comment:

Here is a refresh of this patch for 3.3.  Please review.

--
Added file: http://bugs.python.org/file23100/issue-1172711.patch

___
Python tracker 

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



[issue11155] multiprocessing.Queue's put() signature differs from docs

2011-09-04 Thread Eli Bendersky

Changes by Eli Bendersky :


--
nosy: +eli.bendersky

___
Python tracker 

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



[issue12896] Recommended location of the interpreter for Python 3

2011-09-04 Thread Lennart Regebro

New submission from Lennart Regebro :

The documentation on Using Python, 2.3. Python-related paths and files says 
that "exec_prefix/bin/python" is the recommended location for the interpreter, 
while for Python 3 it's "exec_prefix/bin/python3".

http://docs.python.org/py3k/using/unix.html#python-related-paths-and-files

--
assignee: docs@python
components: Documentation
messages: 143508
nosy: docs@python, lregebro
priority: normal
severity: normal
status: open
title: Recommended location of the interpreter for Python 3
versions: Python 3.1, Python 3.2, Python 3.3

___
Python tracker 

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