[issue6982] make clean does not remove pickle files

2009-09-24 Thread Mark Dickinson

Mark Dickinson dicki...@gmail.com added the comment:

I don't think it is safe to remove all *.pickle files in the source 
directory;  even if there aren't any other useful .pickle files right now, 
there could be in the future (e.g. for pickle testing).

I'd prefer something more targeted.

Are these .pickle files generated during the build process, or just during 
testing?  Maybe it should be the responsibility of the 2to3 tests to clean 
up after themselves?

--
nosy: +mark.dickinson

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



[issue6632] Include more fullwidth chars in the decimal codec

2009-09-24 Thread Martin v . Löwis

Martin v. Löwis mar...@v.loewis.de added the comment:

 The codec currently doesn't look at the base at all - and shouldn't
 need to:
 
 It simply converts input characters that have a decimal digit value
 associated with them, to the usual ASCII digits in preparation
 for parsing them using the standard number parsing tools we have in
 Python.

Right. And as such, it shouldn't stop with digit 9, but continue into
digits a, b, c, and so on, as appropriate.

 This is to support number representations using non-ASCII code
 points for digits (e.g. Japanese or Sanskrit numbers)

Notice that it also supports bases other than 10:

80

So calling it decimal is a misnomer.

 Also note that we already have a hex codec in Python 2.x
 which converts between the hex representations of a string
 and its regular form. This was removed in 3.x for some reason
 I don't understand (probably just an oversight).

The hex codec doesn't have to do anything with number conversions;
nor does it have to do with character encodings. To introduce it was
a mistake in Python 2.x which has been fixed in 3.x (by removing
it and other similar codecs, such as rot13).

--

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



[issue6834] use different mechanism for pythonw on osx

2009-09-24 Thread Martin v . Löwis

Martin v. Löwis mar...@v.loewis.de added the comment:

 This version uses posix_spawn rather than execv to start the real 
 interpreter. 

In what way is that better? It creates a new process (IIUC); therefore,
I think that using it is worse than using execv. Anybody killing the
pythonw process would only kill the wrapper.

 The main advantage of the new implementation is that 'arch 
 -ppc pythonw' works as expected, with the current version of pythonw the 
 'arch' command only affects the pythonw executable and not the real 
 interpreter.

I suppose this would also be possible through execv?

--

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



[issue6982] make clean does not remove pickle files

2009-09-24 Thread egreen

egreen egr...@operamail.com added the comment:

These .pickle files aren't created by the tests themselves, but they do
show up after running 'make test', or more specifically after running
'./python Lib/test/regrtest.py -v test_lib2to3'.

This is because a grammar generated from a .txt grammar file is cached
as a pickle for faster access by load_grammar in
Lib/lib2to3/pgen2/driver.py. A pickle file then ends up in the same
directory as the .txt file.

IMHO, though it may be preferable to remove just the pickle files in
Lib/lib2to3, it should never be required for tests to have pickle files
already available in the source tree. Instead, the test should create a
temporary pickle file, e.g. from a bytes object. Furthermore, binary
files shouldn't be versioned without good reason. Thus, removing all
pickle files should be safe for the future.

--

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



[issue6632] Include more fullwidth chars in the decimal codec

2009-09-24 Thread Marc-Andre Lemburg

Marc-Andre Lemburg m...@egenix.com added the comment:

Martin v. Löwis wrote:
 
 Martin v. Löwis mar...@v.loewis.de added the comment:
 
 The codec currently doesn't look at the base at all - and shouldn't
 need to:

 It simply converts input characters that have a decimal digit value
 associated with them, to the usual ASCII digits in preparation
 for parsing them using the standard number parsing tools we have in
 Python.
 
 Right. And as such, it shouldn't stop with digit 9, but continue into
 digits a, b, c, and so on, as appropriate.

I don't think that's needed. The codec already passes those
through as-is.

 This is to support number representations using non-ASCII code
 points for digits (e.g. Japanese or Sanskrit numbers)
 
 Notice that it also supports bases other than 10:
 
 80
 
 So calling it decimal is a misnomer.

Not really: _PyUnicode_ToDecimalDigit() is used for the
conversion and that API explicitly only returns integer
values for code points that map to the digits 0-9 - at
least that's how it was originally written (see the code
in Python 1.6 which makes this explicit).

If it returns values outside that range, that's a bug
and needs to be fixed, since it would cause the codec
to fail. It is designed to only work on digits, not
arbitrary decimals.

 Also note that we already have a hex codec in Python 2.x
 which converts between the hex representations of a string
 and its regular form. This was removed in 3.x for some reason
 I don't understand (probably just an oversight).
 
 The hex codec doesn't have to do anything with number conversions;
 nor does it have to do with character encodings. To introduce it was
 a mistake in Python 2.x which has been fixed in 3.x (by removing
 it and other similar codecs, such as rot13).

That's your particular view of things. It's not mine and never
was the basis of the codec design.

Codecs in Python are open to work on arbitrary types and
it's well possible to have codecs that return the same type
as their input.

The hex codec in Python 2.x is a very useful and handy
codec and it's used a lot.

It should be added back again - after all, even by your
restrictive view of codecs in Python only serving as a way to
do character encodings, it is a valid character encoding -
that of Latin-1 code points to a two-byte HEX representation
and vice-versa.

Just like rot-13 and most of the others that were apparently
removed (uu, base64, quoted-printable, zip, bz2).

BTW: I noticed that idna and punycode were not removed...
even though they fall into the same category as the hex
codec.

I guess we should have a discussion about this on python-dev.

--

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



[issue6983] Add specific get_platform() for freebsd

2009-09-24 Thread Marc-Andre Lemburg

Marc-Andre Lemburg m...@egenix.com added the comment:

Stef Walter wrote:
 
 New submission from Stef Walter s...@memberwebs.com:
 
 In Lib/distutils/util.py in the get_platform() function there's OS 
 specific code to create a string which describes the current platform. 
 This usually includes the OS + version + arch. 
 
 FreeBSD specific code is missing from this function. Currently 
 get_platform() returns a string specific to the security patch level of 
 freebsd. For example:
 
 freebsd-7.2-RELEASE-p3-i386
 
 This results in eggs that only work on a specific patch level release of 
 FreeBSD and are not portable between (for example) 7.2-RELEASE-p2 and 
 7.2-RELEASE-p3.
 
 However FreeBSD is actually binary compatible within a major version 
 number. For example 7.1 and 7.2 are binary compatible.
 
 This patch adds freebsd specific code to get_platform() after which it 
 will return a string like:
 
 freebsd-7-i386

I think this is more a problem with easy_install than with
distutils itself.

get_platform() is meant to return a platform string, nothing
more, nothing less.

It is more meant for human consumption than for scripts to
use as basis for checking whether a particular platform
is binary compatible to what the user wants to install
a distribution archive to.

What we could do is provide a new distutils API
binary_compatible_platform() which takes the platform string
as used in the distribution archive and compares it to the
one returned by distutils on the target system.

Note that there are various level of compatibility to
consider here:

 * whether the ABI is the same (binary compatible)
 * whether the code is 32-bit and needs to run on a 64-bit
   system
 * whether the typically installed software base is
   the same
 * whether the target system provides a compatibility layer
   which can be used or not
 * whether the distribution provides code for more than
   one platform (e.g. Mac universal builds), so that it'll
   run on more than just one architecture

It is usually easier for the user to decide by looking at
the file name whether a certain package is suitable or not
than to have some script know about all the differences
between the various OS versions.

Some examples for get_platform() strings which are in fact
compatible:

darwin-8.11.0-Power_Macintosh (the Python 2.3 way)
macosx-10.4-fat (the Python 2.5+ way)
macosx-10.4-ppc (actually fat, but not identified as such
 due to a bug in distutils for Python 2.4)

Aside: For eGenix we have decided to simply drop the get_platform()
check in our prebuilt archives altogether - there are just too
many dimensions to the problem. Instead, we use the sys.platform
variable which provides a much more practical (though, not perfect)
solution to the problem of detecting incompatibilities early
on in the installation process.

--
nosy: +lemburg

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



[issue6982] make clean does not remove pickle files

2009-09-24 Thread Mark Dickinson

Mark Dickinson dicki...@gmail.com added the comment:

 IMHO, though it may be preferable to remove just the pickle files in
 Lib/lib2to3,

Sounds reasonable.

 it should never be required for tests to have pickle files
 already available in the source tree.

Well, I don't know about 'should', but the current tests already do
make use of pickle files in the source tree:  see Lib/test/*.pck.
So there are already versioned pickle files (but not .pickle files :-).

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

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



[issue6982] make clean does not remove pickle files

2009-09-24 Thread egreen

egreen egr...@operamail.com added the comment:

You are right. Guess I was being a little too dogmatic. :-)

I hadn't found those .pck files, because I was only looking for binary
files.

Here's a new patch proposal.

--
Added file: http://bugs.python.org/file14962/clean-grammar-pickles.patch

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



[issue6985] range() fails with long integers

2009-09-24 Thread Krzysztof Szawala

New submission from Krzysztof Szawala kszaw...@slb.com:

range() method fails with the following error message:


Traceback (most recent call last):
  File stdin, line 1, in module
OverflowError: range() result has too many items


when passing a valid integer value of 99.
This value is obtained from OptParse command-line option as a valid 
ingeter.

Applies to both Windows and Linux (32 and 64-bit).

--
components: Interpreter Core
messages: 93063
nosy: kszawala
severity: normal
status: open
title: range() fails with long integers
type: crash
versions: Python 2.6

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



[issue6985] range() fails with long integers

2009-09-24 Thread Eric Smith

Eric Smith e...@trueblade.com added the comment:

This doesn't crash the interpreter, so I'm changing it to behavior.

The number of items in a range() must fit into a native int.

What are you doing with the range? Could you use xrange instead?

--
nosy: +eric.smith
resolution:  - wont fix
status: open - closed
type: crash - behavior

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



[issue5395] array.fromfile not checking I/O errors

2009-09-24 Thread Jan Hosang

Jan Hosang jan.hos...@gmail.com added the comment:

I attached a path for raising IOErrors in fromfile. I also added a 
testcase which failed before.

The test opens a file and closes the file with os.close(fd) without 
telling the file object, so fromfile doesn't notice it's reading from a 
file that is actually closed.

--
keywords: +patch
nosy: +chuck
Added file: http://bugs.python.org/file14963/array_ioerror.patch

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



[issue6985] range() fails with long integers

2009-09-24 Thread Mark Dickinson

Mark Dickinson dicki...@gmail.com added the comment:

I *think* range uses long internally, so 99 should be okay on an
LP64 machine.  Except that of course the range() result must also fit in
memory: on a 64-bit machine range(99) would need more than 300
Gb of memory.  (That's 32 bytes per entry:  24 bytes for each integer
and 8 bytes for the list pointer.)

--
nosy: +mark.dickinson

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



[issue6982] make clean does not remove pickle files

2009-09-24 Thread Mark Dickinson

Mark Dickinson dicki...@gmail.com added the comment:

Thanks!  I'll apply this later today, unless Benjamin gets there first. :)

--
resolution:  - accepted

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



[issue6986] _json crash on scanner/encoder initialization error

2009-09-24 Thread STINNER Victor

New submission from STINNER Victor victor.stin...@haypocalc.com:

scanner_init() and encoder_init() don't manage errors correctly.

scanner_init() gets context.encoding argument without checking context
type, nor GetAttrString() error. It should check for NULL result...
which is done in the same function for other attributes (strict,
object_hook, object_pairs_hook, parse_float, parse_int, parse_constant).

Example to reproduce the crash:
   import _json
   _json.make_scanner(1)

encoder_init() copies a refence (for each argument) without incrementing
the reference counter. And then encoder_clear() decrements the
reference, counter, which may crash Python.

Example to reproduce the crash:
   import _json
   _json.make_encoder(
   (False, True),
   -826484143518891896,
   -56.0,
   a,
   )
   # do anything creating/destroying new objects
abc .strip()
   len( xef .strip())

Attached patches for the crashes.

--
files: _json_encoder_init.patch
keywords: patch
messages: 93068
nosy: haypo
severity: normal
status: open
title: _json crash on scanner/encoder initialization error
Added file: http://bugs.python.org/file14964/_json_encoder_init.patch

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



[issue6986] _json crash on scanner/encoder initialization error

2009-09-24 Thread STINNER Victor

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


Added file: http://bugs.python.org/file14965/_json_scanner_init.patch

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



[issue6986] _json crash on scanner/encoder initialization error

2009-09-24 Thread STINNER Victor

STINNER Victor victor.stin...@haypocalc.com added the comment:

About _json_encoder_init.patch, an alternative patch is to write
arguments references (addresses) in local variables, and only copy them
on success. Something like:
  PyObject *arg;
  if (!PyTuple_ParseArgs(..., arg)) return NULL;
  Py_INCREF(arg);
  self-arg = arg;

I prefered to write a shorter patch.

Tell me if you prefer the alternative fix, and if you would like unit tests.

--

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



[issue6985] range() fails with long integers

2009-09-24 Thread Mark Dickinson

Mark Dickinson dicki...@gmail.com added the comment:

Might it make more sense for this range call to return a MemoryError
rather than an OverflowError, on 64-bit machines?

--

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



[issue6985] range() fails with long integers

2009-09-24 Thread Mark Dickinson

Mark Dickinson dicki...@gmail.com added the comment:

Mark]
 I *think* range uses long internally

Aargh!  Sorry, Eric.  I take it back.  *xrange* uses longs internally
(and used to use ints once upon a time, IIRC), but there's a weird mix
of int and long in builtin_range that doesn't make any sense to me.  I
suspect it's historical, and may have to do both with the xrange
int-long switch and the int - Py_ssize_t switch.

--

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



[issue6987] Idle not start

2009-09-24 Thread dorina

New submission from dorina dorina_n2...@yahoo.com:

Hello!
I installed Python31 on WinXp,but IDLE doesn't start. I tried at 
command prompt 
python Lib\idlelib\idle.py
the result is in attachement.
please help...
thanks.

--
components: IDLE
files: err1.JPG
messages: 93072
nosy: dorina_n2005
severity: normal
status: open
title: Idle not start
versions: Python 3.1
Added file: http://bugs.python.org/file14966/err1.JPG

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



[issue6987] Idle not start

2009-09-24 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc amaur...@gmail.com added the comment:

This is a duplicate of issue5528.
The fix is to remove the TCL_LIBRARY environment variable.

--
nosy: +amaury.forgeotdarc
resolution:  - duplicate
status: open - closed
superseder:  - Unable to launch IDLE on Windows

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



[issue6988] shlex.split() converts unicode input to UCS-4 output with varying byte order

2009-09-24 Thread Bill Fenner

New submission from Bill Fenner fen...@gmail.com:

In python 2.5, shlex handled unicode input fine:

Python 2.5.1 (r251:54863, Jun 15 2008, 18:24:51) 
[GCC 4.3.0 20080428 (Red Hat 4.3.0-8)] on linux2
Type help, copyright, credits or license for more information.
 import shlex
 shlex.split( u'Hello, World!' )
['Hello,', 'World!']

In python 2.6, shlex turns unicode input into UCS-4 output, thus utterly
confusing execl:

Python 2.6 (r26:66714, Jun  8 2009, 16:07:29)
[GCC 4.4.0 20090506 (Red Hat 4.4.0-4)] on linux2
Type help, copyright, credits or license for more information.
 import shlex
 shlex.split( u'Hello, World' )
['H\x00\x00\x00e\x00\x00\x00l\x00\x00\x00l\x00\x00\x00o\x00\x00\x00,\x00\x00\x00',
'\x00\x00\x00W\x00\x00\x00o\x00\x00\x00r\x00\x00\x00l\x00\x00\x00d\x00\x00\x00']

Even weirder, the two return strings have different byte order (see
'H\x00\x00\x00' vs. '\x00\x00\x00W'!)

--
components: Library (Lib)
messages: 93074
nosy: fenner
severity: normal
status: open
title: shlex.split() converts unicode input to UCS-4 output with varying byte 
order
versions: Python 2.6

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



[issue6988] shlex.split() converts unicode input to UCS-4 output with varying byte order

2009-09-24 Thread Bill Fenner

Bill Fenner fen...@gmail.com added the comment:

A colleague pointed out that the bad behavior was introduced in 2.5.2:

Python 2.5.2 (r252:60911, Sep 30 2008, 15:42:03) 
[GCC 4.3.2 20080917 (Red Hat 4.3.2-4)] on linux2
Type help, copyright, credits or license for more information.
 import shlex
 shlex.split( uHello, World! )
['H\x00\x00\x00e\x00\x00\x00l\x00\x00\x00l\x00\x00\x00o\x00\x00\x00,\x00\x00\x00',
'\x00\x00\x00W\x00\x00\x00o\x00\x00\x00r\x00\x00\x00l\x00\x00\x00d\x00\x00\x00!\x00\x00\x00']

--
versions: +Python 2.5

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



[issue6986] _json crash on scanner/encoder initialization error

2009-09-24 Thread Benjamin Peterson

Changes by Benjamin Peterson benja...@python.org:


--
assignee:  - bob.ippolito
nosy: +bob.ippolito

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



[issue6983] Add specific get_platform() for freebsd

2009-09-24 Thread Stef Walter

Stef Walter s...@memberwebs.com added the comment:

I agree with your comments, and the solution you're proposing solves the 
problem (and several others) for the long term. 

However in the short term, could this patch be committed? Most other OS's 
(including openbsd and netbsd) have OS specific code in get_platform(). 
FreeBSD is notably missing from that function. 

Obviously this would not preclude work on a better all encompassing 
solution.

--

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



[issue6986] _json crash on scanner/encoder initialization error

2009-09-24 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

Unit tests are definitely desireable!
I would also like the alternate approach fix, it would probably be
cleaner.

--
nosy: +pitrou

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



[issue6983] Add specific get_platform() for freebsd

2009-09-24 Thread Marc-Andre Lemburg

Marc-Andre Lemburg m...@egenix.com added the comment:

Stef Walter wrote:
 
 Stef Walter s...@memberwebs.com added the comment:
 
 I agree with your comments, and the solution you're proposing solves the 
 problem (and several others) for the long term. 
 
 However in the short term, could this patch be committed? Most other OS's 
 (including openbsd and netbsd) have OS specific code in get_platform(). 
 FreeBSD is notably missing from that function. 

The code in get_platform() tries to gather as much information as
possible regarding a platform, rather than limiting the amount of
information.

That's why there are so many entries for the various OSes.

Please contact the maintainer of easy_install to get it fixed
to handle the specific FreeBSD case. For other systems they will
likely have to apply similar patches, e.g. for Mac OS X, Sun,
AIX, etc. - all of these include version and release information
in the get_platform() output.

Regarding a short term fix, there's no a lot we can do: the next
Python release is 2.7 and changing this for 2.6 is out of the question,
since it would break other tools that rely on the established
naming scheme.

easy_install has a different release cycle, so it's easier
to get a fix for it, or just apply one yourself.

--

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



[issue6988] shlex.split() converts unicode input to UCS-4 output with varying byte order

2009-09-24 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc amaur...@gmail.com added the comment:

I'll take the opposite point of view:
the bad behavior was introduced with 2.5.1 (issue1548891, r52302), and
reverted for 2.5.2 because it broke backwards compatibility with
arbitrary read buffers (issue1730114, r53831)

The difference is in cStringIO:

 from cStringIO import StringIO
 StringIO(uHello, World!).read()
'H\x00\x00\x00e\x00\x00\x00l\x00\x00\x00l\x00\x00\x00o\x00\x00\x00,\x00\x00\x00
\x00\x00\x00W\x00\x00\x00o\x00\x00\x00r\x00\x00\x00l\x00\x00\x00d\x00\x00\x00!\x00\x00\x00'

The byte order is not different in the two strings: but u  becomes 
 \x00\x00\x00 and the three zeros are copied into the second item.

--
nosy: +amaury.forgeotdarc
resolution:  - wont fix
status: open - pending

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



[issue6988] shlex.split() converts unicode input to UCS-4 output with varying byte order

2009-09-24 Thread Bill Fenner

Bill Fenner fen...@gmail.com added the comment:

so, just to be clear, your position is that the output of shlex.split(
u'Hello, World!' ) is *supposed* to be
['H\x00\x00\x00e\x00\x00\x00l\x00\x00\x00l\x00\x00\x00o\x00\x00\x00,\x00\x00\x00',
'\x00\x00\x00W\x00\x00\x00o\x00\x00\x00r\x00\x00\x00l\x00\x00\x00d\x00\x00\x00']?

--
status: pending - open

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



[issue6983] Add specific get_platform() for freebsd

2009-09-24 Thread Stef Walter

Stef Walter s...@memberwebs.com added the comment:

Other OSs have special cases in get_platform() to specifically limit the 
amount of code, and make proper decisions with regard to package 
compatibility. 

Here's an example this commit for Mac OS X: http://svn.python.org/view?
view=revrevision=67988

It was discussed here at this issue: http://bugs.python.org/issue4064

Another example is how linux has no version information at all (ie: 
linux-i586). Perhaps this is why the easy_install authors thought their 
package system worked. They only tested it on linux?

Yes I agree that obviously this cannot be changed for 2.6. But it would 
be great to get this code in for python 2.7

Anyway, this is ultimately your call, since I don't have the 50,000 foot 
view over the entire situation. 

FWIW, I've had to patch python in a very large set of client 
installations. This patch has become a routine in order to unbreak 
python wrt to platform dependent packages.

--

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



[issue6988] shlex.split() converts unicode input to UCS-4 output with varying byte order

2009-09-24 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

Hm, while the StringIO behaviour supposedly cannot be changed for
backwards-compatibility reasons, we can probably improve shlex behaviour
with unicode strings.

--
nosy: +pitrou

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



[issue6988] shlex.split() converts unicode input to UCS-4 output with varying byte order

2009-09-24 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc amaur...@gmail.com added the comment:

(Presented this way, my opinion becomes difficult to stand...
OTOH the docs say that the module does not support Unicode, so it's not
strictly a bug)
http://docs.python.org/library/shlex.html

Yes, shlex could be improved and encode unicode strings to ascii.

--
resolution: wont fix - 

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



[issue6988] shlex.split() converts unicode input to UCS-4 output with varying byte order

2009-09-24 Thread Marc-Andre Lemburg

Marc-Andre Lemburg m...@egenix.com added the comment:

Amaury Forgeot d'Arc wrote:
 
 Amaury Forgeot d'Arc amaur...@gmail.com added the comment:
 
 (Presented this way, my opinion becomes difficult to stand...
 OTOH the docs say that the module does not support Unicode, so it's not
 strictly a bug)
 http://docs.python.org/library/shlex.html
 
 Yes, shlex could be improved and encode unicode strings to ascii.

I'd suggest to convert Unicode input to a string using an
optional encoding parameter which defaults to 'utf-8' (most
shells nowadays default to UTF-8).

This is only a compromise, though, albeit a practical one.
POSIX has the notion of a portable character set:

http://www.opengroup.org/onlinepubs/95399/basedefs/xbd_chap06.html#tagtcjh_3

which is pretty much the same as ASCII. Any ASCII compatible
encoding is then allowed via variable length encodings (see
further down on that page).

--
nosy: +lemburg
title: shlex.split() converts unicode input to UCS-4 output with varying byte 
order - shlex.split() converts unicode input to UCS-4 output with
varying byte order

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



[issue6988] shlex.split() converts unicode input to UCS-4 output

2009-09-24 Thread Bill Fenner

Bill Fenner fen...@gmail.com added the comment:

Sorry, I didn't read the web documentation, only the module
documentation, which doesn't mention Unicode.  I'd agree that since it's
a documented behavior, this bug can become:

- an RFE for shlex to handle Unicode
- meanwhile, if there will be any releases before that happens, an RFE
for the module documentation to mention the lack of Unicode support

--
title: shlex.split() converts unicode input to UCS-4 output withvarying 
byte order - shlex.split() converts unicode input to UCS-4 output

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



[issue4947] sys.stdout fails to use default encoding as advertised

2009-09-24 Thread Sridhar Ratnakumar

Changes by Sridhar Ratnakumar sridh...@activestate.com:


--
nosy: +srid

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



[issue6983] Add specific get_platform() for freebsd

2009-09-24 Thread Marc-Andre Lemburg

Marc-Andre Lemburg m...@egenix.com added the comment:

Stef Walter wrote:
 Other OSs have special cases in get_platform() to specifically limit the 
 amount of code, and make proper decisions with regard to package 
 compatibility. 

 Here's an example this commit for Mac OS X: http://svn.python.org/view?
 view=revrevision=67988
 
 It was discussed here at this issue: http://bugs.python.org/issue4064

Well, if you try to install .egg files built as universal binaries
on a system that uses a non-SDK build of Python on a PPC system,
you'll have a similar problem.

easy_install will look for '...-ppc', but the file is name '...-fat'.

But you do have a point: the '10.4' is actually an indicator for
the SDK version, not the version of the OS where the package
was built.

 Another example is how linux has no version information at all (ie: 
 linux-i586).

Right... the Linux major version doesn't change that often,
while the minor ones do change very often and don't really
give the user any useful information w/r to Python extensions.

As a result, using Linux-2.6.22.19-0.4-default in the name
would cause more user concern than necessary.

 Perhaps this is why the easy_install authors thought their 
 package system worked. They only tested it on linux?

Probably. Most .eggs are Python-only, so they don't even need a
platform string. The others are mostly for Windows.

 Yes I agree that obviously this cannot be changed for 2.6. But it would 
 be great to get this code in for python 2.7
 
 Anyway, this is ultimately your call, since I don't have the 50,000 foot 
 view over the entire situation. 

Is that binary compatibility scheme documented somewhere ?

If so, we could switch to '%s-%s' % (sys.platform, machine)
for Python 2.7.

 FWIW, I've had to patch python in a very large set of client 
 installations. This patch has become a routine in order to unbreak 
 python wrt to platform dependent packages.

Since this only affects easy_install/setuptools, it's probably
easier to just create a patched egg for that and then use it
with the normal Python installation.

--

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



[issue6970] Redundant calls made to comparison methods.

2009-09-24 Thread Mark Dickinson

Mark Dickinson dicki...@gmail.com added the comment:

Here's a patch for py3k.  I'd appreciate it if some other committer could 
check it for sanity.

--
keywords: +patch
Added file: http://bugs.python.org/file14967/issue6970.patch

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



[issue6970] Redundant calls made to comparison methods.

2009-09-24 Thread Mark Dickinson

Changes by Mark Dickinson dicki...@gmail.com:


--
keywords: +needs review -patch
stage: needs patch - commit review

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



[issue6989] Python-2.6.2

2009-09-24 Thread Ashish

New submission from Ashish pimp...@gmail.com:

I am getting error while compiling python-2.6.2
OS - Solaris 10 8/07 s10s_u4wos_12b SPARC
bash-3.00$ isainfo -v
64-bit sparcv9 applications
asi_blk_init
32-bit sparc applications
asi_blk_init v8plus div32 mul32
Paths and defined
PATH=/usr/local/bin:/opt/sfw/bin:/opt/sfw/sbin:/usr/sfw/bin:/usr/sfw/sbin:/opt/SUNWspci/bin:/usr/ccs/bin:/usr/bin:$PATH
export LD_LIBRARY_PATH=/usr/lib/sparcv9:/usr/local/lib/sparcv9
export LDFLAGS=-mcpu=v9 -m64
export LDDFLAGS=-mcpu=v9 -m64 -G
export CC=gcc -mcpu=v9 -m64 -D_LARGEFILE64_SOURCE=1

Configure seems to be runs fine. ( Attched File for configure )
 sudo ./configure --with-universal-archs=64 bit
--prefix=/opt/Python-2.6.2/

But getting error after running make
bash-3.00$ sudo make
\gcc -mcpu=v9 -m64 -D_LARGEFILE64_SOURCE=1 -c -fno-strict-aliasing
-DNDEBUG -g  -O3 -Wall -Wstrict-prototypes  -I. -IInclude -I./Include 
-DPy_BUILD_CORE -o Objects/floatobject.o Objects/floatobject.c
/var/tmp//ccBDYDRE.s: Assembler messages:
/var/tmp//ccBDYDRE.s:7339: Error: Illegal operands: There are only 32
single precision f registers; [0-31]
*** Error code 1
make: Fatal error: Command failed for target `Objects/floatobject.o'

Please advice.

--
components: Installation
files: Configure.txt
messages: 93088
nosy: ashish
severity: normal
status: open
title: Python-2.6.2
type: compile error
versions: Python 2.6
Added file: http://bugs.python.org/file14968/Configure.txt

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



[issue6982] make clean does not remove pickle files

2009-09-24 Thread Mark Dickinson

Mark Dickinson dicki...@gmail.com added the comment:

Committed in r75047 (trunk).  Merged in r75048 (release26-maint), r75049 
(py3k) and r75050 (release31-maint).

--
assignee:  - mark.dickinson
stage: patch review - committed/rejected
status: open - closed

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



[issue6989] Python-2.6.2

2009-09-24 Thread Mark Dickinson

Mark Dickinson dicki...@gmail.com added the comment:

If you do a Google search for that particular error message ('There are 
only 32 single ...'), the results suggest that this is a known problem 
with gcc and/or gas on Solaris.

Does removing the -O3 optimization flag make any difference?  (Try 
removing all occurrences of -O3 from the configure file before 
configuring.)

In any case, I suspect this is something Python can't do much about.

--
nosy: +mark.dickinson
resolution:  - works for me
status: open - pending

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



[issue1766304] improve xrange.__contains__

2009-09-24 Thread Mark Dickinson

Mark Dickinson dicki...@gmail.com added the comment:

Just to be on the safe side, I changed the PyLong_Check(ob) check to 
PyLong_CheckExact(ob) || PyBool_Check(ob), in r75051.  Without this, one 
can get different results for 'x in range(10)' and 'x in list(range(10))' 
if x is an instance of a subclass of int:

Python 3.2a0 (py3k:75050, Sep 24 2009, 20:56:13) 
[GCC 4.2.1 (Apple Inc. build 5646)] on darwin
Type help, copyright, credits or license for more information.
 class C(int):
... def __eq__(self, other): return True
... 
 C(11) in range(10)
False
 C(11) in list(range(10))
True

--

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



[issue1766304] improve xrange.__contains__

2009-09-24 Thread Mark Dickinson

Mark Dickinson dicki...@gmail.com added the comment:

Unassigning myself since I don't intend to do anything myself about 
xrange.__contains__ in 2.x.  (But I'll happily review patches.)

--

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



[issue1766304] improve xrange.__contains__

2009-09-24 Thread Mark Dickinson

Changes by Mark Dickinson dicki...@gmail.com:


--
assignee: mark.dickinson - 

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



[issue6872] Support system readline on OS X 10.6

2009-09-24 Thread Mark Dickinson

Mark Dickinson dicki...@gmail.com added the comment:

Thanks for working on this, Ronald.

--

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



[issue6983] Add specific get_platform() for freebsd

2009-09-24 Thread Stef Walter

Stef Walter s...@memberwebs.com added the comment:

Marc-Andre Lemburg wrote:
 Is that binary compatibility scheme documented somewhere ?

Not sure, it's been referred to and adhered to many times in the FreeBSD
community, but I'm not sure where it's documented. I'll ask around on
the FreeBSD mailing lists and post my findings here.

FWIW, the freebsd kernel and package system have options specifically
for compatibility with previous major versions. ie: FreeBSD 8 has
COMPAT_FREEBSD7 and COMPAT_FREEBSD6 kernel options, and has
misc/compat7x and misc/compat6x libraries available for install. But
again, I'll let you know for sure.

 FWIW, I've had to patch python in a very large set of client 
 installations. This patch has become a routine in order to unbreak 
 python wrt to platform dependent packages.
 
 Since this only affects easy_install/setuptools, it's probably
 easier to just create a patched egg for that and then use it
 with the normal Python installation.

True, I could give that a shot.

--

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



[issue6985] range() fails with long integers

2009-09-24 Thread Brett Cannon

Brett Cannon br...@python.org added the comment:

Both range and xrange were mucked with so much just before and during py3k 
development that I am sure odd inconsistencies of what they use internally 
are oversights.

--
nosy: +brett.cannon

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



[issue6989] Python-2.6.2

2009-09-24 Thread Ashish

Ashish pimp...@gmail.com added the comment:

I added vaiable as 
export CXX=gcc -q64
then run 
sudo ./configure --with-universal-archs=64 bit --prefix=/opt/Python-2.6.2/
After completion of configure I removed O3 from makefile,
then run
sudo make
It seems to be run fine.
But after make install i get error as 
Compiling /opt/Python-2.6.2//lib/python2.6/xml/sax/expatreader.py ...
Compiling /opt/Python-2.6.2//lib/python2.6/xml/sax/handler.py ...
Compiling /opt/Python-2.6.2//lib/python2.6/xml/sax/saxutils.py ...
Compiling /opt/Python-2.6.2//lib/python2.6/xml/sax/xmlreader.py ...
Compiling /opt/Python-2.6.2//lib/python2.6/xmllib.py ...
Compiling /opt/Python-2.6.2//lib/python2.6/xmlrpclib.py ...
Compiling /opt/Python-2.6.2//lib/python2.6/zipfile.py ...
*** Error code 1
make: Fatal error: Command failed for target `libinstall'


I need to change variable with 
export LD_LIBRARY_PATH=L/usr/lib/sparcv9:/usr/local/lib/sparcv9
R/opt/Python-2.6.2/lib
Please suggest.
Thanks for cooperation and guideline.
I feel we are near to resolve the issue.

--
status: pending - open

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



[issue6983] Add specific get_platform() for freebsd

2009-09-24 Thread Stef Walter

Stef Walter s...@memberwebs.com added the comment:

About FreeBSD ABI compatibility between minor versions:

Julian Elischer wrote:
 It is a policy of the project but I don't think our policies are 
 written down as such. I think you will find it referenced in
 many places in a sideways manner rather than directly.

http://docs.freebsd.org/cgi/getmsg.cgi?fetch=141507+0+current/freebsd-
hackers

--

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



[issue6989] Compile error for Python-2.6.2 on Solaris

2009-09-24 Thread Raymond Hettinger

Changes by Raymond Hettinger rhettin...@users.sourceforge.net:


--
title: Python-2.6.2 - Compile error  for Python-2.6.2 on Solaris

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



[issue6722] collections.namedtuple: confusing example

2009-09-24 Thread Raymond Hettinger

Changes by Raymond Hettinger rhettin...@users.sourceforge.net:


--
priority:  - low

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



[issue6606] csv.Sniffer.sniff on data with doublequotes doesn't set up the dialect properly

2009-09-24 Thread Raymond Hettinger

Changes by Raymond Hettinger rhettin...@users.sourceforge.net:


--
assignee:  - skip.montanaro
nosy: +skip.montanaro

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



[issue6454] Add example keyword argument to optparse constructor

2009-09-24 Thread Raymond Hettinger

Raymond Hettinger rhettin...@users.sourceforge.net added the comment:

This seems like a reasonable request.

--
assignee:  - rhettinger
nosy: +rhettinger

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



[issue6990] threading.local subclasses don't cleanup their state and it gets recycled

2009-09-24 Thread Philip Jenvey

New submission from Philip Jenvey pjen...@users.sourceforge.net:

When threading.local subclasses are cleared during a reference cycle the 
local's internal key is nulled before the local is deallocated. That's a 
problem because local only deletes its state (ldicts) from threads 
during deallocation, and doesn't do so at all when its key is null.

So leaving ldicts around is one thing, but what's worse is they can be 
recycled by new local objects later -- since ldicts are mapped to 
threadstates by said key, and said key is based on the local's pointer. 
If a new local is malloced at the old one's address it can end up with 
the original's ldicts (depending on which thread it's allocated from).

Attached is a test against trunk showing this. Should we delete the 
ldicts during clear, recreate the key during dealloc, or something else?

--
components: Interpreter Core
files: derived_local_cycle_dealloc.diff
keywords: patch
messages: 93099
nosy: amaury.forgeotdarc, pjenvey
severity: normal
status: open
title: threading.local subclasses don't cleanup their state and it gets recycled
type: security
versions: Python 2.4, Python 2.5, Python 2.6, Python 2.7, Python 3.0, Python 
3.1, Python 3.2
Added file: http://bugs.python.org/file14969/derived_local_cycle_dealloc.diff

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



[issue6990] threading.local subclasses don't cleanup their state and it gets recycled

2009-09-24 Thread Ben Bangert

Changes by Ben Bangert b...@groovie.org:


--
nosy: +bbangert

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



[issue5380] pty.read raises IOError when slave pty device is closed

2009-09-24 Thread Arfrever Frehtes Taifersar Arahesis

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


--
nosy: +Arfrever

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



[issue6991] logging encoding failes some situation

2009-09-24 Thread Naoki INADA

New submission from Naoki INADA songofaca...@gmail.com:

When stream is codecs.writer object, stream.write(string) does
string.decode() internally and it may cause UnicodeDecodeError.

Then, fallback to utf-8 is not good.
I think good fallback logic is:
* When message is unicode, message.encode(stream.encoding or 'ascii',
'backslashreplace')
* When message is bytes, message.encode('string_escape')

Attached patch contains this logic, refactoring and test.

--
components: Library (Lib)
files: logging_encode.patch
keywords: patch
messages: 93100
nosy: naoki
severity: normal
status: open
title: logging encoding failes some situation
versions: Python 2.6, Python 2.7
Added file: http://bugs.python.org/file14970/logging_encode.patch

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



[issue6988] shlex.split() converts unicode input to UCS-4 output

2009-09-24 Thread Ezio Melotti

Changes by Ezio Melotti ezio.melo...@gmail.com:


--
nosy: +ezio.melotti
priority:  - normal

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



[issue6991] logging encoding failes some situation

2009-09-24 Thread Naoki INADA

Changes by Naoki INADA songofaca...@gmail.com:


--
versions: +Python 3.0, Python 3.1, Python 3.2

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



[issue5127] UnicodeEncodeError - I can't even see license

2009-09-24 Thread Ezio Melotti

Changes by Ezio Melotti ezio.melo...@gmail.com:


--
priority:  - normal
stage:  - patch review

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