[issue5166] ElementTree and minidom don't prevent creation of not well-formed XML

2009-06-25 Thread Denis S. Otkidach

Denis S. Otkidach  added the comment:

Every blog engine I've even seen so far pass through comments from
untrusted users to RSS/Atom feeds without proper validation causing
broken XML in feeds. Sure, this is a bug in web applications, but DOM
manipulation packages should prevent from creation broken XML to help
detecting errors earlier.

--

___
Python tracker 

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



[issue6296] Native (and default) tarfile support for setup.py sdist in distutils on Windows

2009-06-25 Thread Georg Brandl

Georg Brandl  added the comment:

> Because I'm a unix weenie, and zip files feel like an intrusion from the
> Windows world. I expect source tarballs to be, well, tarballs.  I don't
> say zip shouldn't be the default, I just noted that I personally would
> find that distasteful. ;)

Agreed :)

--
nosy: +georg.brandl

___
Python tracker 

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



[issue6331] Add unicode script info to the unicode database

2009-06-25 Thread Walter Dörwald

Walter Dörwald  added the comment:

I was comparing apples and oranges: The 229 entries for the trunk where
for an UCS2 build (the patched version was UCS4), with UCS4 there are
317 entries for the trunk.

size unicodedata.o gives:

__TEXT  __DATA  __OBJC  others  dec hex
13622   587057  0   23811   624490  9876a

for trunk

and

__TEXT  __DATA  __OBJC  others  dec hex
17769   588817  0   24454   631040  9a100

for the patched version.

--

___
Python tracker 

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



[issue6334] 3.0/3.1: Bad bug in range() computation (or possible Integer problem)

2009-06-25 Thread Markus F.X.J. Oberhumer

Markus F.X.J. Oberhumer  added the comment:

Many thanks for your quick fix! ~Markus

--

___
Python tracker 

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



[issue5230] pydoc reports misleading failure if target module raises an ImportError

2009-06-25 Thread R. David Murray

R. David Murray  added the comment:

Applied to 2.7 in r73529 and 2.6 in r73530.  Leaving ticket open until I
can apply it to 3.1 and 3.2.

Thanks for your help, Lucas.

--
resolution:  -> fixed
stage: patch review -> committed/rejected
versions:  -Python 2.6, Python 2.7

___
Python tracker 

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



[issue6341] io.path.ismount gives "local variable 'p' referenced before assignment" error on Windows versions (ntpath.py)

2009-06-25 Thread Georgios Moralis

New submission from Georgios Moralis :

It returns with the following error:
UnboundLocalError: local variable 'p' referenced before assignment

Example causing this:


--- CODE FOLLOWS ---

import os

def show_cwd_list():
alpha = os.listdir(os.getcwd())
for dirnm in alpha[:]:
if os.path.isdir(os.getcwd() + os.sep + dirnm):
print("d ", dirnm)
elif os.path.ismount(os.getcwd() + os.sep + dirnm):
print("m ", dirnm)
elif os.path.isfile(os.getcwd() + os.sep + dirnm):
print("f ", dirnm)
elif os.path.islink(os.getcwd() + os.sep + dirnm):
print("l ", dirnm)
elif os.path.isabs(os.getcwd() + os.sep + dirnm):
print("a ", dirnm)
return alpha

get_dirs()

--- END OF CODE ---

The definition of ismount from the ntpath.py:


--- CODE FOLLOWS (NTPATH.PY) ---
def ismount(path):
"""Test whether a path is a mount point (defined as root of drive)"""
unc, rest = splitunc(path)
seps = _get_bothseps(p)
if unc:
return rest in p[:0] + seps
p = splitdrive(path)[1]
return len(p) == 1 and p[0] in seps

--- END OF CODE ---

As it seems, variable 'p' is used before it is initialized (_get_bothseps)

--
components: Windows
messages: 89704
nosy: g.moralis
severity: normal
status: open
title: io.path.ismount  gives "local variable 'p' referenced before assignment" 
error on Windows versions (ntpath.py)
type: compile error
versions: Python 3.0

___
Python tracker 

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



[issue6342] io.path.ismount gives "local variable 'p' referenced before assignment" error on Windows versions (ntpath.py)

2009-06-25 Thread Georgios Moralis

New submission from Georgios Moralis :

It returns with the following error:
UnboundLocalError: local variable 'p' referenced before assignment

Example causing this:


--- CODE FOLLOWS ---

import os

def show_cwd_list():
alpha = os.listdir(os.getcwd())
for dirnm in alpha[:]:
if os.path.isdir(os.getcwd() + os.sep + dirnm):
print("d ", dirnm)
elif os.path.ismount(os.getcwd() + os.sep + dirnm):
print("m ", dirnm)
elif os.path.isfile(os.getcwd() + os.sep + dirnm):
print("f ", dirnm)
elif os.path.islink(os.getcwd() + os.sep + dirnm):
print("l ", dirnm)
elif os.path.isabs(os.getcwd() + os.sep + dirnm):
print("a ", dirnm)
return alpha

get_dirs()

--- END OF CODE ---

The definition of ismount from the ntpath.py:


--- CODE FOLLOWS (NTPATH.PY) ---
def ismount(path):
"""Test whether a path is a mount point (defined as root of drive)"""
unc, rest = splitunc(path)
seps = _get_bothseps(p)
if unc:
return rest in p[:0] + seps
p = splitdrive(path)[1]
return len(p) == 1 and p[0] in seps

--- END OF CODE ---

As it seems, variable 'p' is used before it is initialized (_get_bothseps)

--
components: Windows
messages: 89705
nosy: g.moralis
severity: normal
status: open
title: io.path.ismount  gives "local variable 'p' referenced before assignment" 
error on Windows versions (ntpath.py)
type: compile error
versions: Python 3.0

___
Python tracker 

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



[issue6342] io.path.ismount gives "local variable 'p' referenced before assignment" error on Windows versions (ntpath.py)

2009-06-25 Thread Jerry Chen

Jerry Chen  added the comment:

Duplicate of http://bugs.python.org/issue5595

Fixed in r70676

--
nosy: +jcsalterego

___
Python tracker 

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



[issue6341] io.path.ismount gives "local variable 'p' referenced before assignment" error on Windows versions (ntpath.py)

2009-06-25 Thread Jerry Chen

Jerry Chen  added the comment:

Duplicate of http://bugs.python.org/issue5595

Fixed in r70676

--
nosy: +jcsalterego

___
Python tracker 

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



[issue6342] io.path.ismount gives "local variable 'p' referenced before assignment" error on Windows versions (ntpath.py)

2009-06-25 Thread R. David Murray

Changes by R. David Murray :


--
dependencies: +Wrong dump of floats
resolution:  -> duplicate
status: open -> closed

___
Python tracker 

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



[issue6341] io.path.ismount gives "local variable 'p' referenced before assignment" error on Windows versions (ntpath.py)

2009-06-25 Thread R. David Murray

Changes by R. David Murray :


--
resolution:  -> duplicate
status: open -> closed

___
Python tracker 

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



[issue6342] io.path.ismount gives "local variable 'p' referenced before assignment" error on Windows versions (ntpath.py)

2009-06-25 Thread Amaury Forgeot d'Arc

Changes by Amaury Forgeot d'Arc :


--
dependencies: +os.path.ismount (ntpath) gives UnboundLocalError for any input 
-Wrong dump of floats

___
Python tracker 

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



[issue6315] locale._build_localename(locale.getdefaultlocale()) returns 'C.mac-roman'

2009-06-25 Thread Jerry Chen

Jerry Chen  added the comment:

Also seeing this was resolved by Issue6202.


Python 3.1rc2+ (py3k:73552, Jun 24 2009, 23:11:23) 
[GCC 4.0.1 (Apple Inc. build 5490)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import locale
>>> locale._build_localename(locale.getdefaultlocale())
'en_US.UTF8'


Python 3.0.1+ (release30-maint:73553, Jun 25 2009, 08:35:35) 
[GCC 4.0.1 (Apple Inc. build 5490)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import locale
>>> locale._build_localename(locale.getdefaultlocale())
'C.mac-roman'

--
nosy: +jcsalterego

___
Python tracker 

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



[issue6315] locale._build_localename(locale.getdefaultlocale()) returns 'C.mac-roman'

2009-06-25 Thread R. David Murray

Changes by R. David Murray :


--
resolution:  -> duplicate
stage:  -> committed/rejected
status: open -> closed
superseder:  -> Obsolete default file encoding "mac-roman" on OS X, not 
influenced by locale env variables

___
Python tracker 

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



[issue6339] Some functional errors in turtle.py documentation (missing links)

2009-06-25 Thread R. David Murray

Changes by R. David Murray :


--
assignee: georg.brandl -> r.david.murray
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



[issue6339] Some functional errors in turtle.py documentation (missing links)

2009-06-25 Thread R. David Murray

R. David Murray  added the comment:

Fixed in r73555.  Thanks.

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



[issue6340] replace tdemo_chaos.py

2009-06-25 Thread R. David Murray

R. David Murray  added the comment:

Looks good to me (runs like the old one under both 2.7 and 3.1).  Do you
want to do the commit or would you like me to?  I think a demo program
is in the same class as a doc fix, so I don't see any problem with
committing it to 3.1 right away.

--
nosy: +r.david.murray
priority:  -> low
resolution:  -> accepted
stage:  -> commit review
versions: +Python 2.7

___
Python tracker 

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



[issue6340] replace tdemo_chaos.py

2009-06-25 Thread Gregor Lingl

Gregor Lingl  added the comment:

So do I.

I'd like to ask you to do the commit.

And I'd also like to suggest that - in the first three comment-lines of
the script - you replace

Datei:by  File:
Autor:by  Author:
Datum: 24. 6. 2009by  Date: 2009-06-24

Then (hopefully) we will never need to touch it any more ;-)

Thanks in advance
Gregor

--

___
Python tracker 

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



[issue6343] TimedRotatingFileHandler permission denied rename failure on Windows

2009-06-25 Thread Dale Nagata

Changes by Dale Nagata :


Removed file: http://bugs.python.org/file14365/testlog.py

___
Python tracker 

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



[issue6343] TimedRotatingFileHandler permission denied rename failure on Windows

2009-06-25 Thread Dale Nagata

Changes by Dale Nagata :


Added file: http://bugs.python.org/file14366/testlog.py

___
Python tracker 

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



[issue6343] TimedRotatingFileHandler permission denied rename failure on Windows

2009-06-25 Thread Dale Nagata

New submission from Dale Nagata :

Traceback (most recent call last):
  File "C:\python24\lib\logging\handlers.py", line 74, in emit
self.doRollover()
  File "C:\python24\lib\logging\handlers.py", line 271, in doRollover
os.rename(self.baseFilename, dfn)
OSError: [Errno 13] Permission denied

originally hit on W2K3 but could not see evidence as it was running as a
service with stderr not going anywhere, but deeply suspicious since it
failed right at midnight each time. 

whittled down to bare essentials, repro'd on XP running in console
window, test case will fail in 2 min when rollover is attempted

logging set up as follows:

def initlog():
#h = logging.handlers.TimedRotatingFileHandler( LOGFILEPATH,
'MIDNIGHT', 1, 7 )
h = logging.handlers.TimedRotatingFileHandler( LOGFILEPATH, 'M', 2, 7 )
h.setLevel( logging.DEBUG )
f = logging.Formatter( '%(asctime)s %(levelname)s %(message)s',
'%Y-%m-%d %H:%M:%S' )
h.setFormatter( f )
logging.root.addHandler( h )
logging.root.setLevel( logging.DEBUG )

searched issue tracker for TimedRotatingFileHandler, no hits

--
components: Library (Lib)
files: testlog.py
messages: 89711
nosy: dnagata
severity: normal
status: open
title: TimedRotatingFileHandler permission denied rename failure on Windows
type: crash
versions: Python 2.4
Added file: http://bugs.python.org/file14365/testlog.py

___
Python tracker 

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



[issue6340] replace tdemo_chaos.py

2009-06-25 Thread R. David Murray

R. David Murray  added the comment:

Done in r73557 and r73558.

--
stage: commit 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



[issue6344] mmap.read() crashes when passed a negative argument

2009-06-25 Thread Amaury Forgeot d'Arc

New submission from Amaury Forgeot d'Arc :

mmap.read() crashes when passed a negative count:

def test_read_negative(self):
f = open(TESTFN, 'w+')
f.write("ABCDE\0abcde")
f.flush()

mf = mmap.mmap(f.fileno(), 0)

self.assertEqual(mf.read(2),  "AB")# OK
self.assertEqual(mf.read(-1), "CDE")   # ??
self.assertEqual(mf.read(-1), "BCDE")  # ??
self.assertEqual(mf.read(-1), "ABCDE") # ??
mf.read(-1)# crash!!

I don't know what mf.read(-1) should do: raise a ValueError, return the empty 
string, or return everything from the current pos to len(mf)?

--
components: Library (Lib)
messages: 89714
nosy: amaury.forgeotdarc, ocean-city
priority: high
severity: normal
status: open
title: mmap.read() crashes when passed a negative argument
type: crash
versions: Python 2.7

___
Python tracker 

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



[issue6233] ElementTree (py3k) doesn't properly encode characters that can't be represented in the specified encoding

2009-06-25 Thread Benjamin Peterson

Benjamin Peterson  added the comment:

effbot, do you have an opinion about the latest patch? It'd be nice to
not have to delay the release for this.

--
nosy: +benjamin.peterson

___
Python tracker 

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



[issue2016] Crash when modifying the **kwargs passed to a function.

2009-06-25 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc  added the comment:

Fixed in trunk with r73564.

I performed performance tests: differences with pybench were negligible 
(<1%), but a specially crafted case like:
   kw = dict(a=1, b=2, c=3)
   for x in xrange(self.rounds):
  f(**kw)
showed an improvement of 21%!

Will backport to various branches after 3.1 is out.

--
assignee:  -> amaury.forgeotdarc
resolution:  -> fixed
status: open -> pending

___
Python tracker 

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



[issue6344] mmap.read() crashes when passed a negative argument

2009-06-25 Thread Hirokazu Yamamoto

Hirokazu Yamamoto  added the comment:

> I don't know what mf.read(-1) should do
I'm not sure neither.

I think the problem is that mmap uses size_t as length, but uses
Py_ssize_t for PyArg_ParseTuple. (PyArg_ParseTuple doesn't support
size_t) I think this discrepancy should be fixed.

If mmap should use size_t because it should cover all possible memory
region which size_t can represent but Py_ssize_t cannot, maybe should
PyArg_ParseTuple support size_t?

--

___
Python tracker 

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



[issue6233] ElementTree (py3k) doesn't properly encode characters that can't be represented in the specified encoding

2009-06-25 Thread Martin v . Löwis

Martin v. Löwis  added the comment:

I disagree with this report being classified as release-critical - it is
*not* a regression over 3.0 (i.e. 3.0 already behaved in the same way).
That it is a regression relative to 2.x should not make it
release-critical - we can still fix such regressions in 3.2.

In addition, there is an easy work-around for applications that run into
the problem - just use utf-8 as the output encoding always:

py> e = ET.XML(b"t\xe3t")
py> ET.tostring(e,encoding='utf-8')
b't\xc3\xa3t'

--
nosy: +loewis

___
Python tracker 

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



[issue6345] extra characters displayed when writing to sys.stdout.buffer

2009-06-25 Thread Mark Tolonen

Mark Tolonen  added the comment:

Sorry, msg.replace('Issue ','Issue 4571').

--

___
Python tracker 

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



[issue6345] extra characters displayed when writing to sys.stdout.buffer

2009-06-25 Thread Benjamin Peterson

Benjamin Peterson  added the comment:

This is because write() is returning the number of characters it wrote
and that is displayed at the prompt.

--
nosy: +benjamin.peterson
resolution:  -> works for me
status: open -> closed

___
Python tracker 

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



[issue6345] extra characters displayed when writing to sys.stdout.buffer

2009-06-25 Thread Mark Tolonen

New submission from Mark Tolonen :

According to Issue , sys.stdout.buffer is the binary stream 
underlying stdout.  I see the following behavior on 3.0.1 and 3.1rc2 
when writing to a console window:

Python 3.1rc2 (r31rc2:73414, Jun 13 2009, 16:43:15) [MSC v.1500 32 bit 
(Intel)]
on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> 
sys.stdout.buffer.write('hello\u200bworld'.encode('cp437','replace'))
hello?world11

Notice the extra '11' at the end of the string.

--
components: IO
messages: 89719
nosy: metolone
severity: normal
status: open
title: extra characters displayed when writing to sys.stdout.buffer
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



[issue6233] ElementTree (py3k) doesn't properly encode characters that can't be represented in the specified encoding

2009-06-25 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

+1 for Py3.1.1

--
nosy: +rhettinger

___
Python tracker 

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