[issue5416] str.replace does strange things when given a negative count

2010-08-12 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

Thank you.  Please do the reversion and the docstring fixup.

--

___
Python tracker 

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



[issue9424] Disable unittest.TestCase.assertEquals and assert_ during a regrtest run

2010-08-12 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

Please don't pursue this further.  It does not matter at all whether developers 
use assertEqual or assertEquals.  That is no more than a stylistic preference.  
I do not want a commit hook, or for developer patches to be edited, or for 
there to be as assertEquals police squad. Please focus on something that is not 
superficial.

--

___
Python tracker 

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



[issue9574] complex does not parse strings containing decimals

2010-08-12 Thread Jervis Whitley

New submission from Jervis Whitley :

complex() raises ValueError when parsing a string argument containing both real 
and imaginary where one of the real or imaginary is a decimal.

To reproduce:

>>> complex("1.1 + 2.1j")
ValueError: complex() arg is a malformed string

>>> complex("2.1j")
2.1j

>>> complex("1.1 + 2j")
ValueError: complex() arg is a malformed string

>>> complex("1 + 2.1j")
ValueError: complex() arg is a malformed string 

Expected results:

>>> complex("1.1 + 2.1j")
(1.1 + 2.1j)

>>> complex("2.1j")
2.1j

>>> complex("1.1 + 2j")
(1.1 + 2j)

>>> complex("1 + 2.1j")
(1 + 2.1j)

This affects all versions up to Python 3.1.2. I haven't tested any of the 
development builds.

Tests were conducted on a Windows XP 32 bit machine.

--
components: Interpreter Core
messages: 113661
nosy: jdwhitley
priority: normal
severity: normal
status: open
title: complex does not parse strings containing decimals
type: behavior
versions: Python 2.5, Python 2.6, Python 2.7, Python 3.1

___
Python tracker 

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



[issue9291] mimetypes initialization fails on Windows because of non-Latin characters in registry

2010-08-12 Thread kai zhu

kai zhu  added the comment:

python 3.1.2 mimetypes initialization also fails in redhat linux:


>>> import http.server
Traceback (most recent call last):
  File 
"/home/public/i386-redhat-linux-gnu/python/lib/python3.1/http/server.py", line 
588, in 
class SimpleHTTPRequestHandler(BaseHTTPRequestHandler):
  File 
"/home/public/i386-redhat-linux-gnu/python/lib/python3.1/http/server.py", line 
764, in SimpleHTTPRequestHandler
mimetypes.init() # try to read system mime.types
  File "/home/public/i386-redhat-linux-gnu/python/lib/python3.1/mimetypes.py", 
line 305, in init
db.readfp(open(file))
  File "/home/public/i386-redhat-linux-gnu/python/lib/python3.1/mimetypes.py", 
line 209, in readfp
line = fp.readline()
  File 
"/home/public/i386-redhat-linux-gnu/bin/../python/lib/python3.1/encodings/ascii.py",
 line 26, in decode
return codecs.ascii_decode(input, self.errors)[0]
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc2 in position 3921: 
ordinal not in range(128)

--
nosy: +kaizhu

___
Python tracker 

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



[issue9522] xml.etree.ElementTree forgets the encoding

2010-08-12 Thread Mark Summerfield

Mark Summerfield  added the comment:

Perhaps a useful compromise would be to add an "encoding" attribute that is set 
to the encoding of the XML file that's read in (and with a default of "ascii").

That way it would be possible to preserve the encoding, e.g.:

import xml.etree.ElementTree as etree
xml_tree = etree.ElementTree(in_filehandle)
# process the tree
xml_tree.write(out_filehandle, encoding=xml_tree.encoding)

--

___
Python tracker 

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



[issue9574] complex does not parse strings containing decimals

2010-08-12 Thread Mark Dickinson

Mark Dickinson  added the comment:

The problem here is the spaces in the input string:

newton:~ dickinsm$ python2.7
Python 2.7 (r27:82500, Jul 13 2010, 14:10:05) 
[GCC 4.2.1 (Apple Inc. build 5659)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> complex("1.1+2.1j")
(1.1+2.1j)

The current behaviour is by design, so I'm changing to feature request.  It may 
make sense to consider allowing whitespace around the central '+' or '-', 
though this would mildly complicate the parsing.

I'd be +0 on this change.

--
assignee:  -> mark.dickinson
nosy: +mark.dickinson
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



[issue9574] complex does not parse strings containing decimals

2010-08-12 Thread Mark Dickinson

Mark Dickinson  added the comment:

Note also that spaces are already allowed immediately inside the parentheses in 
a string argument to the complex constructor (in python 2.6 and later):


>>> complex("( 1.1+2.1j )")
(1.1001+2.1001j)

--

___
Python tracker 

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



[issue9574] complex does not parse strings containing decimals

2010-08-12 Thread Mark Dickinson

Changes by Mark Dickinson :


--
stage:  -> needs patch
versions: +Python 3.2 -Python 2.5, Python 2.6, Python 2.7, Python 3.1

___
Python tracker 

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



[issue9522] xml.etree.ElementTree forgets the encoding

2010-08-12 Thread Stefan Behnel

Stefan Behnel  added the comment:

lxml.etree has encapsulated this in a 'docinfo' property which also holds the 
XML 'version', the 'standalone' state and the DOCTYPE (if available).

Note that this information is readily available in lxml.etree for any parsed 
Element (by wrapping it in a new ElementTree), but not in ET where it can only 
be associated to the ElementTree instance that did the parsing, not one that 
just wraps a parsed tree of Element objects. I would expect that this is still 
enough to handle this use case, though.

Stefan

--

___
Python tracker 

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



[issue9522] xml.etree.ElementTree forgets the encoding

2010-08-12 Thread Mark Summerfield

Mark Summerfield  added the comment:

I don't see how lxml is relevant here? lxml is a third party library, whereas 
etree is part of the standard library. And according to the 3.1.2 docs etree 
doesn't have a docinfo (or any other) property.

--

___
Python tracker 

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



[issue9571] argparse: Allow the use of -- to break out of nargs and into subparser

2010-08-12 Thread Steven Bethard

Steven Bethard  added the comment:

This is closely related to issue 9338. The parser should know that your command 
line requires at least the COMMAND argument, so it should stop parsing in time 
for that. However, in the case of subcommands, even if we solved issue 9338, 
you would still get the behavior that

./script.py --ignore one two COMMAND arg1 arg2

would get parsed as "arg2" being the command. So I guess there still ought to 
be a way to tell argparse to stop parsing nargs='+' optionals.

Seems like there's also a bug in the current behavior - you should get an error 
saying that no command was given, not an error saying you issued the command 
"--".

--

___
Python tracker 

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



[issue7467] The zipfile module does not check files' CRCs, including in ZipFile.testzip

2010-08-12 Thread Nir Aides

Nir Aides  added the comment:

I think patch may be simplified. Instead of keeping track of CRC offset, invoke 
it directly on the 'data' variable being added to _readbuffer. 

Also the call to _update_crc() before the return from read1() looks redundant.

Finally, is it possible to determine end of file if length of 'data' (computed 
for crc) is 0?

--

___
Python tracker 

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



[issue9522] xml.etree.ElementTree forgets the encoding

2010-08-12 Thread Stefan Behnel

Stefan Behnel  added the comment:

That's why I mention it here to prevent future incompatibilities between the 
two libraries.

--

___
Python tracker 

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



[issue1491804] Simple slice support for list.sort() and .reverse()

2010-08-12 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

I'm rejecting this feature request on the grounds that the use cases are 
sufficiently uncommon to warrant adding API complexity.  

Currently, the notions of reverse() and sort() are comparatively simple.  They 
correspond well to what I see in other languages.

Another issue is orthogonality, keeping the notions of slicing separate from 
concerns about sorting and reversing.

Also, the optimization aspect of this feature request is misguided (trying to 
reduce an O(n) step embedded inside an O(n log n) operation.

The purported syntactic gain is also negligible and uncompelling.
The rare bit of code that currently is written:

  sorted(s[a:b], key=f)

would instead become:

  sorted(s, key=f, start=a, stop=b)

There is no significant syntactic win or gain in expressiveness.

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



[issue9338] argparse optionals with nargs='+' can't be followed by positionals

2010-08-12 Thread Michael . Elsdörfer

Changes by Michael.Elsdörfer :


--
nosy: +elsdoerfer

___
Python tracker 

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



[issue9575] os.listdir() crashes on some long and deep paths in Windows 7

2010-08-12 Thread Heejin

New submission from Heejin :

As far as I have seen, this bug only appears in Windows 7. I tested with Python 
2.5, 2.6, and 2.7 and they all seem to have this bug.
I tested with Windows 7 Korean version. I'm not sure if other language versions 
have the same problem.

Reproduction steps:

1. Run a command shell 'cmd'.

2. Run following commands in order:
cd c:\
mkdir rpcc\build
cd rpcc\build
mkdir 
customs\llvm2dre\llvm-2.6\tools\clang\test\CXX\over\over.match\over.match.best\over.best.ics\over.ics.ellipsis\.svn\tmp\prop-base

3. Create a python script file temp.py with the contents below
import os
path = 
'customs\\llvm2dre\\llvm-2.6\\tools\\clang\\test\\CXX\\over\\over.match\\over.match.best\\over.best.ics\\over.ics.ellipsis\\.svn\\tmp\\prop-base'
os.listdir(path)
(I attached this file in this post)

4. Run the script.
python temp.py

5. Then you can see it crashes.

--
components: Library (Lib), Windows
files: temp.py
messages: 113672
nosy: aheejin
priority: normal
severity: normal
status: open
title: os.listdir() crashes on some long and deep paths in Windows 7
type: crash
versions: Python 2.5, Python 2.6, Python 2.7
Added file: http://bugs.python.org/file18483/temp.py

___
Python tracker 

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



[issue9575] os.listdir() crashes on some long and deep paths in Windows 7

2010-08-12 Thread Tim Golden

Changes by Tim Golden :


--
assignee:  -> tim.golden
nosy: +tim.golden
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



[issue3482] re.split, re.sub and re.subn should support flags

2010-08-12 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
stage: unit test needed -> needs patch

___
Python tracker 

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



[issue6164] [AIX] Patch to correct the AIX C/C++ linker argument used for 'runtime_library_dirs'

2010-08-12 Thread Éric Araujo

Changes by Éric Araujo :


--
nosy: +eric.araujo
versions:  -Python 2.7, Python 3.2

___
Python tracker 

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



[issue9055] test_issue_8959_b fails when run from a service

2010-08-12 Thread Tim Golden

Tim Golden  added the comment:

Fudge-fix committed as r83948, r83958. Not sure what status to set

--
status: open -> pending

___
Python tracker 

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



[issue2304] subprocess under windows fails to quote properly when shell=True

2010-08-12 Thread Tim Golden

Tim Golden  added the comment:

ReComitted as r83947, r83956, r83957 and this time the buildbots look happy. 
(At least as regards this change).

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



[issue9055] test_issue_8959_b fails when run from a service

2010-08-12 Thread Paul Moore

Paul Moore  added the comment:

Certainly the 2.7 branch on my buildbot is now OK (3.x is failing for
other reasons :-()

--
status: pending -> open

___
Python tracker 

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



[issue9574] complex does not parse strings containing decimals

2010-08-12 Thread Mark Dickinson

Mark Dickinson  added the comment:

I'm wondering whether the moratorium (PEP 3003) applies to this; from a close 
reading I'd say it does.  At any rate, it seems like an inessential 
enhancement, so I'd be happy to delay this until 3.3.

--
versions: +Python 3.3 -Python 3.2

___
Python tracker 

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



[issue9575] os.listdir() crashes on some long and deep paths in Windows 7

2010-08-12 Thread Tim Golden

Tim Golden  added the comment:

I can't get it crash on a path that short. I can produce an error message if I 
push it beyond the 254 limit, but you can work around that by applying the 
filesystem namespace prefix:


import os

path = "c:\\" + "\\".join (130 * ['xx'])
os.makedirs (path)
#
# will fail more or less violently
#
path = "?\\" + path
os.makedirs (path)
os.listdir (path)



Probably related issues:

http://bugs.python.org/issue9246
http://bugs.python.org/issue4071

--

___
Python tracker 

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



[issue9575] os.listdir() crashes on some long and deep paths in Windows 7

2010-08-12 Thread Heejin

Heejin  added the comment:

Thank you for your answer.

Actually I tried that in two Windows7-installed computers
and failed in both. But I don't think it is the problem of
path lengths; I created other paths that long and that deep
but os.listdir() works on them. That's why I wrote the path
verbatim on which the function crashes.
I couldn't find the exact conditions for it to crash.

I haven't heard of that "filesystem namespace prefix"
'?\\' before. I searched it in the manual and googled it
but couldn't find an explanation about it. But when I modified
the path in my example temp.py it worked! I don't know why though.
Could you point out some informative pages about this prefix?

Unfortunately, the example temp.py is characterizing only the
key reason of the crash. My program uses os.walk() and
os.listdir() was actually called within os.walk(),
so I cannot prepend the path with '?\\'.

Fortunately I found another workaround for my program,
but this still seems a bug..

Thank you.

--

___
Python tracker 

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



[issue9575] os.listdir() crashes on some long and deep paths in Windows 7

2010-08-12 Thread Tim Golden

Tim Golden  added the comment:

See: http://msdn.microsoft.com/en-us/library/aa365247%28VS.85%29.aspx

I tried first with your exact path and it caused no issues on
my Win7 box. FWIW you could easily roll your own os.walk
(starting by copying the code that's there) if you needed
to roll in special-cases.

Could you provide a batch file / Python script which exactly
reproduces the issue and a cut-and-paste of the resulting
traceback. (Unless "crash" really does mean "crash").

Would you be able to narrow the issue down any further: see
if any other paths cause the same issue, or if a longer or
a shorter version of the path is problematic.

TJG

--
title: os.listdir() crashes on some long and deep paths in Windows 7 -> 
os.listdir() crashes on some long and deep paths in Windows 7

___
Python tracker 

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



[issue7467] The zipfile module does not check files' CRCs, including in ZipFile.testzip

2010-08-12 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Ok, here is a new patch with a simpler logic. I've also added tests with a 
deflated zipfile entry with a bad CRC (in addition to the one with a stored 
zipfile entry).

> Finally, is it possible to determine end of file if length of 'data'
> (computed for crc) is 0?

I'm not sure I understand the question.

--
Added file: http://bugs.python.org/file18484/zipcrc2.patch

___
Python tracker 

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



[issue9573] importing a module that executes fork() raises RuntimeError

2010-08-12 Thread Alexander Belopolsky

Changes by Alexander Belopolsky :


--
nosy:  -belopolsky

___
Python tracker 

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



[issue9573] importing a module that executes fork() raises RuntimeError

2010-08-12 Thread Alexander Belopolsky

Changes by Alexander Belopolsky :


--
Removed message: http://bugs.python.org/msg113654

___
Python tracker 

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



[issue8857] socket.getaddrinfo needs tests

2010-08-12 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

I've ported the patch to py3k and checked it works under Mandriva Linux and 
Windows 7 x64.

--
versions:  -Python 2.6
Added file: http://bugs.python.org/file18485/getaddrinfo3.patch

___
Python tracker 

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



[issue7467] The zipfile module does not check files' CRCs, including in ZipFile.testzip

2010-08-12 Thread Nir Aides

Nir Aides  added the comment:

But you answered my question with code :) self._file_size is now unused and may 
be removed.

--

___
Python tracker 

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



[issue1475] test_popen fails when the directory contains a space

2010-08-12 Thread Tim Golden

Tim Golden  added the comment:

Fixed by issue2304

--
components:  -Library (Lib), Tests, Windows
nosy: +tim.golden
resolution:  -> duplicate
stage:  -> committed/rejected
status: open -> closed
type:  -> behavior

___
Python tracker 

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



[issue7467] The zipfile module does not check files' CRCs, including in ZipFile.testzip

2010-08-12 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Ah, indeed. I've committed an updated patch in r83959 (py3k), r83962 (3.1) and 
r83961 (2.7). Thank you!

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

___
Python tracker 

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



[issue5484] subprocess.call() fails for .bat files on Windows, if executable path contains parenthesis

2010-08-12 Thread Tim Golden

Tim Golden  added the comment:

OK; issue2304 is now fixed and closed. But it doesn't seem to make any 
difference to this behaviour. I've just retested and I see on py3k the 
behaviour the OP saw. CreateProcess does the same thing and I couldn't even get 
it to work with multiply-nested quotes. So I would maintain it's not a Python 
issue as such.

I'm closing as won't fix and leave it to the OP to reopen if he feels there's 
something which could be done.

--
assignee:  -> tim.golden
resolution:  -> wont fix
stage: unit test needed -> 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



[issue9576] logging.addLevelName in file-based configurations

2010-08-12 Thread Tarek Ziadé

New submission from Tarek Ziadé :

It's not possible to use a custom level in a file-based configuration unless 
you programatically call logging.addLevelName('LEVEL', VALUE)

It would be nice to be able to declare new levels in config files

--
assignee: vinay.sajip
components: Library (Lib)
messages: 113686
nosy: tarek, vinay.sajip
priority: normal
severity: normal
status: open
title: logging.addLevelName in file-based configurations
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



[issue6884] Impossible to include file in sdist that starts with 'build' on Win32

2010-08-12 Thread Éric Araujo

Éric Araujo  added the comment:

I’ll write a unit test shortly.

--
assignee: tarek -> eric.araujo
versions: +Python 3.1, Python 3.2 -Python 2.6

___
Python tracker 

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



[issue9576] logging.addLevelName in file-based configurations

2010-08-12 Thread Éric Araujo

Changes by Éric Araujo :


--
nosy: +eric.araujo

___
Python tracker 

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



[issue9577] html parser bug related with CDATA sections

2010-08-12 Thread Arman

New submission from Arman :

When HTMLParser reaches CDATA element it enters cdata mode by calling 
set_cdata_mode (file html/parser.py line 270). this method assigns 
self.interesting member new value r'<(/|\Z)'. But this is not correct. Consider 
following case 





 matches with r'<(/|\Z)' and parser gets confused and produce wrong 
results.  You can see such real htmls in 

www.ahram.org.eg
www.chefkoch.de
www.chemieonline.de
www.eip.gov.eg
www.rezepte.li
www.scienceworld.com 

The solution can be to keep

interesting_cdata_script = re.compile(r'<(/|\z)script')
interesting_cdata_style = re.compile(r'<(/|\z)style')

instead of 

interesting_cdata = re.compile(r'<(/|\Z)')

and depending on what tag is begins (script or style) set_cdata_mode can assign 
correct regexp to self.interesting member.


Please contact with me via email if you need more details.

arman.hunan...@gmail.com

--
components: Library (Lib)
messages: 113688
nosy: Hunanyan
priority: normal
severity: normal
status: open
title: html parser bug related with CDATA sections
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



[issue9574] complex does not parse strings containing decimals

2010-08-12 Thread Alexander Belopolsky

Alexander Belopolsky  added the comment:

Current behavior is also consistent with that of fractions:

>>> Fraction("1/2")
Fraction(1, 2)
>>> Fraction("1 / 2")
Traceback (most recent call last):
  ..
ValueError: Invalid literal for Fraction: '1 / 2'

I am -1 on this RFE.  At most, this can be clarified in the docs.

Allowing whitespace involves too much uncertainly.  Would you allow any white 
space or just chr(0x20)?  End-of-line or tab in complex numbers is most likely 
a typo and should be flagged.  What about more exotic unicode whitespace such 
as chr(0x00A0) or chr(0x2009)?  Allow one or any number of whitespace 
characters?

Users who need a more powerful parser can use eval() or simply remove spaces 
from their strings before converting them to numbers.

--
nosy: +belopolsky

___
Python tracker 

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



[issue9543] 2.6.6 rc1 socket.py flush() calls del on unbound 'view' variable

2010-08-12 Thread Barry A. Warsaw

Barry A. Warsaw  added the comment:

Patch accepted, please apply for 2.6.6.

--
resolution:  -> accepted

___
Python tracker 

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



[issue9543] 2.6.6 rc1 socket.py flush() calls del on unbound 'view' variable

2010-08-12 Thread Ezio Melotti

Ezio Melotti  added the comment:

Done in r83964.

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

___
Python tracker 

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



[issue7467] The zipfile module does not check files' CRCs, including in ZipFile.testzip

2010-08-12 Thread Barry A. Warsaw

Changes by Barry A. Warsaw :


--
priority: normal -> release blocker
versions: +Python 2.6 -Python 2.7, Python 3.1, Python 3.2

___
Python tracker 

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



[issue7467] The zipfile module does not check files' CRCs, including in ZipFile.testzip

2010-08-12 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
status: closed -> open

___
Python tracker 

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



[issue9574] complex does not parse strings containing decimals

2010-08-12 Thread Alexander Belopolsky

Alexander Belopolsky  added the comment:

I did some experimentation and found some inconsistency between int and complex:

>>> int('\xA11')
Traceback (most recent call last):
  File "", line 1, in 
UnicodeDecodeError: 'utf8' codec can't decode byte 0xa1 in position 0: invalid 
start byte

but
>>> complex('\xA11')
Traceback (most recent call last):
  File "", line 1, in 
ValueError: complex() arg is a malformed string

The int behavior is probably a bug that should be reported separately.

--

___
Python tracker 

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



[issue9574] complex does not parse strings containing decimals

2010-08-12 Thread Mark Dickinson

Mark Dickinson  added the comment:

I don't think determining *which* whitespace is allowed is a problem; just use 
whatever's already being used for the whitespace that's already allowed (around 
the whole complex input, for example, or between the optional parentheses and 
the number).

Please open a separate bug report for the UnicodeDecodeError.  Though I have a 
suspicion/vague recollection that this has already come up somewhere in the 
tracker...

--

___
Python tracker 

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



[issue9578] int() raises UnicodeDecodeError when called on malformed string

2010-08-12 Thread Alexander Belopolsky

New submission from Alexander Belopolsky :

>>> int('\xA11')
Traceback (most recent call last):
  File "", line 1, in 
UnicodeDecodeError: 'utf8' codec can't decode byte 0xa1 in position 0: invalid 
start byte

This is inconsistent with other number types' behavior: 
>>> float(b'\xA1')
Traceback (most recent call last):
  File "", line 1, in 
ValueError: could not convert string to float: �

--
messages: 113694
nosy: belopolsky, mark.dickinson
priority: normal
severity: normal
status: open
title: int() raises UnicodeDecodeError when called on malformed string

___
Python tracker 

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



[issue9578] int() raises UnicodeDecodeError when called on malformed string

2010-08-12 Thread Ezio Melotti

Changes by Ezio Melotti :


--
components: +Interpreter Core
nosy: +ezio.melotti
stage:  -> unit test needed
type:  -> behavior
versions: +Python 2.7, Python 3.1, Python 3.2

___
Python tracker 

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



[issue7710] Inconsistent Exception for int() conversion

2010-08-12 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



[issue4221] inconsistent exception from int is confusing

2010-08-12 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



[issue9424] Disable unittest.TestCase.assertEquals and assert_ during a regrtest run

2010-08-12 Thread Michael Foord

Michael Foord  added the comment:

Well, there is *some* value in stylistic consistency. If it didn't matter at 
all then Guido wouldn't have instigated the deprecation of assertEquals and 
assert_ and standardised on assertEqual (which he did during the sprints at 
PyCon 2009). Either we stick with that or we don't.

--

___
Python tracker 

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



[issue9578] int() raises UnicodeDecodeError when called on malformed string

2010-08-12 Thread Florent Xicluna

Florent Xicluna  added the comment:

a duplicate of #7710

--
nosy: +flox
resolution:  -> duplicate
status: open -> closed
superseder:  -> Inconsistent Exception for int() conversion

___
Python tracker 

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



[issue7710] Inconsistent Exception for int() conversion

2010-08-12 Thread Florent Xicluna

Changes by Florent Xicluna :


--
nosy: +belopolsky
stage:  -> unit test needed
type:  -> behavior
versions: +Python 2.7, Python 3.1

___
Python tracker 

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



[issue8371] Add a command to download distributions

2010-08-12 Thread Éric Araujo

Changes by Éric Araujo :


--
nosy: +alexis

___
Python tracker 

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



[issue9553] test_argparse.py: 80 failures if COLUMNS env var set to a value other than 80

2010-08-12 Thread R. David Murray

R. David Murray  added the comment:

I don't think it is worthwhile to jump through hoops to avoid calling the 
special methods.  Your patch also creates an unnecessary dependency on the 
internal implementation of EnvironmentVarGuard (ie: the fact that currently 
__enter__ happens to return self...this is *not* part of EnvironmentVarGuard's 
interface contract).

--
stage: unit test needed -> patch review

___
Python tracker 

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



[issue5867] No way to create an abstract classmethod

2010-08-12 Thread Daniel Urban

Changes by Daniel Urban :


--
nosy: +durban

___
Python tracker 

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



[issue5996] abstract class instantiable when subclassing dict

2010-08-12 Thread Daniel Urban

Daniel Urban  added the comment:

I think, that the reason is that, object.__new__ checks, if the class is 
instantiable (object_new in Objects/typeobject.c ). dict.__new__ (and 
tuple.__new__, and I guess the __new__ method of other built-in types) doesn't 
call object.__new__, but user defined types typically either doesn't have a 
__new__, or call object.__new__ from it (directly or with super).

--
nosy: +durban

___
Python tracker 

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



[issue9579] In 3.x, os.confstr() returns garbage if value is longer than 255 bytes

2010-08-12 Thread David Watson

New submission from David Watson :

It may be hard to find a configuration string this long, but you
can see the problem if you apply the attached
confstr-reduce-bufsize.diff to reduce the size of the local array
buffer that posix_confstr() uses.  With it applied:

>>> import os
>>> print(ascii(os.confstr("CS_PATH")))
'\x00\ucbcb\ucbcb\ucbcb\ucbcb\ucbcb\ucbcb\ucbcb\ucbcb\ucbcb\ucbcb\ucbcb\ucbcb'

The problem arises because the code first tries to receive the
configuration string into the local buffer (char buffer[256],
reduced to char buffer[1] above), but then tries to receive it
directly into a string object if it doesn't fit.  You can see
what's gone wrong by comparing the working code in 2.x:

if ((unsigned int)len >= sizeof(buffer)) {
result = PyString_FromStringAndSize(NULL, len-1);
if (result != NULL)
confstr(name, PyString_AS_STRING(result), len);
}
else
result = PyString_FromStringAndSize(buffer, len-1);

with the code in 3.x:

if ((unsigned int)len >= sizeof(buffer)) {
result = PyUnicode_FromStringAndSize(NULL, len-1);
if (result != NULL)
confstr(name, _PyUnicode_AsString(result), len);
}
else
result = PyUnicode_FromStringAndSize(buffer, len-1);

Namely, that in 3.x it tries to receive the string into the bytes
object returned by _PyUnicode_AsString(), not the str object it
has just allocated (which has the wrong format anyway -
Py_UNICODE as opposed to char).

The attached confstr-long-result.diff fixes this by allocating a
separate buffer when necessary to receive the result, before
creating the string object from it.  By putting the confstr()
call and allocation in a loop, it also handles the possibility
that the value's length might change between calls.

--
components: Extension Modules
files: confstr-reduce-bufsize.diff
keywords: patch
messages: 113699
nosy: baikie
priority: normal
severity: normal
status: open
title: In 3.x, os.confstr() returns garbage if value is longer than 255 bytes
type: behavior
versions: Python 3.1, Python 3.2
Added file: http://bugs.python.org/file18486/confstr-reduce-bufsize.diff

___
Python tracker 

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



[issue9579] In 3.x, os.confstr() returns garbage if value is longer than 255 bytes

2010-08-12 Thread David Watson

Changes by David Watson :


Added file: http://bugs.python.org/file18487/confstr-long-result.diff

___
Python tracker 

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



[issue9580] os.confstr() doesn't decode result according to PEP 383

2010-08-12 Thread David Watson

New submission from David Watson :

The attached patch applies on top of the patch from issue #9579 to
make it use PyUnicode_DecodeFSDefaultAndSize().  (You could use
it in the existing code, but until that issue is fixed, there is
sometimes nothing to decode!)

--
components: Extension Modules
files: confstr-pep383.diff
keywords: patch
messages: 113700
nosy: baikie
priority: normal
severity: normal
status: open
title: os.confstr() doesn't decode result according to PEP 383
type: behavior
versions: Python 3.1, Python 3.2
Added file: http://bugs.python.org/file18488/confstr-pep383.diff

___
Python tracker 

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



[issue9579] In 3.x, os.confstr() returns garbage if value is longer than 255 bytes

2010-08-12 Thread David Watson

David Watson  added the comment:

The returned string should also be decoded with the file system
encoding and surrogateescape error handler, as per PEP 383 -
there's a patch at issue #9580 to do this.

--

___
Python tracker 

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



[issue9569] Add tests for posix.mknod() and posix.mkfifo()

2010-08-12 Thread David Watson

David Watson  added the comment:

I'm not quite sure what you mean, but the man page for FreeBSD 5.3 specifies 
EPERM for an unprivileged user and EINVAL for an attempt to create something 
other than a device node.  POSIX requires creating a FIFO to work for any user, 
and just says that EINVAL is for an "invalid argument".

--

___
Python tracker 

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



[issue9569] Add tests for posix.mknod() and posix.mkfifo()

2010-08-12 Thread David Watson

David Watson  added the comment:

OK, these patches work on FreeBSD 5.3 (root and non-root) if you want to check 
the errno.  I don't know what other systems might return though.  I did also 
find that the 2.x tests were failing on cleanup because the test class used 
os.unlink rather than support.unlink (which ignores missing files) as its 3.x 
counterpart does, so I've updated the patch to change that as well.

--
Added file: http://bugs.python.org/file18489/test-mknod-mkfifo-2.x-2.diff

___
Python tracker 

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



[issue9569] Add tests for posix.mknod() and posix.mkfifo()

2010-08-12 Thread David Watson

Changes by David Watson :


Added file: http://bugs.python.org/file18490/add-errno-check-2.x.diff

___
Python tracker 

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



[issue9569] Add tests for posix.mknod() and posix.mkfifo()

2010-08-12 Thread David Watson

Changes by David Watson :


Added file: http://bugs.python.org/file18491/add-errno-check-3.x.diff

___
Python tracker 

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



[issue9579] In 3.x, os.confstr() returns garbage if value is longer than 255 bytes

2010-08-12 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
nosy: +haypo

___
Python tracker 

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



[issue9580] os.confstr() doesn't decode result according to PEP 383

2010-08-12 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
nosy: +haypo

___
Python tracker 

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



[issue9569] Add tests for posix.mknod() and posix.mkfifo()

2010-08-12 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

The 3.x patches work fine for me under Mandriva Linux.

--
nosy: +pitrou

___
Python tracker 

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



[issue9581] PosixGroupsTester fails as root

2010-08-12 Thread Antoine Pitrou

New submission from Antoine Pitrou :

I get the following test_posix failures when run as root (Mandriva Linux):

==
ERROR: test_initgroups (test.test_posix.PosixGroupsTester)
--
Traceback (most recent call last):
  File "/home/antoine/py3k/__svn__/Lib/test/test_posix.py", line 418, in 
test_initgroups
g = g2 + 1
UnboundLocalError: local variable 'g2' referenced before assignment

==
FAIL: test_setgroups (test.test_posix.PosixGroupsTester)
--
Traceback (most recent call last):
  File "/home/antoine/py3k/__svn__/Lib/test/test_posix.py", line 428, in 
test_setgroups
self.assertListEqual(groups, posix.getgroups())
AssertionError: First sequence is not a list: range(0, 16)


Under 2.6, there's another failure:

==
ERROR: test_setgroups (test.test_posix.PosixGroupsTester)
--
Traceback (most recent call last):
  File "/home/antoine/cpython/26/Lib/test/test_posix.py", line 356, in 
test_setgroups
self.assertListEqual(groups, posix.getgroups())
AttributeError: 'PosixGroupsTester' object has no attribute 'assertListEqual'

--
assignee: ronaldoussoren
components: Tests
messages: 113705
nosy: exarkun, pitrou, ronaldoussoren
priority: normal
severity: normal
stage: needs patch
status: open
title: PosixGroupsTester fails as root
type: behavior
versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2

___
Python tracker 

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



[issue8433] buildbot: test_curses failure, getmouse() returned ERR

2010-08-12 Thread Barry A. Warsaw

Barry A. Warsaw  added the comment:

I'm putting this one in the same category as bug 7467.  I think these two, plus 
the patches which were applied to release26-maint after rc1 (without approval 
;) will require an rc2.  If that can be worked out schedule-wise, I'll allow 
these patches to be applied.  Stay tuned.

--

___
Python tracker 

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



[issue2944] asyncore doesn't handle connection refused correctly

2010-08-12 Thread Barry A. Warsaw

Barry A. Warsaw  added the comment:

The fix for this was applied after 2.6.6rc1, and it wasn't approved by me.  Is 
it critical for 2.6?  Is it a regression since 2.6.5?  The way I see it, we 
either back this out or release an rc2.  There may be other reasons to release 
an rc2, but I need to verify that that is possible for MvL.

--
nosy: +barry, loewis

___
Python tracker 

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



[issue2944] asyncore doesn't handle connection refused correctly

2010-08-12 Thread Barry A. Warsaw

Changes by Barry A. Warsaw :


--
priority: normal -> release blocker
status: closed -> open

___
Python tracker 

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



[issue1285086] urllib.quote is too slow

2010-08-12 Thread Barry A. Warsaw

Barry A. Warsaw  added the comment:

Why was this merged to 2.6 after 2.6.6rc1 without approval?

--
nosy: +barry

___
Python tracker 

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



[issue1285086] urllib.quote is too slow

2010-08-12 Thread Barry A. Warsaw

Changes by Barry A. Warsaw :


--
priority: low -> release blocker
status: closed -> open

___
Python tracker 

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



[issue2944] asyncore doesn't handle connection refused correctly

2010-08-12 Thread Martin v . Löwis

Martin v. Löwis  added the comment:

What date would the final release then be made? It would be best if it could be 
done before Aug 27. If necessary, I could also make a release on September 6 
(but not any day before or after)

--

___
Python tracker 

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



[issue2944] asyncore doesn't handle connection refused correctly

2010-08-12 Thread Martin v . Löwis

Martin v. Löwis  added the comment:

The bug is not a regression since 2.6.5; AFAICT, it was in Python "forever". I 
recommend to revert the checkin, and postpone fixing it to 2.7.1.

--

___
Python tracker 

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



[issue9582] documentation line needs rewording

2010-08-12 Thread Robert Mohr

New submission from Robert Mohr :

The last line of 
http://docs.python.org/faq/programming.html#is-there-a-scanf-or-sscanf-equivalent
 is not proper English:

For more complicated input parsing, regular expressions more powerful than C’s 
sscanf() and better suited for the task.

This also shows up in the 3.2 docs.

--
assignee: d...@python
components: Documentation
messages: 113711
nosy: d...@python, mohrr
priority: normal
severity: normal
status: open
title: documentation line needs rewording
versions: Python 2.7, Python 3.2

___
Python tracker 

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



[issue7734] discuss mark-as-invalid trick in heapq docs

2010-08-12 Thread Joshua Bronson

Joshua Bronson  added the comment:

Thanks for the great additions.

--

___
Python tracker 

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



[issue9577] html parser bug related with CDATA sections

2010-08-12 Thread R. David Murray

R. David Murray  added the comment:

I believe this is a duplicate of Issue670664.  If you disagree please reopen 
with additional information.

--
nosy: +r.david.murray
resolution:  -> duplicate
stage:  -> committed/rejected
status: open -> closed
superseder:  -> HTMLParser.py - more robust SCRIPT tag parsing

___
Python tracker 

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



[issue1285086] urllib.quote is too slow

2010-08-12 Thread Barry A. Warsaw

Barry A. Warsaw  added the comment:

flox reverted in r83967 for 2.6.6.

--
priority: release blocker -> 
status: open -> closed

___
Python tracker 

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



[issue2944] asyncore doesn't handle connection refused correctly

2010-08-12 Thread Barry A. Warsaw

Barry A. Warsaw  added the comment:

I agree w/mvl.  Giampaolo, please revert this for 2.6.6.

--

___
Python tracker 

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



[issue8433] buildbot: test_curses failure, getmouse() returned ERR

2010-08-12 Thread Barry A. Warsaw

Barry A. Warsaw  added the comment:

Since the patch only changes a test, and it looks innocent enough (i.e. no 
possibility of regression), and it only changes a test that is run with -u all, 
I will allow this for 2.6.6.

Mark, please apply your test_curses_getmouse.patch.  You can then close this 
issue and/or reduce the priority.  Don't forget to add a NEWS file entry.

--
resolution:  -> accepted

___
Python tracker 

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



[issue9583] PYTHONOPTIMIZE = 0 is not honored

2010-08-12 Thread Buck Golemon

New submission from Buck Golemon :

In our environment, we have a wrapper which enables optimization by default 
(-OO). Most commandline tools which have a mode-changing flag such as this, 
also have a flag to do the opposite ( see: ls -t -U, wget -nv -v,  ).

I'd like to implement one or both of:
1) Add a -D option which is the opposite of -O. python -OO -D gives an 
optimization level of 1.
2) Honor PYTHONOPTIMIZE = 0. At the least, the man page needs to describe how 
these two methods interact.

--
components: Interpreter Core
messages: 113717
nosy: bukzor
priority: normal
severity: normal
status: open
title: PYTHONOPTIMIZE = 0 is not honored
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



[issue7734] discuss mark-as-invalid trick in heapq docs

2010-08-12 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

You're welcome :-)

--

___
Python tracker 

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



[issue7467] The zipfile module does not check files' CRCs, including in ZipFile.testzip

2010-08-12 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

At Barry's request, here is a patch for potential backport to 2.6.

--
Added file: http://bugs.python.org/file18492/zipcrc.patch

___
Python tracker 

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



[issue8432] buildbot: test_send_signal of test_subprocess failure

2010-08-12 Thread Stefan Krah

Stefan Krah  added the comment:

Issue 8714 could be related as well: On OpenBSD, after a KeyboardInterrupt
one has to hit  before the traceback appears.

This was introduced in (or exposed by) r68460. When Python is compiled
without threads, the bug does not occur.

--
nosy: +skrah

___
Python tracker 

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



[issue9574] complex does not parse strings containing decimals

2010-08-12 Thread Jervis Whitley

Jervis Whitley  added the comment:

It hadn't occurred to me to try this without spaces. Thank you for pointing 
this out. Agreed that the enhancement is not essential.

--

___
Python tracker 

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



[issue9227] can't import Tkinter / use IDLE after installing Python 2.7 on Mac OS X

2010-08-12 Thread Ned Deily

Ned Deily  added the comment:

For the record, after some discussion at EuroPython and on the Pythonmac-SIG 
mailing list (thread starting here: 
http://mail.python.org/pipermail/pythonmac-sig/2010-July/022467.html), the 
current plan is to make the "64-bit" installer variant support OS 10.6 (and 
above) and 2-way Intel (i386, x86_64).  That way the installer can be linked 
with the 10.6 Tk 8.5 which supports both 32- and 64-bit and avoids the 
unnecessary compilation for PPC arch.

Ronald, since it might be a while until a 2.7.1 release comes out, would it be 
possible to make available a new vanilla 2.7 installer to replace or supplement 
(this time only) the original 64-bit one?

--

___
Python tracker 

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



[issue9580] os.confstr() doesn't decode result according to PEP 383

2010-08-12 Thread STINNER Victor

STINNER Victor  added the comment:

Can you give me examples of configuration keys with undecodable values?

PyUnicode_DecodeFSDefault(AndSize) encoding depends on the locale whereas 
PyUnicode_FromString uses utf-8. I don't know the encoding of confstr() values.

You can decode an utf-8 value using surrogateescape (PEP 383 error handler) 
with PyUnicode_DecodeUTF8(value, strlen(value), "surrogateescape").

--

___
Python tracker 

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



[issue9579] In 3.x, os.confstr() returns garbage if value is longer than 255 bytes

2010-08-12 Thread STINNER Victor

STINNER Victor  added the comment:

About confstr-long-result.diff: why do you use a loop to reallocate the buffer? 
confstr() result may change?

--

___
Python tracker 

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



[issue9561] distutils: set encoding to utf-8 for input and output files

2010-08-12 Thread STINNER Victor

STINNER Victor  added the comment:

> - PKG-INFO (METADATA in distutil2), that already uses a trick to support
> Unicode, but your change would replace it in a better way;

Which "trick"?

> - MANIFEST, which with your fix would gain the ability to handle non-ASCII
> paths, which is a feature or a bugfix depending on your point of view;

Wait. Non encodable bytes is a separated issue. I would like to work on the 
first problem: distutils in Python3 uses open() without encoding argument and 
so the encoding depends on the user's locale. Said differently: if you produce 
a file with distutils on a computer, you cannot be sure that the file can be 
read with the same version of Python on other computer (if the locale encoding 
is different). Eg. Windows uses mbcs encoding whereas utf-8 is the preferred 
encoding on Linux.

What is the encoding of the MANIFEST file?

> - .def files, used by the compilers for the C linking step; I don’t know if
> it’s appropriate to allow UTF-8 there.

I don't know these files.

> - RPM spec files, which use ASCII or UTF-8 according to
> http://en.opensuse.org/openSUSE:Specfile_guidelines#Specfile_Encoding but
> it’s not confirmed in
> http://www.rpm.org/max-rpm/s1-rpm-build-creating-spec-file.html (linked
> from the LSB site), so there’s no guarantee this works for all RPM
> platforms. This sort of platform-specific thing is the reason why RPM
> support has been removed in distutils2.

UTF-8 is a superset of ASCII. If you use utf-8 but only write ascii 
characters, your output file will be written to utf-8... but it will be also 
encoded to ascii. It's magical :-)

> - record and .pth files created by the install command.

.pth contain directory names which can be non-ASCII.

> I agree that there is something to be fixed, but I don’t know if they can
> be fixed in distutils. Unicode in PKG-INFO is unrelated to files, whereas
> there are files or directories in MANIFEST, spec, record and .pth.

You can use non-ASCII characters for other topics than filenames. Eg. in a 
description of a package :-)

> If this is going to be fixed, write_file should not use UTF-8 unconditionally
> but grow a keyword argument IMO, so that use cases requiring ASCII 
> continue to work.

As written before, UTF-8 is a superset of ASCII. If you read a file using utf-8 
encoding, you will be able to read ascii files. But if you use utf-8 and write 
non-ascii characters, old version of distutils using ascii or other encoding 
will not be able to read these files.

Anyway, I think that in most cases, all files only contain ASCII text. So it 
doesn't really matter.

About the keyword solution: yes, it would be a smooth way to fix this issue.

> When you say “patch *all* functions reading files”, I guess you mean all
> functions that read distutils files, i.e. MANIFEST and PKG-INFO.

I don't know distutils to answer to my own question.

--

___
Python tracker 

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



[issue9425] Rewrite import machinery to work with unicode paths

2010-08-12 Thread STINNER Victor

STINNER Victor  added the comment:

(About PyFile_FromFd)
pitrou> Actually, I'm not sure there's much point since the "name"
pitrou>  attribute is currently read-only: (...)

Oh, it remembers me #4762. I closed this issue with the message "The last 
problem occurs with imp.find_module(). But imp.find_module() also returns a 
"filename" argument, so I don't think that the issue really matters. Let's 
close it ;-)".

Even if it would be possible to set f(.buffer).raw.name, the solution is maybe 
just to ignore the argument (don't set any name attribute). Can we change such 
public function?

--

___
Python tracker 

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



[issue9560] platform.py: use -b option for file command in _syscmd_file()

2010-08-12 Thread STINNER Victor

STINNER Victor  added the comment:

> The patch looks good.

Can it/should it be applied to 2.7 too?

> Just one nit: could you please indent the doc-string
> to match the original indentation ?

Done. New patch attached. Is it ok like that?

--
Added file: http://bugs.python.org/file18493/_syscmd_file-2.patch

___
Python tracker 

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



[issue9560] platform.py: use -b option for file command in _syscmd_file()

2010-08-12 Thread STINNER Victor

STINNER Victor  added the comment:

Hey! I don't know why, but I posted a truncated patch. It doesn't remove the 
code removing the filename and so it breaks the code. New try: version 3 should 
be ok :-)

--
Added file: http://bugs.python.org/file18494/_syscmd_file-3.patch

___
Python tracker 

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



[issue9560] platform.py: use -b option for file command in _syscmd_file()

2010-08-12 Thread STINNER Victor

Changes by STINNER Victor :


Removed file: http://bugs.python.org/file18493/_syscmd_file-2.patch

___
Python tracker 

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



[issue9560] platform.py: use -b option for file command in _syscmd_file()

2010-08-12 Thread STINNER Victor

Changes by STINNER Victor :


Removed file: http://bugs.python.org/file18470/_syscmd_file.patch

___
Python tracker 

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



[issue9560] platform.py: use -b option for file command in _syscmd_file()

2010-08-12 Thread Éric Araujo

Éric Araujo  added the comment:

Is it guaranteed that the -b option will be present in every version of file?

--
nosy: +eric.araujo

___
Python tracker 

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



[issue2944] asyncore doesn't handle connection refused correctly

2010-08-12 Thread Giampaolo Rodola'

Giampaolo Rodola'  added the comment:

The commit was made on August 04, 11:05 AM, while rc1 was released at 06:09 PM.
I don't think the patch is going to introduce any problem but if you think it's 
the case to revert it then I'll do it.

--

___
Python tracker 

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



[issue2066] Adding new CNS11643, a *huge* charset, support in cjkcodecs

2010-08-12 Thread STINNER Victor

STINNER Victor  added the comment:

Hyeshik Chang, who opened this issue, wrote (msg83672) "When I asked Taiwanese 
developers how often they use these character sets, it appeared that they are 
almost useless in the usual computing
environment in Taiwan. This will only serve for a historical
compatibility and literal standard compliance. (...)"

I don't think that Python is the right place to support such encoding. Eg. a 
patch for iconv would be a better idea (if iconv doesn't support this encoding 
yet).

I close this issue as "wont fix".

--
resolution:  -> wont fix
status: open -> closed

___
Python tracker 

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



[issue9511] CharacterEncoderError when reading from sys.stdin from piped input in cmd.exe

2010-08-12 Thread STINNER Victor

STINNER Victor  added the comment:

> I thought you and...Ezio? were talking about some way to improve 
> the encoding situation when reading from/writing to a pipe.

I don't want to change that. If you come with arguments in favor of changing 
that (and maybe some ideas to choose the encoding): please open a new issue.

I close *this* particular issue because it is not a bug. Please open a new 
issue if you would like to change the current behaviour. (Or reopen the issue 
if you completly disagree with me ;-))

--
resolution:  -> invalid
status: open -> closed

___
Python tracker 

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



[issue2944] asyncore doesn't handle connection refused correctly

2010-08-12 Thread R. David Murray

R. David Murray  added the comment:

The question isn't when it was released, but when it was tagged, and that 
happened at Aug 3 22:51:57 2010 UTC according to svn.  Your commit was made Aug 
4 08:58:38 2010 UTC.

--
nosy: +r.david.murray

___
Python tracker 

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



  1   2   >