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

2009-07-28 Thread Chris Rebert

Changes by Chris Rebert :


--
nosy: +cvrebert

___
Python tracker 

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



[issue6590] Py3K can't set the browser's character encoding! (CGI)

2009-07-28 Thread Hakan

New submission from Hakan :

Hi,
I'm new to web programming with Python.
In Python2k, the special "# -*- coding: cp1254 -*-" code sets the
character encoding. It works in the internet browsers too and sets the
browser's character encoding. That was really good. But in Py3k, that
special comment doesn't work. Usually, the encoding is UTF-8 in my
browser. That time, non-ascii Turkish characters seems strange symbols.
The locale.setlocale method doesn't work too. The users must manualy set
the encoding from UTF-8 to Turkish(Windows-1254) or Turkish(ISO-8859-9).
Is there anyway to set browser's encoding with Python 3.1? 
I use IIS7 and Windows 7 x64.
BTW, the ASP don't identify Python. But I can use .py files. So, I did
these thing in CGI/.py

--
components: Unicode
messages: 91003
nosy: [PhysiC]
severity: normal
status: open
title: Py3K can't set the browser's character encoding! (CGI)
type: feature request
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



[issue6591] add reference to fcntl.ioctl in the socket module

2009-07-28 Thread Gabriel Genellina

New submission from Gabriel Genellina :

socket.ioctl says it is Windows specific, and people may think there 
is no way to use ioctl with sockets in non-Windows platforms (see 
http://groups.google.com/group/comp.lang.python/browse_thread/
thread/246f4522ad215d74 )
This doc patch adds a reference to the fcntl.fcntl and fcntl.ioctl 
functions so people is aware of them.

--
assignee: georg.brandl
components: Documentation
files: socket.diff
keywords: patch
messages: 91004
nosy: gagenellina, georg.brandl
severity: normal
status: open
title: add reference to fcntl.ioctl in the socket module
type: feature request
versions: Python 2.7, Python 3.2
Added file: http://bugs.python.org/file14583/socket.diff

___
Python tracker 

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



[issue5808] Subprocess.getstatusoutput Fails Executing 'dir' Command on Windows

2009-07-28 Thread sorin

sorin  added the comment:

Also the same issue does apply for command.getstatusoutput in Python 2.6.

Maybe this bug should be reopened and solved by adding a platform check
in the module. Also the documentation does not specify what would be the
right multiplatform alternative.

Anyway, the current result it's clearly not the expected behavior and
does not give any hint regarding the source of the problem or possible
solutions.

--
nosy: +sorin
type:  -> behavior

___
Python tracker 

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



[issue6592] otparse: processing variable number of short option arguments

2009-07-28 Thread tanvalley

Changes by tanvalley :


--
components: Library (Lib)
files: optparse-feature
nosy: tanvalley
severity: normal
status: open
title: otparse: processing variable number of short option arguments
type: feature request
versions: Python 2.5
Added file: http://bugs.python.org/file14584/optparse-feature

___
Python tracker 

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



[issue6590] Py3K can't set the browser's character encoding! (CGI)

2009-07-28 Thread Ezio Melotti

Ezio Melotti  added the comment:

This looks more like a general question than a bug report. You should
probably ask on comp.lang.python or #pyt...@irc.freenode.net.

The "# -*- coding: cp1254 -*-" only specifies the encoding used to save
the source file and it's not related to the encoding used when the data
are printed or sent over the network. This should be the same for both
Py2 and Py3.
The browser determines the encoding reading it from the HTTP headers,
from the content-type in the HTML  tag or from the XML
declaration. If none of these are available it tries to determine it
from the content of the file. You should probably specify the encoding
in the headers and encode the data you send accordingly.

Closing as invalid.

--
nosy: +ezio.melotti
resolution:  -> invalid
stage:  -> committed/rejected
status: open -> closed

___
Python tracker 

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



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

2009-07-28 Thread Ezio Melotti

Changes by Ezio Melotti :


--
nosy: +ezio.melotti

___
Python tracker 

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



[issue6236] os.popen causes illegal seek on AIX in Python 3.1rc

2009-07-28 Thread nestor

nestor  added the comment:

Python 3.1 (r31:73572, Jul  9 2009, 16:28:28) [C] on aix5
Type "help", "copyright", "credits" or "license" for more information.
>>>
>>> import sys
>>> sys.stdout.seekable()
True
>>>

I can access the machine only through ssh.

--

___
Python tracker 

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



[issue6548] cmath documentation misleading: suggests existence of real() and imag() functions

2009-07-28 Thread Mark Dickinson

Mark Dickinson  added the comment:

Thanks, Georg!

Committed, r74230 (trunk), r74231 (release26-maint), r74232 (py3k), r74233 
(release31-maint).  The latter three revisions include the merge of r74184 
from trunk.

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

___
Python tracker 

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



[issue6590] Py3K can't set the browser's character encoding! (CGI)

2009-07-28 Thread Hakan

Hakan  added the comment:

Thanks for your reply. I said, I'm new to web programming.
Now I add Content-type: text/html; charset=ISO-8859-9...
:)

--

___
Python tracker 

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



[issue6593] Documentation: gettext install link

2009-07-28 Thread Egon Frerich

New submission from Egon Frerich :

The description of gettext.install in 23.1.2 (Class-based API) contains
two links to install() which should go to this function in "The
NullTranslations class" 23.1.2.1 but they don't.

--
assignee: georg.brandl
components: Documentation
messages: 91010
nosy: efrerich, georg.brandl
severity: normal
status: open
title: Documentation: gettext install link

___
Python tracker 

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



[issue5808] Subprocess.getstatusoutput Fails Executing 'dir' Command on Windows

2009-07-28 Thread Senthil

Senthil  added the comment:

sorin:

You meant the commands module, correct?
It is well documented in the commands reference:
http://docs.python.org/library/commands.html

* It is applicable to unix only.
* the getstatusoutput is moved to subprocess in 3x.

--
nosy: +orsenthil

___
Python tracker 

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



[issue6561] Regex '\d' should not match unicode category 'No'.

2009-07-28 Thread Mark Dickinson

Mark Dickinson  added the comment:

[ezio.melotti]
> I suggest something like:
> Matches the decimal digits ``[0-9]`` and all the characters that belong
> to the Unicode category Nd (Number, Decimal Digit).

Hmm.  I don't like this because it suggests (to me) that the characters 
[0-9] don't belong to category [Nd].  I agree the previous version was 
clunky, though.  I've shortened it some;  if anyone else wants to work on 
the wording please feel free.  It might be nice to annotate each of these 
character classes (\w, \s) with the Unicode character categories that they 
correspond to.

> Two more minor details: instead of '\d', I'd use '^\d$' and instead of
> self.assertEqual(re.match('\d', x), None)
> self.assertIsNone(re.match('\d', x)).

Thanks.  Changes applied.

Committed to py3k, r74237.   Leaving open for backport to trunk.

--
stage: patch review -> committed/rejected
versions:  -Python 3.2

___
Python tracker 

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



[issue5808] Subprocess.getstatusoutput Fails Executing 'dir' Command on Windows

2009-07-28 Thread sorin

sorin  added the comment:

If I made a patch that will raise an error if you include commands
module under Windows will you include it - this will safe others time.

--

___
Python tracker 

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



[issue6550] asyncore incorrect failure when connection is refused and using async_chat channel

2009-07-28 Thread Nir Soffer

Nir Soffer  added the comment:

I have a big problem with asyncore_fix_refused.patch  - it assumes that a 
dispatcher has a socket attribute, which can be used with t getsockopt(). 
This is true in the default dispatcher class implemented in asyncore, but 
wont work with file_dispatcher, or 3rd party dispatcher class.

The framework should let you drop in your dispatcher class, that will 
implement a minimal interface - handle_x_event, writable, readable etc.

What are the issues on Windows with asyncore-handle-connect-event-3.patch 
on Windows?

--

___
Python tracker 

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



[issue6594] json C serializer performance tied to structure depth on some systems

2009-07-28 Thread Shawn

New submission from Shawn :

The json serializer's performance (when using the C speedups) appears to
be tied to the depth of the structure being serialized on some systems.
 In particular, dict structure that are more than a few levels deep,
especially when they content mixed values (lists, strings, and other
dicts) causes severe serialization penalties (in the neighborhood of an
extra 20-30 seconds) on some systems.

On SPARC systems, this is very likely because of the recursive call
structure that the C speedups serializer uses which doesn't work well
with SPARC due to register windows.

On x86 systems, recursive call structures are cheap, so this doesn't
appear to be an issue there.

SPARC systems with higher amounts of memory bandwidth don't suffer as
badly from this (such as Niagra T1000, T2000, etc. systems), but older
UltraSparc systems are especially prone to performance issues.

--
components: Library (Lib)
messages: 91015
nosy: swalker
severity: normal
status: open
title: json C serializer performance tied to structure depth on some systems
type: performance
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



[issue6550] asyncore incorrect failure when connection is refused and using async_chat channel

2009-07-28 Thread Josiah Carlson

Josiah Carlson  added the comment:

Firstly, it expects that handle_expt_event() is for handling exceptional 
conditions.  This is not the case.  handle_expt_event() is meant for 
handling "OOB" or "priority" data coming across a socket.  FTP and some 
other protocols use this.  I forgot to fix it earlier, which is why it's 
making it into this patch.

Secondly, I pulled the part that was inside handle_expt_event() that was 
being used to find the exception and pulls it out into _exception(), 
removing the previous behavior (wrt to the broken API), and replacing it 
with something that is cleaner and more correct (assuming sockets).

To respond to it being an issue that the object has a socket with a 
getsockopt(), I can fix it to handle the AttributeError case.

Would you be willing to try this out given my explanation as to why I 
changed your patch?

--
Added file: http://bugs.python.org/file14585/asyncore_fix_refused-2.patch

___
Python tracker 

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



[issue6594] json C serializer performance tied to structure depth on some systems

2009-07-28 Thread Brett Cannon

Changes by Brett Cannon :


--
priority:  -> low

___
Python tracker 

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



[issue5993] python produces zombie in webbrowser.open

2009-07-28 Thread Eivind Tagseth

Eivind Tagseth  added the comment:

The problem seems to be that there are no way to wait() for browser
processes that have died, and there is no mention of needing to wait()
in the documentation.

In my case, webbrowser finds my gnome-setting for the http-url handler
and sets up [ "firefox", "%s" ] as a BackgroundBrowser named 'gnome'.

BackgroundBrowser.open() creates a Popen object and calls p.poll().  The
Popened firefox process finds my existing firefox process, and asks it
to open the url, then terminates.  It doesn't act quickly enough to
terminate before p.poll() is called though, and I end up with a zombie
firefox process, that keeps me from ending firefox unless I also kill my
python process.

If this is how this is intended to work, there should at least be a
section in the documentation warning users to call os.waitX() themselves
to avoid zombie processes.

--
nosy: +eivindt

___
Python tracker 

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



[issue6561] Regex '\d' should not match unicode category 'No'.

2009-07-28 Thread Mark Dickinson

Mark Dickinson  added the comment:

Backported to trunk in r74240.

--
status: open -> closed

___
Python tracker 

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



[issue6511] zipfile: Invalid argument when opening zero-sized files

2009-07-28 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc  added the comment:

Fixed in r74245. Thanks for the report!

--
nosy: +amaury.forgeotdarc
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



[issue1811] True division of integers could be more accurate

2009-07-28 Thread Mark Dickinson

Mark Dickinson  added the comment:

An example of a case that's almost 3.5 ulps out (Python 2.6):

Python 2.6.2 (r262:71600, Jul  8 2009, 09:56:31) 
[GCC 4.0.1 (Apple Inc. build 5490)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from __future__ import division
>>> m = 295147931372582273023
>>> n = 295147932265116303360
>>> m/n
0.697597697

The correctly rounded result would be the float given by 
0.69759773.

--

___
Python tracker 

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



[issue6511] zipfile: Invalid argument when opening zero-sized files

2009-07-28 Thread Sridhar Ratnakumar

Sridhar Ratnakumar  added the comment:

Amaury, shouldn't this also be merged to the py3k branch? (I am not 
aware of any Python commit policies so just asking)

--

___
Python tracker 

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



[issue1466065] base64 module ignores non-alphabet characters

2009-07-28 Thread Neil Tallim

Neil Tallim  added the comment:

Attached a patch that modifies Modules/binascii.c to raise a TypeError
on any unrecognized base64 input, rather than failing silently. Also
includes unit tests.

Patch built against Python 2.7, r74246.

TypeError was preserved over ValueError, despite the lack of related
logic, for legacy purposes.

--
keywords: +patch
nosy: +Red HamsterX, ajaksu2
Added file: http://bugs.python.org/file14586/1466065[2.7].diff

___
Python tracker 

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



[issue1466065] base64 module ignores non-alphabet characters

2009-07-28 Thread Neil Tallim

Neil Tallim  added the comment:

Attached a patch that modifies Modules/binascii.c to raise a TypeError
on any unrecognized base64 input, rather than failing silently. Also
includes unit tests.

Patch built against Python 3.2, r74246.

TypeError was preserved over ValueError, despite the lack of related
logic, for legacy purposes.

--
Added file: http://bugs.python.org/file14587/1466065[3.2].diff

___
Python tracker 

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



[issue1466065] base64 module ignores non-alphabet characters

2009-07-28 Thread Neil Tallim

Neil Tallim  added the comment:

Attached a patch that modifies Lib/base64.py to raise a TypeError on any
unrecognized base64 input, rather than failing silently. Also includes
unit tests.

Patch built against Python 2.7, r74246.

--
Added file: http://bugs.python.org/file14588/1466065[2.7-pure-python].diff

___
Python tracker 

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



[issue1466065] base64 module ignores non-alphabet characters

2009-07-28 Thread Neil Tallim

Neil Tallim  added the comment:

Attached a patch that modifies Lib/base64.py to raise a TypeError on any
unrecognized base64 input, rather than continuing silently. Also
includes unit tests.

Patch built against Python 3.2, r74246.

Correction to previous text: base64 continues silently, discarding
unrecognized characters, rather than failing.

--
Added file: http://bugs.python.org/file14589/1466065[3.2-pure-python].diff

___
Python tracker 

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



[issue1512791] module wave does no rounding

2009-07-28 Thread Neil Tallim

Neil Tallim  added the comment:

Attached a patch with a unit test and solution for this problem.

Patch built against Python 2.7, r74246.

Note: It may make more sense to just have wave.setframerate() assert
that it is being fed an integer, and that's a simple fix that won't
require a test. However, that's not what was approved for testing, so
that's not what I wrote.

--
keywords: +patch
nosy: +Red HamsterX
type: feature request -> behavior
versions: +Python 3.2
Added file: http://bugs.python.org/file14590/1512791[2.7].diff

___
Python tracker 

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



[issue1512791] module wave does no rounding

2009-07-28 Thread Neil Tallim

Neil Tallim  added the comment:

Attached a patch with a unit test and solution for this problem.

Patch built against Python 3.2, r74246.

Note: with Python 3.2, an error was thrown if the input value wasn't an
integer because a deprecated struct-related cast was removed. It's
debatable whether we want to actually apply this patch, since the error
couldn't manifest in this version of Python. However, if we patch 2.7,
we might as well patch this to maintain consistency. (Patching 3.2 will
not break anything or make previously broken logic work differently, so
it is safe)

--
Added file: http://bugs.python.org/file14591/1512791[3.2].diff

___
Python tracker 

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



[issue2636] Regexp 2.7 (modifications to current re 2.2.2)

2009-07-28 Thread Matthew Barnett

Matthew Barnett  added the comment:

issue2636-20090729.zip contains regex.py, _regex.h, _regex.c which will
work with Python 2.5 as well as Python 2.6, and also 2 builds of
_regex.pyd (for Python 2.5 and Python 2.6 on Windows).

This version supports accessing the capture groups by subscripting the
match object, for example:

>>> m = regex.match("(?.)(?.)", "abc")
>>> len(m)
3
>>> m[0]
'ab'
>>> m[1 : 3]
['a', 'b']
>>> m["foo"]
'a'

--
Added file: http://bugs.python.org/file14592/issue2636-20090729.zip

___
Python tracker 

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



[issue6511] zipfile: Invalid argument when opening zero-sized files

2009-07-28 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc  added the comment:

Oh, this was done with r74246, I just forgot to mention it.
Anyway all changes in trunk are regularly merged into py3k.

--

___
Python tracker 

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