[issue5901] missing meta-info in documentation pdf

2009-05-02 Thread Georg Brandl

Georg Brandl  added the comment:

I thought we already did assign these metadata items; looks like it's
been messed up somehow.  I'll fix this.

--

___
Python tracker 

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



[issue5902] Stricter codec names

2009-05-02 Thread Ezio Melotti

New submission from Ezio Melotti :

I noticed that codec names[1]:
1) can contain random/unnecessary spaces and punctuation;
2) have several aliases that could probably be removed;

A few examples of valid codec names (done with Python 3):
>>> s = 'xxx'
>>> s.encode('utf')
b'xxx'
>>> s.encode('utf-')
b'xxx'
>>> s.encode('}Utf~->8<-~siG{ ;)')
b'\xef\xbb\xbfxxx'

'utf' is an alias for UTF-8 and that doesn't quite make sense to me that
'utf' alone refers to UTF-8.
'utf-' could be a mistyped 'utf-8', 'utf-7' or even 'utf-16'; I'd like
it to raise an error instead.
The third example is not probably something that can be found in the
real world (I hope) but it shows how permissive the parsing of the names is.

Apparently the whitespaces are removed and the punctuation is used to
split the name in several parts and then the check is performed.


About the aliases: in the documentation the "official" name for the
UTF-8 codec is 'utf_8' and there are 3 more aliases: U8, UTF, utf8. For
ISO-8859-1, the "official" name is 'latin_1' and there are 7 more
aliases: iso-8859-1, iso8859-1, 8859, cp819, latin, latin1, L1.
The Zen says "There should be one—and preferably only one—obvious way to
do it.", so I suggest to
1) disallow random punctuation and spaces within the name (only allow
leading and trailing spaces);
2) change the default names to, for example: 'utf-8', 'iso-8859-1'
instead of 'utf_8' and 'iso8859_1'. The name are case-insentive.
3) remove the unnecessary aliases, for example: 'UTF', 'U8' for UTF-8
and 'iso8859-1', '8859', 'latin', 'L1' for ISO-8859-1;

This last point could break some code and may need some
DeprecationWarning. If there are good reason to keep around these codecs
only the other two issues can be addressed. 
If the name of the codec has to be a valid variable name (that is,
without '-'), only the documentation could be changed to have 'utf-8',
'iso-8859-1', etc. as preferred name.

[1]: http://docs.python.org/library/codecs.html#standard-encodings
 http://docs.python.org/3.0/library/codecs.html#standard-encodings

--
assignee: georg.brandl
components: Documentation, Library (Lib)
messages: 86933
nosy: ezio.melotti, georg.brandl
severity: normal
status: open
title: Stricter codec names
type: behavior
versions: Python 2.6, Python 2.7, Python 3.0, Python 3.1

___
Python tracker 

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



[issue1759169] clean up Solaris port and allow C99 extension modules

2009-05-02 Thread James Andrewartha

James Andrewartha  added the comment:

I'm jhbuilding GNOME on Solaris, and the attached patch fixes the
problem for me, having compiled Python with it I can now compile
dbus-python, pycairo and pyorbit against it.

--
nosy: +trs80

___
Python tracker 

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



[issue5902] Stricter codec names

2009-05-02 Thread Georg Brandl

Georg Brandl  added the comment:

I don't think this is a good idea.  Accepting all common forms for
encoding names means that you can usually give Python an encoding name
from, e.g. a HTML page, or any other file or system that specifies an
encoding.  If we only supported, e.g., "UTF-8" and no other spelling,
that would make life much more difficult.  If you look into
encodings/__init__.py, you can see that throwing out all
non-alphanumerics is a conscious design choice in encoding name
normalization.

The only thing I don't know is why "utf" is an alias for utf-8.

Assigning to Marc-Andre, who implemented most of codecs.

--
assignee: georg.brandl -> lemburg
nosy: +lemburg
resolution:  -> rejected
status: open -> pending

___
Python tracker 

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



[issue3672] Ill-formed surrogates not treated as errors during encoding/decoding

2009-05-02 Thread Martin v. Löwis

Martin v. Löwis  added the comment:

Reviewers: report_bugs.python.org, Benjamin,

Message:
Issues fixed in r72188.

http://codereview.appspot.com/52081/diff/1/5
File Doc/library/codecs.rst (right):

http://codereview.appspot.com/52081/diff/1/5#newcode326
Line 326: In addition, the following error handlers are specific to only
selected
On 2009/05/01 21:25:44, Benjamin wrote:
> "In addition, the following error handlers are specific to a single
codec."
> sounds better

Done.

http://codereview.appspot.com/52081/diff/1/5#newcode335
Line 335:
On 2009/05/01 21:25:44, Benjamin wrote:
> There should probably be a versionchanged directive indicating that
"surrogates"
> was added in 3.1.

Done.

http://codereview.appspot.com/52081/diff/1/6
File Lib/test/test_codecs.py (right):

http://codereview.appspot.com/52081/diff/1/6#newcode544
Line 544: def test_surrogates(self):
On 2009/05/01 21:25:44, Benjamin wrote:
> I think this should be split into 2 tests. "test_lone_surrogates" and
> "test_surrogate_handler".

Done.

http://codereview.appspot.com/52081/diff/1/4
File Objects/unicodeobject.c (right):

http://codereview.appspot.com/52081/diff/1/4#newcode157
Line 157: static PyObject *unicode_encode_call_errorhandler(const char
*errors,
On 2009/05/01 21:25:44, Benjamin wrote:
> These prototypes are longer than 80 chars some places. I don't think
the
> arguments need to line up with the starting parenthesis.

Done.

http://codereview.appspot.com/52081/diff/1/4#newcode2393
Line 2393: s, size, &exc, i-1, i, &newpos);
On 2009/05/01 21:25:44, Benjamin wrote:
> "exc" is never Py_DECREFed.

Done.

http://codereview.appspot.com/52081/diff/1/4#newcode4110
Line 4110: if (!PyUnicode_Check(repunicode)) {
On 2009/05/01 21:25:44, Benjamin wrote:
> Is there a test of this case somewhere?

No. This is temporary - for PEP 383, I will have to support error
handlers returning bytes here, also.

http://codereview.appspot.com/52081/diff/1/2
File Python/codecs.c (right):

http://codereview.appspot.com/52081/diff/1/2#newcode758
Line 758: if (PyObject_IsInstance(exc, PyExc_UnicodeEncodeError)) {
On 2009/05/01 21:25:44, Benjamin wrote:
> I believe PyErr_GivenExceptionMatches is more appropriate here, but
given the
> rest of the file uses PyObject_IsInstance, it likely doesn't matter.

No. The interface is that an exception instance must be passed;
GivenExceptionMatches would also allow for tuples and types.

http://codereview.appspot.com/52081/diff/1/2#newcode771
Line 771: return NULL;
On 2009/05/01 21:25:44, Benjamin wrote:
> This is leaks "object".

Done.

Please review this at http://codereview.appspot.com/52081

Affected files:
   M Doc/library/codecs.rst
   M Lib/test/test_bytes.py
   M Lib/test/test_codecs.py
   M Lib/test/test_unicode.py
   M Lib/test/test_unicodedata.py
   M Objects/unicodeobject.c
   M Python/codecs.c
   M Python/marshal.c

--

___
Python tracker 

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



[issue3672] Ill-formed surrogates not treated as errors during encoding/decoding

2009-05-02 Thread Martin v. Löwis

Changes by Martin v. Löwis :


Removed file: http://bugs.python.org/file13830/surrogates.diff

___
Python tracker 

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



[issue3672] Ill-formed surrogates not treated as errors during encoding/decoding

2009-05-02 Thread Martin v. Löwis

Changes by Martin v. Löwis :


Added file: http://bugs.python.org/file13836/surrogates.diff

___
Python tracker 

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



[issue5902] Stricter codec names

2009-05-02 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Is there any reason for allowing "utf" as an alias to utf-8? It sounds
much too ambiguous. The other silly variants (those with lots of
spurious puncutuations characters) could be forbidden too.

--
nosy: +pitrou
status: pending -> open

___
Python tracker 

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



[issue5880] Remove unneeded "context" pointer from getters and setters

2009-05-02 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Doesn't it also break binary compatibility with extension modules?
Perhaps this should be quickly discussed on python-dev, although I agree
that it looks sensible.

--
nosy: +pitrou

___
Python tracker 

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



[issue5084] unpickling does not intern attribute names

2009-05-02 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
stage: needs patch -> patch review

___
Python tracker 

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



[issue5084] unpickling does not intern attribute names

2009-05-02 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Thanks, I'll take a look very soon.

--
assignee: alexandre.vassalotti -> pitrou

___
Python tracker 

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



[issue3379] Option to not-exit on test

2009-05-02 Thread Michael Foord

Michael Foord  added the comment:

Committed in revision 71291.

--
status: open -> closed

___
Python tracker 

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



[issue3379] Option to not-exit on test

2009-05-02 Thread Michael Foord

Michael Foord  added the comment:

No, make that revision 72191. :-)

--

___
Python tracker 

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



[issue4136] merge json library with latest simplejson 2.0.x

2009-05-02 Thread Benjamin Peterson

Benjamin Peterson  added the comment:

Since no other patches were proposed, I applied Antoine's patch in r72194.

--
status: open -> closed

___
Python tracker 

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



[issue5753] CVE-2008-5983 python: untrusted python modules search path

2009-05-02 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

I'm not sure we can change the behaviour of PySys_SetArgv() like that.
At least not in a bugfix release.
In 2.7/3.1, we could either change PySys_SetArgv(), or introduce a new
PySys_SetArgvEx() with an additional argument indicating whether
sys.path should be modified or not. I suggest asking on python-dev first.

--
versions: +Python 2.7

___
Python tracker 

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



[issue5903] strftime fails in non UTF-8 locale

2009-05-02 Thread Barry Alan Scott

New submission from Barry Alan Scott :

On Mac OS X 10.5

$ LC_ALL=ru_RU.koi8-r python3.0 -c 'import time;print( time.strftime("%A"))'
Traceback (most recent call last):
  File "", line 1, in 
UnicodeDecodeError: 'utf8' codec can't decode bytes in position 0-1:
invalid data

--
components: Library (Lib)
messages: 86944
nosy: barry-scott
severity: normal
status: open
title: strftime fails in non UTF-8 locale
versions: Python 3.0

___
Python tracker 

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



[issue5903] strftime fails in non UTF-8 locale

2009-05-02 Thread Ezio Melotti

Ezio Melotti  added the comment:

See http://bugs.python.org/issue5398

--
nosy: +ezio.melotti

___
Python tracker 

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



[issue5904] strftime docs do not explain locale affect on result string

2009-05-02 Thread Barry Alan Scott

New submission from Barry Alan Scott :

The result of time.strftime seems to be in the locale encoding
but this is not pointed out in the documentation.

Ideally an example like this would be in the docs to show how to
deal with strftime output:

import locale
import time

locale_encoded_time = time.strftime( '%d-%b-%Y %H:%M:%S' )

language, encoding = locale.getdefaultlocale()
unicode_time = locale_encoded_time.decode( encoding )

--
assignee: georg.brandl
components: Documentation
messages: 86946
nosy: barry-scott, georg.brandl
severity: normal
status: open
title: strftime docs do not explain locale affect on result string
versions: Python 2.6

___
Python tracker 

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



[issue5903] strftime fails in non UTF-8 locale

2009-05-02 Thread Ezio Melotti

Ezio Melotti  added the comment:

Here the issue might be different though. Does 
$ LC_ALL=ru_RU.koi8-r python3.0 -c 'import time;time.strftime("%A")'
(without the print) work?

I don't have the ru_RU locale but here time.strftime() return 'str', not
'bytes' and the utf-8 codec should be able to encode it:
>>> time.strftime("%A")
'Saturday'
>>> type(_)


--

___
Python tracker 

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



[issue5903] strftime fails in non UTF-8 locale

2009-05-02 Thread Ezio Melotti

Ezio Melotti  added the comment:

I was able to reproduce this using an italian locale on Windows:
>>> locale.setlocale(locale.LC_TIME, 'Italian_Italy.1252')
'Italian_Italy.1252'
>>> time.strftime("%A", time.strptime("2009-05-01", "%Y-%m-%d"))
'venerd?'

That should be 'venerdì'.
I also found http://bugs.python.org/issue3061 and
http://bugs.python.org/issue836035 that seem to be related. (#5398
instead doesn't seem to be related.)

Apparently on Py3.x a unicode string ('str') is returned, whereas Py2.x
returns an encoded string:
>>> time.strftime("%A", time.strptime("2009-05-01", "%Y-%m-%d"))
'venerd\xec'

--

___
Python tracker 

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



[issue3061] time.strftime() always decodes result with UTF-8

2009-05-02 Thread Jeroen Ruigrok van der Werven

Jeroen Ruigrok van der Werven  added the comment:

As C99 section 7.23.3.5 states:

"Each conversion specifier is replaced by appropriate characters as
described in the following list. The appropriate characters are
determined using the LC_TIME category of the current locale and by the
values of zero or more members of the broken-down time structure pointed
to by timeptr, as specified in brackets in the description."

--
nosy: +asmodai

___
Python tracker 

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



[issue5903] strftime fails in non UTF-8 locale

2009-05-02 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Same thing here (Linux) with a non-utf8 locale:

>>> locale.setlocale(locale.LC_TIME, "fr_FR.UTF-8")
'fr_FR.UTF-8'
>>> time.strftime("%B", time.strptime("2009-12-01", "%Y-%m-%d"))
'décembre'
>>> locale.setlocale(locale.LC_TIME, "fr_FR.ISO8859-15")
'fr_FR.ISO8859-15'
>>> time.strftime("%B", time.strptime("2009-12-01", "%Y-%m-%d"))
Traceback (most recent call last):
  File "", line 1, in 
  File "/home/antoine/py3k/__svn__/Lib/_strptime.py", line 461, in
_strptime_time
return _strptime(data_string, format)[0]
  File "/home/antoine/py3k/__svn__/Lib/_strptime.py", line 307, in _strptime
_TimeRE_cache = TimeRE()
  File "/home/antoine/py3k/__svn__/Lib/_strptime.py", line 188, in __init__
self.locale_time = LocaleTime()
  File "/home/antoine/py3k/__svn__/Lib/_strptime.py", line 72, in __init__
self.__calc_month()
  File "/home/antoine/py3k/__svn__/Lib/_strptime.py", line 98, in
__calc_month
a_month = [calendar.month_abbr[i].lower() for i in range(13)]
  File "/home/antoine/py3k/__svn__/Lib/_strptime.py", line 98, in 
a_month = [calendar.month_abbr[i].lower() for i in range(13)]
  File "/home/antoine/py3k/__svn__/Lib/calendar.py", line 60, in __getitem__
return funcs(self.format)
UnicodeDecodeError: 'utf8' codec can't decode bytes in position 1-3:
invalid data

--
nosy: +pitrou

___
Python tracker 

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



[issue5903] strftime fails in non UTF-8 locale

2009-05-02 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
priority:  -> high
stage:  -> test needed
type:  -> behavior
versions: +Python 3.1

___
Python tracker 

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



[issue5903] strftime fails in non UTF-8 locale

2009-05-02 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Well, sorry for the message above. There is a problem but it is with
strptime() actually.

>>> time.strptime("2009-12-01", "%Y-%m-%d")
Traceback (most recent call last):
  File "", line 1, in 
  File "/home/antoine/py3k/__svn__/Lib/_strptime.py", line 461, in
_strptime_time
return _strptime(data_string, format)[0]
  File "/home/antoine/py3k/__svn__/Lib/_strptime.py", line 307, in _strptime
_TimeRE_cache = TimeRE()
  File "/home/antoine/py3k/__svn__/Lib/_strptime.py", line 188, in __init__
self.locale_time = LocaleTime()
  File "/home/antoine/py3k/__svn__/Lib/_strptime.py", line 72, in __init__
self.__calc_month()
  File "/home/antoine/py3k/__svn__/Lib/_strptime.py", line 98, in
__calc_month
a_month = [calendar.month_abbr[i].lower() for i in range(13)]
  File "/home/antoine/py3k/__svn__/Lib/_strptime.py", line 98, in 
a_month = [calendar.month_abbr[i].lower() for i in range(13)]
  File "/home/antoine/py3k/__svn__/Lib/calendar.py", line 60, in __getitem__
return funcs(self.format)
UnicodeDecodeError: 'utf8' codec can't decode bytes in position 1-3:
invalid data

--

___
Python tracker 

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



[issue5752] xml.dom.minidom does not handle newline characters in attribute values

2009-05-02 Thread Francesco Sechi

Changes by Francesco Sechi :


--
nosy: +sechi_francesco

___
Python tracker 

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



[issue5903] strftime fails in non UTF-8 locale

2009-05-02 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Well, it turns out that strftime() is buggy as well:

>>> tp = time.strptime("2009-12-01", "%Y-%m-%d")
>>> locale.setlocale(locale.LC_TIME, "fr_FR.ISO8859-15")
'fr_FR.ISO8859-15'
>>> time.strftime("%B", tp)
Traceback (most recent call last):
  File "", line 1, in 
UnicodeDecodeError: 'utf8' codec can't decode bytes in position 1-3:
invalid data

--

___
Python tracker 

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



[issue5905] strptime fails in non-UTF locale

2009-05-02 Thread Antoine Pitrou

New submission from Antoine Pitrou :

time.strptime() fails with non-UTF8 locales, *even when the input is
totally ASCII*.

>>> locale.setlocale(locale.LC_TIME, "fr_FR.ISO8859-15")
'fr_FR.ISO8859-15'
>>> time.strptime("2009-01-01", "%Y-%m-%d")
Traceback (most recent call last):
  File "", line 1, in 
  File "/home/antoine/py3k/__svn__/Lib/_strptime.py", line 461, in
_strptime_time
return _strptime(data_string, format)[0]
  File "/home/antoine/py3k/__svn__/Lib/_strptime.py", line 307, in _strptime
_TimeRE_cache = TimeRE()
  File "/home/antoine/py3k/__svn__/Lib/_strptime.py", line 188, in __init__
self.locale_time = LocaleTime()
  File "/home/antoine/py3k/__svn__/Lib/_strptime.py", line 72, in __init__
self.__calc_month()
  File "/home/antoine/py3k/__svn__/Lib/_strptime.py", line 98, in
__calc_month
a_month = [calendar.month_abbr[i].lower() for i in range(13)]
  File "/home/antoine/py3k/__svn__/Lib/_strptime.py", line 98, in 
a_month = [calendar.month_abbr[i].lower() for i in range(13)]
  File "/home/antoine/py3k/__svn__/Lib/calendar.py", line 60, in __getitem__
return funcs(self.format)
UnicodeDecodeError: 'utf8' codec can't decode bytes in position 1-3:
invalid data

--
components: Library (Lib)
messages: 86953
nosy: pitrou
priority: critical
severity: normal
stage: test needed
status: open
title: strptime fails in non-UTF locale
type: behavior
versions: Python 3.0, Python 3.1

___
Python tracker 

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



[issue3672] Ill-formed surrogates not treated as errors during encoding/decoding

2009-05-02 Thread Benjamin Peterson

Benjamin Peterson  added the comment:

I think the new patch looks fine.

--
assignee: benjamin.peterson -> loewis

___
Python tracker 

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



[issue5752] xml.dom.minidom does not handle newline characters in attribute values

2009-05-02 Thread Francesco Sechi

Changes by Francesco Sechi :


Added file: http://bugs.python.org/file13837/test_toxml.py

___
Python tracker 

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



[issue5692] test_zipfile fails under Windows

2009-05-02 Thread Benjamin Peterson

Benjamin Peterson  added the comment:

Can someone try this patch, please?

--
keywords: +patch
Added file: http://bugs.python.org/file13838/no_drive.patch

___
Python tracker 

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



[issue5902] Stricter codec names

2009-05-02 Thread Matthew Barnett

Matthew Barnett  added the comment:

How about a 'full' form and a 'key' form generated by the function:

def codec_key(name):
return name.lower().replace("-", "").replace("_", "")

The key form would be the key to an available codec, and the key
generated by a user-supplied codec name would have to match one of those
keys.

For example:

Full: "UTF-8", key: "utf8".

Full: "ISO-8859-1", key: "iso88591".

--
nosy: +mrabarnett

___
Python tracker 

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



[issue5906] Risk of confusion in multiprocessing module - daemonic processes

2009-05-02 Thread Pascal Chambon

New submission from Pascal Chambon :

"Usually, daemon processes are processes which got disconnected from
their parent process, and work in the background, often under a
different user identity.
The multiprocessing module has the concept of "daemon" too, but this
time in reference to the "threading" module, in which dameons are just
threads that wont prevent the application termination, even if they are
still running. Thus, daemonic processes launched through multiprocessing
API are normal processes that will be terminated (and not joined) if 
non-dameonic processes are all over."

I guess this difference of concepts would deserve a little paragraph of
clarification, in both multiprocessing and threading APIs (does the
paragraph above fit for that ?)

--
components: Library (Lib)
messages: 86957
nosy: pakal
severity: normal
status: open
title: Risk of confusion in multiprocessing module - daemonic processes
versions: Python 2.6, Python 2.7, Python 3.0, Python 3.1

___
Python tracker 

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



[issue5906] Risk of confusion in multiprocessing module - daemonic processes

2009-05-02 Thread Benjamin Peterson

Changes by Benjamin Peterson :


--
assignee:  -> jnoller
nosy: +jnoller

___
Python tracker 

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



[issue5907] repr of time.struct_time type does not eval

2009-05-02 Thread John Morton

New submission from John Morton :

The output of repr on an object of type time.struct_time has changed
from 2.5 to 2.6, and can no longer be read in with an eval.

2.5 behaviour:

Python 2.5.4 (r254:67916, Apr  4 2009, 17:55:16) 
[GCC 4.3.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import time
>>> t1 = time.gmtime()
>>> t1_repr = repr(t1)
>>> t1_repr
'(2009, 5, 2, 16, 16, 43, 5, 122, 0)'
>>> t2 = eval(t1_repr)
>>> t1 == t2
True

Meanwhile in 2.6:

Python 2.6.2 (release26-maint, Apr 19 2009, 01:56:41) 
[GCC 4.3.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import time
>>> t1 = time.gmtime()
>>> t1_repr = repr(t1)
>>> t1_repr
'time.struct_time(tm_year=2009, tm_mon=5, tm_mday=2, tm_hour=16,
tm_min=20, tm_sec=54, tm_wday=5, tm_yday=122, tm_isdst=0)'
>>> t2 = eval(t1_repr)
Traceback (most recent call last):
  File "", line 1, in 
  File "", line 1, in 
TypeError: structseq() takes at most 2 arguments (9 given)

Obviously returning a time.time_struct based representation is the right
thing to do, but the repr of this flavour should eval.

--
components: Extension Modules, Tests
messages: 86958
nosy: jwm
severity: normal
status: open
title: repr of time.struct_time type does not eval
type: behavior
versions: Python 2.6

___
Python tracker 

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



[issue5906] Risk of confusion in multiprocessing module - daemonic processes

2009-05-02 Thread Jesse Noller

Jesse Noller  added the comment:

The multiprocessing lib mimics the threading library, and the 
threading.Thread.daemon has always maintained these are not 
services/daemons/etc.

I don't see that the clarification is needed, but let me think about it.

--

___
Python tracker 

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



[issue5906] Risk of confusion in multiprocessing module - daemonic processes

2009-05-02 Thread Pascal Chambon

Pascal Chambon  added the comment:

I agree that for someone who discovers the multiprocessing api as a
"generalization" of the threading api, there won't be problems ; 

I'm just worried about those (like me) who will see "daemonic" as coming
from unix processes, and not the threading library B-)

Cheers, 
pascal

--

___
Python tracker 

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



[issue5880] Remove unneeded "context" pointer from getters and setters

2009-05-02 Thread Mark Dickinson

Mark Dickinson  added the comment:

I've removed those gratuitous context uses in Objects/longobject.c
in r72202 (trunk) and r72203 (py3k).

I'm not sure it's a good idea to remove the context field completely.  
Apart from the compatibility issues that Antoine pointed out, it
doesn't seem improbable that some getters and setters might need it.

A Google code search for PyGetSetDef turned up at least one non-null
use of the context field (in something called pyephem).  I didn't
look at it closely, though.

--

___
Python tracker 

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



[issue5858] Make complex repr and str more like float repr and str

2009-05-02 Thread Mark Dickinson

Mark Dickinson  added the comment:

I'm not going to pursue this further;  try as I might, I really can't
make this anything more than just a personal preference.  It doesn't
solve any genuine problem.

Closing.

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



[issue5907] repr of time.struct_time type does not eval

2009-05-02 Thread Martin v. Löwis

Martin v. Löwis  added the comment:

Notice that this is no bug: there is no guarantee that repr() can
eval(). For some types it does, for others, it doesn't.

--
nosy: +loewis
type: behavior -> feature request

___
Python tracker 

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



[issue1588] str.format() wrongly formats complex() numbers (Py30a2)

2009-05-02 Thread Mark Dickinson

Mark Dickinson  added the comment:

One comment on the new complex formatting.  I now get (in py3k)

>>> from math import pi, e
>>> format(complex(pi,e), '<')
'(3.14159+2.71828j)'
>>> format(complex(pi,e), '')
'(3.14159265359+2.71828182846j)'

I understand why this is happening, but again I think that alignment 
flags shouldn't change the form of the number itself.  Would it be 
reasonable to have the empty format code always use a precision of 12?

--

___
Python tracker 

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



[issue5311] bdist_msi generates version number for pure Python packages

2009-05-02 Thread Steven Bethard

Steven Bethard  added the comment:

Ok, I've been chatting with folks on microsoft.public.platformsdk.msi,
and I think the right approach here is to define a Feature for each
version of Python. Each Feature would install the exact same files, but
to a different Python directory.

One of the nice things about this approach would be that you could
install a module for multiple Python versions all at the same time. It
also should avoid the need for a VBScript or C-based CustomAction - we
should be able to do everything with the database tables.

One of the downsides is that we'll have to hard-code in all possible
versions of Python. My current plan is just to declare all versions as
2.0, 2.1, ..., 3.9. That should be good enough for a while, but at some
point this will have to get updated to work with Python 4.0. ;-)

I'll post back here when I've made some progress on this.

--

___
Python tracker 

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



[issue3672] Ill-formed surrogates not treated as errors during encoding/decoding

2009-05-02 Thread Benjamin Peterson

Benjamin Peterson  added the comment:

Something I overlooked is that PyCodec_SurrogateErrors isn't exposed in
any headers.

--

___
Python tracker 

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



[issue3672] Ill-formed surrogates not treated as errors during encoding/decoding

2009-05-02 Thread Martin v. Löwis

Martin v. Löwis  added the comment:

Committed as r72208, blocked as r72209.

As for PyCodec_SurrogateErrors: I'd rather make it static than expose it.

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

___
Python tracker 

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



[issue3672] Ill-formed surrogates not treated as errors during encoding/decoding

2009-05-02 Thread Benjamin Peterson

Benjamin Peterson  added the comment:

2009/5/2  <"\"Martin v. Löwis\"
"@psf.upfronthosting.co.za>:
>
> Martin v. Löwis  added the comment:
>
> Committed as r72208, blocked as r72209.
>
> As for PyCodec_SurrogateErrors: I'd rather make it static than expose it.

Why? All the other error handlers are exposed.

--

___
Python tracker 

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



[issue1607951] mailbox.Maildir re-reads directory too often

2009-05-02 Thread A.M. Kuchling

A.M. Kuchling  added the comment:

Updated version of the patch that only stores the current time -1sec,
adds a test case, and passes all tests.

--
keywords: +patch
Added file: http://bugs.python.org/file13839/mailbox-mtime.patch

___
Python tracker 

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



[issue3672] Ill-formed surrogates not treated as errors during encoding/decoding

2009-05-02 Thread Martin v. Löwis

Martin v. Löwis  added the comment:

>> As for PyCodec_SurrogateErrors: I'd rather make it static than expose it.
> 
> Why? All the other error handlers are exposed.

Sure - but what for? IMO, they all shouldn't be exposed.

--

___
Python tracker 

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



[issue3672] Ill-formed surrogates not treated as errors during encoding/decoding

2009-05-02 Thread Benjamin Peterson

Benjamin Peterson  added the comment:

2009/5/2  <"\"Martin v. Löwis\"
"@psf.upfronthosting.co.za>:
>
> Martin v. Löwis  added the comment:
>
>>> As for PyCodec_SurrogateErrors: I'd rather make it static than expose it.
>>
>> Why? All the other error handlers are exposed.
>
> Sure - but what for? IMO, they all shouldn't be exposed.

The only reason I can think of is consistency, but I don't care that much.

--

___
Python tracker 

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



[issue1588] str.format() wrongly formats complex() numbers (Py30a2)

2009-05-02 Thread Eric Smith

Eric Smith  added the comment:

Is this suggestion for all types, or just complex? Because float has the
same issue.

>>> format(pi, '')
'3.14159265359'
[38243 refs]
>>> format(pi, '>')
'3.14159'

--

___
Python tracker 

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



[issue1588] str.format() wrongly formats complex() numbers (Py30a2)

2009-05-02 Thread Mark Dickinson

Mark Dickinson  added the comment:

Hmm.  That also seems wrong to me.  So I guess it's a suggestion
for float as well, which means it's not specific to this issue.
Should I open a separate feature request?

--

___
Python tracker 

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



[issue5692] test_zipfile fails under Windows

2009-05-02 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

I don't think your patch is specific enough. It should only trigger when
the targetpath is of the form "/" or "X:/".
By the way, while I first rated this bug release blocker, thinking
test_zipfile was failing for all Windows platforms, we can downgrade it
if it only happens in a root directory.

--

___
Python tracker 

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



[issue5908] I need to import the module in the same thread?

2009-05-02 Thread tyoc

New submission from tyoc :

Hi there, my problem is the following I dont know if this is a python 
error, spected behaviour or what, so here I go.

I'm using pyatspi in a console application for retrieve focus events
(you need to enable accessibility if want to check... that is at-spi-
registryd in 'top'):


Example 1: works correctly (focus events printed to stdout).
NOTE: See that the import is inside of 'run' and all the calls to the 
module are inside this thread.
FREEZE: No, correct behaviour.

[code start]
def cb(eve):
print eve

import threading
class THRE4D(threading.Thread):
def __init__(self):
threading.Thread.__init__(self)
def run(self):
import pyatspi
print 'spot 0'
pyatspi.Registry.registerEventListener(cb, 'focus')
import gobject
print 'spot 1'
gobject.timeout_add(5000, pyatspi.Registry.stop)
print 'spot 2'
pyatspi.Registry.start()
print 'spot 3'

t = THRE4D()
t.start()
t.join(15000)
print 'joined'
[code end]

Example 2: it prints the first event and freeze quit because the 
timeout_add.
NOTE:See that I have moved the import and the register to __init__ the 
loop is in the new thread.
FREEZE: Yes. Print first event, dont know where it freeze (function), 
but has passed 'registerEventListener' and it has entered 
'Registry.start()'.

[code start]
def cb(eve):
print eve

import threading
class THRE4D(threading.Thread):
def __init__(self):
threading.Thread.__init__(self)
import pyatspi
pyatspi.Registry.registerEventListener(cb, 'focus')
def run(self):
import pyatspi
print 'spot 0'
import gobject
print 'spot 1'
gobject.timeout_add(5000, pyatspi.Registry.stop)
print 'spot 2'
pyatspi.Registry.start()
print 'spot 3'

t = THRE4D()
t.start()
t.join(15000)
print 'joined'
[code end]

Example 3: It does not print any event at all and it freezes. It only 
prints 'spot 0'. The freeze is hard even that timeout_add doest end it 
in the time.
NOTE: See that I have only imported pyatspi in '__init__' all the calls 
are inside the thread.
FREEZE: Yes. No print of events, freeze inside inside 'accessible.py of 
pyatspi' in '_inner' where 'try: return func(self, *args, **kwargs)'.

[code start]
def cb(eve):
print eve

import threading
class THRE4D(threading.Thread):
def __init__(self):
threading.Thread.__init__(self)
import pyatspi
def run(self):
import pyatspi
print 'spot 0'
pyatspi.Registry.registerEventListener(cb, 'focus')
import gobject
print 'spot 1'
gobject.timeout_add(5000, pyatspi.Registry.stop)
print 'spot 2'
pyatspi.Registry.start()
print 'spot 3'

t = THRE4D()
t.start()
t.join(15000)
print 'joined'
[code end]



actual conclusions

 * I dont know why importing it 2 times (pyatspi) in different context 
of threads launch this problem.

 * for a 'quick' solution: The import and the calls should be in the 
same thread "specially" 'registerEventListener'.

--
components: Library (Lib), None
messages: 86975
nosy: tyoc
severity: normal
status: open
title: I need to import the module in the same thread?
type: behavior
versions: Python 2.5

___
Python tracker 

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



[issue1588] str.format() wrongly formats complex() numbers (Py30a2)

2009-05-02 Thread Eric Smith

Eric Smith  added the comment:

> Hmm.  That also seems wrong to me.  So I guess it's a suggestion
> for float as well, which means it's not specific to this issue.
> Should I open a separate feature request?

Yes, this is a separate issue. It comes from PEP 3101's specification of 
"like 'g' but different" for floats with no specified presentation type.

--

___
Python tracker 

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



[issue5692] test_zipfile fails under Windows

2009-05-02 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

This alternate patch is ok here (tested under Windows and Linux).
It's against trunk, since the bug actually exists there too.

--
Added file: http://bugs.python.org/file13840/issue5692.patch

___
Python tracker 

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



[issue5692] test_zipfile fails under Windows

2009-05-02 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
versions: +Python 2.6, Python 2.7, Python 3.0

___
Python tracker 

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



[issue5679] cleanUp stack for unittest

2009-05-02 Thread Michael Foord

Michael Foord  added the comment:

Committed in revision 72219.

--
status: open -> closed

___
Python tracker 

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



[issue5907] repr of time.struct_time type does not eval

2009-05-02 Thread Georg Brandl

Georg Brandl  added the comment:

Also, the 2.5 behavior was not up to spec either: after eval() you get a
simple tuple, while the object before was a time.struct_time object.

(True, you can pass these tuples to the time functions, but an
eval()able repr() should reproduce the object exactly.)

--
nosy: +georg.brandl

___
Python tracker 

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



[issue5311] bdist_msi generates version number for pure Python packages

2009-05-02 Thread Steven Bethard

Steven Bethard  added the comment:

Ok, that was actually easier than I thought it would be. The new patch
introduces properties for each Python version (e.g. TARGETDIR2.4,
PYTHON.MACHINE.2.4, etc.), and disables and hides the features for any
Python versions that aren't found in the registry.

The one remaining issue: What should we do about Python installations
that are missing the appropriate keys in the registry? I imagine this
could happen if, say, you build Python from source. My first thought was
to add an "Other Python Installation" Feature that is disabled (but
visible) by default, and allow the path for that Feature to be filled in
by hand. Does that make sense?

--
Added file: http://bugs.python.org/file13841/bdist_msi.patch

___
Python tracker 

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



[issue5909] Segfault in typeobject.c

2009-05-02 Thread Gerald Britton

New submission from Gerald Britton :

Python 2.6 segfaults when starting up the gramps application

--
assignee: theller
components: ctypes
files: gdb-python.txt
messages: 86981
nosy: gbritton, theller
severity: normal
status: open
title: Segfault in typeobject.c
type: crash
versions: Python 2.6
Added file: http://bugs.python.org/file13842/gdb-python.txt

___
Python tracker 

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



[issue5084] unpickling does not intern attribute names

2009-05-02 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Committed in r72223, r72224. Thanks!

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



[issue1443504] locale.getpreferredencoding() dies when setlocale fails

2009-05-02 Thread Jeroen Ruigrok van der Werven

Jeroen Ruigrok van der Werven  added the comment:

I will first point out where our current implementation is broken, in my
opinion of course, after which I propose a small patch.

Both C90 (7.4.1.1) and C99 (7.11.1.1) state:

"A value of "C" for locale specifies the minimal environment for C
translation; a value of "" for locale specifies the locale-specific
native environment. Other implementation-defined strings may be passed
as the second argument to setlocale.

[...]

If a pointer to a string is given for locale and the selection can be
honored, the setlocale function returns a pointer to the string
associated with the specified category for the new locale. If the
selection cannot be honored, the setlocale function returns a null
pointer and the program’s locale is not changed."

Note that neither C or POSIX defines any errors or sets errno or the
likes. It simply returns a null pointer.

In C you would typically start your program with a call like:

#include 

int main(int argc, char *argv[]) {
setlocale(LC_CTYPE, "");

...
}

This will try to set the locale to what the native environment
specifies, but will not error out if the value, if any, it receives does
not map to a valid locale. It will return a null pointer if it cannot
set the locale. Execution continues and the locale is set to the default
"C".

Our current behaviour in Python does not adhere to these semantics. To
illustrate:

# Obvious non-existing locale
>>> from locale import setlocale, LC_CTYPE
>>> setlocale(LC_CTYPE, 'B')
Error: unsupported locale setting

# Valid locale, but not available on my system
>>> from os import getenv
>>> from locale import setlocale, LC_CTYPE
>>> getenv('LANG')
>>> 'cy_GB.UTF-8'
>>> setlocale(LC_CTYPE, '')
Error: unsupported locale setting

Neither Perl or PHP throw any error when setlocale() is passed an
invalid locale. Python is being unnecessarily disruptive by throwing an
error.

As such I think PyLocale_setlocale() in Modules/_localemodule.c needs to
be adjusted. Patch against trunk enclosed. This changes the semantics of
our current implementation to the following:

>>> from locale import setlocale, LC_CTYPE
>>> rv = setlocale(LC_CTYPE, 'B')
>>> type(rv)

>>> rv = setlocale(LC_CTYPE, 'C')
>>> type(rv)

>>> rv
'C'

--
Added file: http://bugs.python.org/file13843/locale.diff

___
Python tracker 

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



[issue5910] kqueue for more than one event is broken.

2009-05-02 Thread Erik Gorset

New submission from Erik Gorset :

The kqueue code doesn't increment the index when building the changelist.

The patch should work for both py26 and py30.

--
components: Extension Modules
files: kqueue.patch
keywords: patch
messages: 86984
nosy: Erik Gorset
severity: normal
status: open
title: kqueue for more than one event is broken.
type: behavior
versions: Python 2.6, Python 2.7, Python 3.0, Python 3.1
Added file: http://bugs.python.org/file13844/kqueue.patch

___
Python tracker 

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



[issue1443504] locale.getpreferredencoding() dies when setlocale fails

2009-05-02 Thread Martin v. Löwis

Martin v. Löwis  added the comment:

> If a pointer to a string is given for locale and the selection can be
> honored, the setlocale function returns a pointer to the string
> associated with the specified category for the new locale. If the
> selection cannot be honored, the setlocale function returns a null
> pointer and the program’s locale is not changed."
> 
> Note that neither C or POSIX defines any errors or sets errno or the
> likes. It simply returns a null pointer.

Still, this is considered as an error case.

> #include 
> 
> int main(int argc, char *argv[]) {
>   setlocale(LC_CTYPE, "");
> 
>   ...
> }
> 
> This will try to set the locale to what the native environment
> specifies, but will not error out if the value

Yes, but that's a bug in the C code, which fails to check the
return value of setlocale. The fact that the bug is wide-spread
doesn't make it any better.

> As such I think PyLocale_setlocale() in Modules/_localemodule.c needs to
> be adjusted

-1. Errors should never pass silently. That's the whole point of exceptions.

--

___
Python tracker 

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



[issue5201] Using LDFLAGS='-rpath=\$$LIB:/some/other/path' ./configure breaks the build

2009-05-02 Thread Floris Bruynooghe

Floris Bruynooghe  added the comment:

The attached patch does fix this issue.

Concerning the specific example of LDFLAGS used here there is still and
issue with LDFLAGS being ignored by the buid for the shared modules, but
that is an other issue.

--
keywords: +patch
Added file: http://bugs.python.org/file13845/makevars.diff

___
Python tracker 

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



[issue5728] Support telling TestResult objects a test run has finished

2009-05-02 Thread Michael Foord

Michael Foord  added the comment:

Committed in revision 72225.

--
status: open -> closed

___
Python tracker 

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



[issue1054967] bdist_deb - Debian packager

2009-05-02 Thread Paul Hummer

Paul Hummer  added the comment:

I've been doing a review of this patch for the last few hours.  There
are a few issues that need to be taken care of in order for it to move
forward, and I'm currently working on them, in this order:

  1. Update the patch to the most recent svn.  The most current patch is
almost 5 years old.  I've ported it forward.
  2. Fix the unittests.  The patch is failing its unittests currently,
and so I'm fixing the unittests, and will be adding tests where there
may not be any coverage.
  3. Implement the suggestions made by alberanid and kbk, adding tests
where necessary.

  I've been chatting with jafo, and am willing to commit to maintaining
this code for the next few years, and am willing to sign the contributor
agreement in order to do so.  I don't particularly want to step on
anyone's toes, so if someone else is also working on this, I'm happy to
hand off what I've already been working on.

--
nosy: +rockstar

___
Python tracker 

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



[issue5201] Using LDFLAGS='-rpath=\$$LIB:/some/other/path' ./configure breaks the build

2009-05-02 Thread Floris Bruynooghe

Floris Bruynooghe  added the comment:

Hmm, the patch isn't quite right yet.  When a $$ is present in the
makefile .parse_makefile() needs to return a single $.  I'm not sure yet
what needs to happen with the \ for the shell escape.

--

___
Python tracker 

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



[issue1128] msilib.Directory.make_short only handles file names with a single dot in them

2009-05-02 Thread Henrique Baggio

Henrique Baggio  added the comment:

Sorry, I don't know how create a patch, but just change the line with 

parts = file.split(".") to parts = os.path.splitext(file)

and the problem is fixed.

--
nosy: +hnrqbaggio

___
Python tracker 

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



[issue1128] msilib.Directory.make_short only handles file names with a single dot in them

2009-05-02 Thread Henrique Baggio

Henrique Baggio  added the comment:

I create a patch using the os.path.splitext function.

--
Added file: http://bugs.python.org/file13846/msilib.__init__.patch

___
Python tracker 

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



[issue5311] bdist_msi generates version number for pure Python packages

2009-05-02 Thread Steven Bethard

Steven Bethard  added the comment:

Ok, I added one final Feature that allows the user to specify an
alternate Python directory. (The PathEdit for specifying the directory
will only display if this Feature is set to be installed.)

I think this patch is pretty much ready to go in now. It could use a
review and some testing from folks on other kinds of machines, but I
think all the functionality is there now. (And no need for CustomAction
scripts! Yay!)

If at all possible, I'd like to get this into the Python 3.1 beta so
that we can have as many people as possible test this out on other
Windows machines.

--
Added file: http://bugs.python.org/file13847/bdist_msi.patch

___
Python tracker 

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



[issue5908] I need to import the module in the same thread?

2009-05-02 Thread tyoc

tyoc  added the comment:

OK, here is a resume of the anterior.

I see clearly that it matter where I import the library (dont know if 
is a problem of the library or python). This time the thread doesnt 
end, will end when you hit CTRL+C in the terminal, for test this you 
need enabled accessibility.

Steps

1) run the code as is and see that it prints spot 0, 1 end is not wrote
2) uncomment the line of import pyatspi # import in the main thread and 
run again, see that it only print 0, it app is stuck inside 
pyatspi.Registry.registerEventListener(cb, 'focus')


[code start]---
import threading 
class thr(threading.Thread): 
def __init__(self): 
threading.Thread.__init__(self) 
#import pyatspi # import in the main thread 
def run(self): 
def cb(eve): 
print eve 
import pyatspi # import here in the new thread 
print 'spot 0' 
pyatspi.Registry.registerEventListener(cb, 'focus') 
print 'spot 1'
pyatspi.Registry.start() 
print 'End' 
  
t = thr() 
t.start() 
t.join() 
[code end]---



So at less for this library, it matter where you import the thing.

--

___
Python tracker 

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



[issue5911] built-in compile() should take encoding option.

2009-05-02 Thread Naoki INADA

New submission from Naoki INADA :

The built-in compile() expects source is encoded in utf-8.
This behavior make it harder to implement alternative shell
like IDLE and IPython. (http://bugs.python.org/issue1542677 and
https://bugs.launchpad.net/ipython/+bug/339642 are related bugs.)

Below is current compile() behavior.

# Python's interactive shell in Windows cp932 console.
>>> "あ"
'\x82\xa0'
>>> u"あ"
u'\u3042'

# compile() fails to decode str.
>>> code = compile('u"あ"', '__interactive__', 'single')
>>> exec code
u'\x82\xa0'  # u'\u3042' expected.

# compile() encodes unicode to utf-8.
>>> code = compile(u'"あ"', '__interactive__', 'single')
>>> exec code
'\xe3\x81\x82' # '\x82\xa0' (cp932) wanted, but I get utf-8.

Currentry, using PEP0263 like below is needed to get compile
code in expected encoding.

>>> code = compile('# coding: cp932\n%s' % ('"あ"',), '__interactive__', 
'single')
>>> exec code
'\x82\xa0'
>>> code = compile('# coding: cp932\n%s' % ('u"あ"',), '__interactive__', 
'single')
>>> exec code
u'\u3042'

But I feel compile() with PEP0263 is bit dirty hack.
I think adding a 'encoding' argument that have a 'utf-8' as default value to
compile() is cleaner way and it doesn't break backward compatibility.

Following example is describe behavior of compile() with encoding option.

# coding: utf-8 (in utf-8 context)
code = compile('"あ"', '__foo.py', 'single')
exec code #=> '\xe3\x81\x82'

code = compile('"あ"', '__foo.py', 'single', encoding='cp932') => 
UnicodeDecodeError

code = compile(u'"あ"', '__foo.py', 'single')
exec code #=> '\xe3\x81\x82'

code = compile(u'"あ"', '__foo.py', 'single', encoding='cp932')
exec code #=> '\x82\xa0'

--
components: None
messages: 86994
nosy: naoki
severity: normal
status: open
title: built-in compile() should take encoding option.
type: feature request
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



[issue5559] IDLE Output Window 's goto fails when path has spaces

2009-05-02 Thread Kurt B. Kaiser

Kurt B. Kaiser  added the comment:

r72227.

How's your test code coming?  A relative Win filename with leading 
spaces should be found even when there's a file of same name but no 
spaces.

--
keywords: +26backport

___
Python tracker 

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



[issue1607951] mailbox.Maildir re-reads directory too often

2009-05-02 Thread A.M. Kuchling

A.M. Kuchling  added the comment:

Committed to trunk in rev. 72213.

Committed to py3k in rev. 72228.

--
resolution:  -> fixed
status: open -> closed
versions: +Python 2.7 -Python 2.6

___
Python tracker 

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



[issue5850] Full example for emulating a container type

2009-05-02 Thread Garrett Cooper

Garrett Cooper  added the comment:

Maybe the documentation for other examples should be referenced then?

--

___
Python tracker 

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



[issue5679] cleanUp stack for unittest

2009-05-02 Thread Garrett Cooper

Garrett Cooper  added the comment:

Cool! Thanks for all of the hard work Michael :D.

--

___
Python tracker 

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



[issue5738] multiprocessing example wrong

2009-05-02 Thread Garrett Cooper

Garrett Cooper  added the comment:

Priorities shifted again at work, so I'll get around to this some time
around early June when I get an opportunity to implement multiprocessing
in my work code...

Thanks!

--

___
Python tracker 

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