[issue10278] add time.wallclock() method

2011-07-07 Thread Matt Joiner

Matt Joiner  added the comment:

What's the status of this bug? This is a very useful feature, I've had to use 
and add bindings to monotonic times for numerous applications. Can it make it 
into 3.3?

--

___
Python tracker 

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



[issue8271] str.decode('utf8', 'replace') -- conformance with Unicode 5.2.0

2011-07-07 Thread Saul Spatz

Changes by Saul Spatz :


--
nosy: +spatz123

___
Python tracker 

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



[issue12511] class/instance xyz has no attribute '_abc'

2011-07-07 Thread Andreas Hasenkopf

New submission from Andreas Hasenkopf :

I'm using 64bit Arch Linux and Python 2.7.2 compiled with GCC 4.6.1.

I have noticed in several ocassions that the interpreter is complaining about

AttributeError: XMLGenerator instance has no attribute '_write' (in case of 
module xml.sax.saxutils.XMLGenerator)

or

AttributeError: RendererGDK instance has no attribute '_text2path' (in case of 
matplotlib when trying to use TeX formatting of text)

When I have a look into the corresponding modules I can clearly see method 
definitions (e.g. def _write(self, text) in line 97 of xml/sax/saxutils.py

I have no clue, why it is happening in some modules, but not in others. If a 
write my own module containing a class with a _write method it is working fine.
If I write a class derived from xml.sax.saxutils.XMLGenerator and overwrite the 
_write method it is known to the system, but many of the attributes beginning 
with an underscore appear still to be unknown...

This is very odd?!

--
components: XML
messages: 139966
nosy: Andreas.Hasenkopf
priority: normal
severity: normal
status: open
title: class/instance xyz has no attribute '_abc'
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



[issue9242] unicodeobject.c: use of uninitialized values

2011-07-07 Thread STINNER Victor

Changes by STINNER Victor :


--
nosy: +haypo

___
Python tracker 

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



[issue5505] sys.stdin.read() doesn't return after first EOF on Windows

2011-07-07 Thread STINNER Victor

Changes by STINNER Victor :


--
nosy: +haypo

___
Python tracker 

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



[issue10117] Tools/scripts/reindent.py fails on non-UTF-8 encodings

2011-07-07 Thread STINNER Victor

STINNER Victor  added the comment:

> Leaving open to discuss whether anything can/should be done
> for the case when reindent acts as an stdin

sys.stdin.buffer and sys.stdout.buffer should be used with 
tokenize.detect_encoding(). We may read first stdin and write it into a BytesIO 
object to be able to rewind after detect_encoding. Something like:

content = sys.stdin.buffer.read()
raw = io.BytesIO(content)
buffer = io.BufferedReader(raw)
encoding, _ = detect_encoding(buffer.readline)
buffer.seek(0)
text = TextIOWrapper(buffer, encoding)
# use text

--
nosy: +haypo

___
Python tracker 

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



[issue10284] NNTP should accept bytestrings for username and password

2011-07-07 Thread STINNER Victor

Changes by STINNER Victor :


--
components: +Unicode
nosy: +haypo

___
Python tracker 

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



[issue10945] bdist_wininst depends on MBCS codec, unavailable on non-Windows

2011-07-07 Thread STINNER Victor

STINNER Victor  added the comment:

Can't you only work with Unicode and avoid the MBCS encoding?

--
nosy: +haypo

___
Python tracker 

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



[issue10872] Add mode to TextIOWrapper repr

2011-07-07 Thread STINNER Victor

Changes by STINNER Victor :


--
nosy: +haypo

___
Python tracker 

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



[issue12512] codecs: StreamWriter issue with stateful codecs after a seek

2011-07-07 Thread STINNER Victor

New submission from STINNER Victor :

The following code fails with an AssertionError('###\ufeffdef'):

import codecs
_open = codecs.open
#_open = open
filename = "test"
with _open(filename, 'w', encoding='utf_16') as f:
f.write('abc')
pos = f.tell()
with _open(filename, 'w', encoding='utf_16') as f:
f.seek(pos)
f.write('def')
f.seek(0)
f.write('###')
with _open(filename, 'r', encoding='utf_16') as f:
content = f.read()
assert content == '###def', ascii(content)

It is a bug in StreamWriter.seek(): it should update the encoder state to not 
write a new BOM. It has to be fixed in the StreamWriter class of each stateful 
codec, or a stateful StreamWriter class should be implemented in the codecs 
module.

Python supports the following stateful codecs:

 * cp932
 * cp949
 * cp950
 * euc_jis_2004
 * euc_jisx2003
 * euc_jp
 * euc_kr
 * gb18030
 * gbk
 * hz
 * iso2022_jp
 * iso2022_jp_1
 * iso2022_jp_2
 * iso2022_jp_2004
 * iso2022_jp_3
 * iso2022_jp_ext
 * iso2022_kr
 * shift_jis
 * shift_jis_2004
 * shift_jisx0213
 * utf_8_sig
 * utf_16
 * utf_32

This bug has already been fixed in TextIOWrapper: issue #5006.

--
messages: 139969
nosy: haypo
priority: normal
severity: normal
status: open
title: codecs: StreamWriter issue with stateful codecs after a seek
versions: Python 2.7, Python 3.2, Python 3.3

___
Python tracker 

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



[issue12512] codecs: StreamWriter issues with stateful codecs after a seek or with append mode

2011-07-07 Thread STINNER Victor

STINNER Victor  added the comment:

There is a similar bug for append mode:

import codecs
_open = codecs.open
#_open = open
filename = "test"
with _open(filename, 'w', encoding='utf_16') as f:
f.write('abc')
with _open(filename, 'a', encoding='utf_16') as f:
f.write('def')
with _open(filename, 'r', encoding='utf_16') as f:
content = f.read()
assert content == 'abcdef', ascii(content)

This bug has also been fixed by the issue #5006 in the io module.

--
title: codecs: StreamWriter issue with stateful codecs after a seek -> codecs: 
StreamWriter issues with stateful codecs after a seek or with append mode

___
Python tracker 

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



[issue12391] packaging install fails to clean up temp files

2011-07-07 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset a4405b799e1b by Vinay Sajip in branch 'default':
Closes #12391: temporary files are now cleaned up.
http://hg.python.org/cpython/rev/a4405b799e1b

--
nosy: +python-dev
resolution:  -> fixed
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



[issue10647] scrollbar crash in non-US locale format settings

2011-07-07 Thread Hans Bering

Hans Bering  added the comment:

Ok, _now_ I have run into the same problem. I have attached a small script 
similar to the original entry (but shorter) which will reliably crash with 
Python 3.1.4 on Windows 7 (64bit) when using a locale with a comma decimal 
fraction marker (e.g., German). The stacktrace is as follows:

Exception in Tkinter callback
Traceback (most recent call last):
  File "C:\Python31\lib\tkinter\__init__.py", line 1400, in __call__
return self.func(*args)
  File "C:\Python31\lib\tkinter\__init__.py", line 2799, in set
self.tk.call((self._w, 'set') + args)
_tkinter.TclError: expected floating-point number but got "0,2"

The script runs fine with an English locale. It also runs fine with Python 3.2 
on the same machine & Windows & German locale.

The reason seems to be that the Scrollbar lets its self.tk compute fractions 
which self.tk returns as locale-dependent strings; the Scrollbar runs into 
problems when converting these strings into floats.

--
Added file: http://bugs.python.org/file22603/scrollbarCrash1.py

___
Python tracker 

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



[issue10647] scrollbar crash in non-US locale format settings

2011-07-07 Thread Hans Bering

Changes by Hans Bering :


Removed file: http://bugs.python.org/file22535/tkinterCrash.py

___
Python tracker 

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



[issue12167] test_packaging reference leak

2011-07-07 Thread Andreas Stührk

Andreas Stührk  added the comment:

Attached is a patch that replaces `lib2to3.fixer_Base.BaseFix.set_filename()` 
during tests. With the patch applied, I don't get any refleaks for packaging.

Another approach would be to simply remove the logging attribute of lib2to3 
fixers, as it isn't used anyway.

--
keywords: +patch
nosy: +benjamin.peterson
Added file: http://bugs.python.org/file22604/issue12167_patch_2to3.patch

___
Python tracker 

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



[issue10945] bdist_wininst depends on MBCS codec, unavailable on non-Windows

2011-07-07 Thread Ralf Schlatterbeck

Ralf Schlatterbeck  added the comment:

On Thu, Jul 07, 2011 at 10:52:51AM +, STINNER Victor wrote:
> 
> Can't you only work with Unicode and avoid the MBCS encoding?

I'm trying to build a windows binary package on Linux. This usually
works fine -- as long as the package description doesn't contain
unicode. If it *contains* unicode it will somehow internally use MBCS
encoding.
So if someone fixes windows binary package building on non-windows
platforms to not use MBCS encoding this is fine with me. But maybe the
easier way out here is to include that codec on all platforms.

(and don't tell me I have to install windows for building a windows
binary package :-)

Thanks, Ralf
-- 
Dr. Ralf Schlatterbeck  Tel:   +43/2243/26465-16
Open Source Consulting  www:   http://www.runtux.com
Reichergasse 131, A-3411 Weidling   email: off...@runtux.com
osAlliance member   email: r...@osalliance.com

--

___
Python tracker 

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



[issue12513] codec.StreamReaderWriter: issues with interlaced read-write

2011-07-07 Thread STINNER Victor

New submission from STINNER Victor :

The following test fails with an AssertionError('a' != 'b') on the first read.

import codecs

FILENAME = 'test'

with open(FILENAME, 'wb') as f:
f.write('abcd'.encode('utf-8'))
with codecs.open(FILENAME, 'r+', encoding='utf-8') as f:
f.write("1")

pos = f.writer.tell()
assert pos == 1, "writer pos: %s != 1" % pos
pos = f.reader.tell()
assert pos == 1, "reader pos: %s != 1" % pos
pos = f.stream.tell()
assert pos == 1, "stream pos: %s != 1" % pos

# read() must call writer.flush()
char = f.read(1)
assert char == 'b', "%r != 'b'" % (char,)
# write() must rewind the raw stream
f.write('3')
tail = f.read()
assert tail == 'd', "%r != 'd'" % (tail,)
f.flush()
with open(FILENAME, 'rb') as f:
assert f.read() == b'1b3d'

I suppose that readline(), readlines() and __next__() have also issues.

See also issue #12215: similar issue with io.TextIOWrapper.

--
components: Library (Lib), Unicode
messages: 139975
nosy: haypo
priority: normal
severity: normal
status: open
title: codec.StreamReaderWriter: issues with interlaced read-write
versions: Python 2.7, Python 3.2, Python 3.3

___
Python tracker 

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



[issue12511] class/instance xyz has no attribute '_abc'

2011-07-07 Thread Andreas Hasenkopf

Andreas Hasenkopf  added the comment:

I'd like to mention that Python 2.6.7 does not show this erroneous behavior. In 
Python 2.6.7 I can call the _write method of xml.sax.saxutils.XMLGenerator...

Is this a bug or a feature in 2.7??

--
components:  -XML

___
Python tracker 

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



[issue12511] class/instance xyz has no attribute '_abc'

2011-07-07 Thread Andreas Hasenkopf

Andreas Hasenkopf  added the comment:

The problem appeared to be the package from the Arch Linux repo.
Compiling the source codes myselfes gave me a Python interpreter not showing 
this bug...

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

___
Python tracker 

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



[issue12506] NIS module cant handle multiple NIS map entries for the same GID

2011-07-07 Thread bjorn lofdahl

Changes by bjorn lofdahl :


--
versions: +Python 3.1, Python 3.2, Python 3.3, Python 3.4 -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



[issue12506] NIS module cant handle multiple NIS map entries for the same GID

2011-07-07 Thread bjorn lofdahl

Changes by bjorn lofdahl :


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



[issue12511] class/instance xyz has no attribute '_abc'

2011-07-07 Thread Benjamin Peterson

Changes by Benjamin Peterson :


--
resolution: accepted -> invalid

___
Python tracker 

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



[issue12514] timeit disables garbage collection if timed code raises an exception

2011-07-07 Thread Gareth Rees

New submission from Gareth Rees :

If you call timeit.timeit and the timed code raises an exception, then garbage 
collection is disabled. I have verified this in Python 2.7 and 3.2. Here's an 
interaction with Python 3.2:

Python 3.2 (r32:88445, Jul  7 2011, 15:52:49) 
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import timeit, gc
>>> gc.isenabled()
True
>>> timeit.timeit('raise Exception')
Traceback (most recent call last):
  File "", line 1, in 
  File 
"/opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/timeit.py",
 line 228, in timeit
return Timer(stmt, setup, timer).timeit(number)
  File 
"/opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/timeit.py",
 line 194, in timeit
timing = self.inner(it, self.timer)
  File "", line 6, in inner
Exception
>>> gc.isenabled()
False

The problem is with the following code in Lib/timeit.py (lines 192–196):

gcold = gc.isenabled()
gc.disable()
timing = self.inner(it, self.timer)
if gcold:
gc.enable()

This should be changed to something like this:

gcold = gc.isenabled()
gc.disable()
try:
timing = self.inner(it, self.timer)
finally:
if gcold:
gc.enable()

--
components: Library (Lib)
messages: 139978
nosy: Gareth.Rees
priority: normal
severity: normal
status: open
title: timeit disables garbage collection if timed code raises an exception
type: behavior
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



[issue10403] Use "member" consistently

2011-07-07 Thread Éric Araujo

Éric Araujo  added the comment:

Senthil, I’m not sure you read Alexander’s reply on Rietveld before committing.

--

___
Python tracker 

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



[issue12514] timeit disables garbage collection if timed code raises an exception

2011-07-07 Thread Gareth Rees

Gareth Rees  added the comment:

Patch attached.

--
keywords: +patch
Added file: http://bugs.python.org/file22605/issue12514.patch

___
Python tracker 

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



[issue12514] timeit disables garbage collection if timed code raises an exception

2011-07-07 Thread Raymond Hettinger

Changes by Raymond Hettinger :


--
assignee:  -> rhettinger
nosy: +rhettinger

___
Python tracker 

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



[issue12514] timeit disables garbage collection if timed code raises an exception

2011-07-07 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

Thank you.  The patch looks correct.  I will apply it as soon as I get a chance.

--

___
Python tracker 

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



[issue12515] The email package modifies the message structure (when the parsed email is invalid)

2011-07-07 Thread xavierd

New submission from xavierd :

the function 'email.message_from_file' modifies the message structure when the 
parsed is invalid (for example, when a closed boudary is missing). The 
attribute defects is also empty

In the attachment (sample.tgz) you will find:
   - orig.eml : an email with an invalid structure The boundary
"000101020201080900040301" isn't closed
   - after_parsing.eml: same email after calling email.message_from_file()
The boundary is now closed. And the defects attribute is empty
   - test.py: python script to reproduce.

--
components: None
files: sample.tgz
messages: 139982
nosy: r.david.murray, xavierd
priority: normal
severity: normal
status: open
title: The email package modifies the message structure (when the parsed email 
is invalid)
versions: Python 2.6, Python 2.7
Added file: http://bugs.python.org/file22606/sample.tgz

___
Python tracker 

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



[issue12504] packaging: fix uninstall and stop skipping its tests

2011-07-07 Thread Éric Araujo

Éric Araujo  added the comment:

Thanks for that!  I agree that it’s a fake optimization to work with generators 
instead of lists when the list is small or when we depend on other resources 
like file handles.  There are a few methods we could change in the database 
module.

The patch looks good, except that I wouldn’t move code to a nested function, 
but just change the “yield spam” line to “results.append(spam)”.

In our message, is the test log showing failure something you got before making 
changes or after?  IOW, does the patch fixes the bug?

--
assignee: tarek -> eric.araujo
stage:  -> patch review
title: Uninstall has disabled windows tests -> packaging: fix uninstall and 
stop skipping its tests

___
Python tracker 

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



[issue12167] test_packaging reference leak

2011-07-07 Thread Éric Araujo

Éric Araujo  added the comment:

Thanks a lot for the diagnosis.

To fix it, I don’t find the monkey-patching approach very good, I’d prefer 
properly using the logging API to remove handlers upon cleanup.  Would you like 
to look into that?

--

___
Python tracker 

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



[issue12167] test_packaging reference leak

2011-07-07 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> To fix it, I don’t find the monkey-patching approach very good, I’d
> prefer properly using the logging API to remove handlers upon cleanup.

I don't think such stuff exists.

--

___
Python tracker 

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



[issue12167] test_packaging reference leak

2011-07-07 Thread Éric Araujo

Éric Araujo  added the comment:

See http://hg.python.org/cpython/file/tip/Lib/packaging/tests/support.py#l81

--

___
Python tracker 

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



[issue12167] test_packaging reference leak

2011-07-07 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> See http://hg.python.org/cpython/file/tip/Lib/packaging/tests/support.py#l81

AFAIU, the problem is that 2to3 creates a whole new logger for each
different file. So it's not about cleaning the handlers, but cleaning up
the loggers as well. And logging (deliberately, according to Vinay)
doesn't provide any API to destroy loggers (they are de facto eternal).

--

___
Python tracker 

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



[issue12167] test_packaging reference leak

2011-07-07 Thread Éric Araujo

Éric Araujo  added the comment:

Thanks for clarifying, I had misread.  IMO, using one logger per file is a 
lib2to3 bug.

--

___
Python tracker 

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



[issue12504] packaging: fix uninstall and stop skipping its tests

2011-07-07 Thread Thomas Holmes

Thomas Holmes  added the comment:

The output in my initial message is the output of the tests with them enabled 
but pre database.py patch. Once the patch is applied all packaging tests that 
run on my system pass.

I was 50/50 on whether or not to use the internal function and I just sort of 
ended up with it. I had started out writing some more complex map/list 
comprehension stuff and the function made sense at the time.

Regarding the use of yield, at least one of the other functions that uses the 
_get_records function yields the result of _get_records. I figured those could 
be altered to just return the list directly but I decided to opt for the path 
of least modification prior to getting input.

If you think it is a good idea I will modify the patch to remove the 
unnecessary yields and insert the nested function code directly in _get_records 
instead.

--

___
Python tracker 

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



[issue12504] packaging: fix uninstall and stop skipping its tests

2011-07-07 Thread Thomas Holmes

Thomas Holmes  added the comment:

Oh and thank you very much for your input. My apologies for the initial 9 
e-mail spam when I created the issue, I bumbled the remote HG repository patch 
generation :)

--

___
Python tracker 

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



[issue12183] Document behaviour of shutil.copy2 and copystat with symlinks

2011-07-07 Thread Petri Lehtinen

Petri Lehtinen  added the comment:

Shouldn't at least shutil.copytree() use lutimes in Python 3.3 to copy symlink 
metadata if symlinks=True?

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



[issue12183] Document behaviour of shutil.copy2 and copystat with symlinks

2011-07-07 Thread Petri Lehtinen

Petri Lehtinen  added the comment:

Attached a patch that documents the behavior of copy2() and copytree() for 
symlinks.

--
keywords: +needs review, patch
stage:  -> patch review
Added file: http://bugs.python.org/file22607/copy2_copytree_symlinks_2.7.patch

___
Python tracker 

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



[issue12183] Document behaviour of shutil.copy2 and copystat with symlinks

2011-07-07 Thread Petri Lehtinen

Changes by Petri Lehtinen :


--
nosy: +tarek

___
Python tracker 

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



[issue12516] imghdr.what should take one argument

2011-07-07 Thread Jeffrey Finkelstein

New submission from Jeffrey Finkelstein :

Currently imghdr.what() accepts two parameters. The first is a file or filename 
and the second is a byte stream. If the second is not None, the first is 
ignored. This is clunky. It would be simpler to accept just one argument, which 
can be either an open file or a byte stream.

I have attached a patch which implements this one argument approach as private 
function imghdr_what(). I have left imghdr.what() as a wrapper around this new 
function for backwards compatibility (in the hopes that it will eventually be 
replaced).

In addition, there did not seem to be any tests for the imghdr module, so I 
added a few simple tests.

--
components: Library (Lib)
files: imghdr.patch
keywords: patch
messages: 139993
nosy: jfinkels
priority: normal
severity: normal
status: open
title: imghdr.what should take one argument
type: feature request
versions: Python 3.4
Added file: http://bugs.python.org/file22608/imghdr.patch

___
Python tracker 

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



[issue5505] sys.stdin.read() doesn't return after first EOF on Windows

2011-07-07 Thread STINNER Victor

STINNER Victor  added the comment:

I am still able to reproduce the problem with Python 3.2.1RC1 (64 bits) on 
Windows Seven, but not on Python 3.3 (alpha) compiled myself (using Visual C++ 
Express 2008).

I don't know if something changed in Python 3.3, or it is related to how I 
compiled Python? I don't think that it is related to issue #12016 because 
Python 3.2.1RC1 contains the fix for #12016.

--

___
Python tracker 

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



[issue5505] sys.stdin.read() doesn't return after first EOF on Windows

2011-07-07 Thread STINNER Victor

STINNER Victor  added the comment:

> I don't know if something changed in Python 3.3, or ...

Yes, something changed in Python 3.3. I fixed this issue "by mistake" :-) The 
fix is the following commit:

New changeset 3c7792ec4547 by Victor Stinner in branch 'default':
Issue #12175: BufferedReader.read(-1) now calls raw.readall() if available.
http://hg.python.org/cpython/rev/3c7792ec4547

It is a bug in BufferedReader, a bug or an unexpected behaviour. Before this 
commit (e.g. in Python 3.2.0), BufferedReader.read(-1) calls raw.read() two 
times for this issue: the first call returns an non empty string (the string 
until the first ^Z), the second call returns an empty string (the string until 
the second ^Z). BufferedReader.read(-1) loop ends with raw.read() returns an 
empty string.

You can workaround this issue by calling sys.stdin.buffer.raw.readall() or 
sys.stdin.buffer.raw.read(-1).

I chose to not port my BufferedRead.read(-1) fix (call raw.readall() if 
available) in Python 3.2 because it changes the behaviour, and I don't want to 
do that in a minor release.

Is anyone in favor of changing the behaviour of BufferedRead.read(-1) in a 
minor release (next 2.7.3 and 3.2.2)? Or can I close the issue (the bug is 
already fixed in Python 3.3)?

--

___
Python tracker 

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



[issue10883] urllib: socket is not closed explicitly

2011-07-07 Thread Nadeem Vawda

Nadeem Vawda  added the comment:

Updated patch with fixed refcounting mechanism. Also fixes clear_cache() in
CacheFTPWrapper to leave the cache in a consistent state for subsequent use.

--
Added file: http://bugs.python.org/file22609/issue10883-v2.patch

___
Python tracker 

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



[issue12517] Large file support on Windows: sizeof(off_t) is 32 bits

2011-07-07 Thread STINNER Victor

New submission from STINNER Victor :

FileIO.readall() and _parse_off_t() help of the posix module use the off_t 
type. This type is only 32 bits long and so don't support files bigger than 4 
GB (or maybe just 2 GB?). The Py_off_t type should be used instead.

--
components: Windows
messages: 139997
nosy: haypo, loewis, pitrou
priority: normal
severity: normal
status: open
title: Large file support on Windows: sizeof(off_t) is 32 bits
versions: Python 2.7, Python 3.2, Python 3.3

___
Python tracker 

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



[issue12517] Large file support on Windows: sizeof(off_t) is 32 bits

2011-07-07 Thread STINNER Victor

STINNER Victor  added the comment:

fileio_py_off_t.patch: Fix for FileIO.readall().

The consequence of the integer overflow in new_buffersize() looks to be that 
the buffer can be too small in some cases (and so readall() can be very slow?).

--
keywords: +patch
Added file: http://bugs.python.org/file22610/fileio_py_off_t.patch

___
Python tracker 

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



[issue12517] Large file support on Windows: sizeof(off_t) is 32 bits

2011-07-07 Thread STINNER Victor

STINNER Victor  added the comment:

_parse_off_t() is used by the following functions:
- lockf
- pread, pwrite
- sendfile
- truncate, ftruncate
- posix_advice, posix_fallocate

Windows has none of these functions. _parse_off_t() may be surrounded by 
#ifndef MS_WINDOWS with a comment explaining that Py_off_t should be used on 
Windows to support large files.

--

___
Python tracker 

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



[issue9566] Compilation warnings under x64 Windows

2011-07-07 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 43fd627cc060 by Victor Stinner in branch 'default':
Issue #9566: cast unsigned int to Py_ssize_t in md5 and sha1 modules
http://hg.python.org/cpython/rev/43fd627cc060

--
nosy: +python-dev

___
Python tracker 

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



[issue10117] Tools/scripts/reindent.py fails on non-UTF-8 encodings

2011-07-07 Thread STINNER Victor

STINNER Victor  added the comment:

reindent_coding.py: patch fixing reindent.py when using pipes (stdin and 
stdout).

--
versions: +Python 3.3
Added file: http://bugs.python.org/file22611/reindent_coding.py

___
Python tracker 

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



[issue12178] csv writer doesn't escape escapechar

2011-07-07 Thread Éric Araujo

Éric Araujo  added the comment:

Thanks for the patch.  The tests look good at first glance.  I can’t comment on 
the C code, I don’t know C.  Hopefully someone will do it, otherwise if you 
don’t get feedback in say four weeks you can ask for a review on python-dev.

--
keywords: +needs review
stage:  -> patch review
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



[issue10117] Tools/scripts/reindent.py fails on non-UTF-8 encodings

2011-07-07 Thread Éric Araujo

Éric Araujo  added the comment:

This is a lot more code than what I’d have expected.

What is your opinion on my previous message?

--

___
Python tracker 

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



[issue12016] Wrong behavior for '\xff\n'.decode('gb2312', 'ignore')

2011-07-07 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 16cbd84de848 by Victor Stinner in branch 'default':
Issue #12016: Multibyte CJK decoders now resynchronize faster
http://hg.python.org/cpython/rev/16cbd84de848

--

___
Python tracker 

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



[issue10117] Tools/scripts/reindent.py fails on non-UTF-8 encodings

2011-07-07 Thread STINNER Victor

STINNER Victor  added the comment:

> When working as a filter, reindent should use sys.{stdin,stdout}.encoding
> (defaulting to sys.getdefaultencoding()) for reading and writing,
> respectively.

It just doesn't work: you cannot read a ISO-8859-1 file from UTF-8 (if your 
locale encoding is UTF-8).

--

___
Python tracker 

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



[issue12016] Wrong behavior for '\xff\n'.decode('gb2312', 'ignore')

2011-07-07 Thread STINNER Victor

STINNER Victor  added the comment:

> Because I consider this issue as a bug, I would like
> to apply this patch to 2.7, 3.2 and 3.3.

It is maybe a bug but it is also an important change on Python behaviour, so 
finally I prefer to only change (fix) Python 3.3.

Thanks for reporting the bug zy (cdqzzy). Tell me if it now behaves as you 
expected.

I'm closing this issue because the initial issue is now fixed.

--
resolution:  -> fixed
status: open -> closed
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



[issue12501] callable(): remove/amend the deprecation warning in Python 2.7

2011-07-07 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 1f814faaf54d by Victor Stinner in branch '2.7':
Close #12501: Adjust callable() warning: callable() is only not supported in
http://hg.python.org/cpython/rev/1f814faaf54d

--
nosy: +python-dev
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



[issue12423] signal handler doesn't handle SIGABRT from os.abort

2011-07-07 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 1ac21a715c5d by Victor Stinner in branch '2.7':
Issue #12423: Fix os.abort() documentation
http://hg.python.org/cpython/rev/1ac21a715c5d

New changeset 4e83d8f6d496 by Victor Stinner in branch '3.2':
Issue #12423: Fix os.abort() documentation
http://hg.python.org/cpython/rev/4e83d8f6d496

New changeset e3c115ba8dc0 by Victor Stinner in branch 'default':
(merge 3.2) Issue #12423: Fix os.abort() documentation
http://hg.python.org/cpython/rev/e3c115ba8dc0

--
nosy: +python-dev

___
Python tracker 

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



[issue12423] signal handler doesn't handle SIGABRT from os.abort

2011-07-07 Thread STINNER Victor

STINNER Victor  added the comment:

> Here's my proposed patch for the documentation, against
> the head of the 2.7 branch.

Thanks, I applied your pach to 2.7, 3.2 and 3.3 doc.

--
resolution:  -> fixed
status: open -> closed
versions: +Python 3.2, Python 3.3 -Python 2.6

___
Python tracker 

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



[issue12429] test_io.check_interrupted_write() sporadic failures on FreeBSD 6 on Python 2.7/3.2

2011-07-07 Thread STINNER Victor

Changes by STINNER Victor :


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



[issue12518] In string.Template it's impossible to transform delimiter in the derived class

2011-07-07 Thread py.user

New submission from py.user :

>>> import string
>>> class MyTemplate(string.Template):
...   delimiter = '.'
... 
>>> MyTemplate.delimiter = 'x'
>>> mt = MyTemplate('.field xfield')
>>> mt.substitute(field=None)
'None xfield'
>>> mt.delimiter
'x'
>>>


If I want to change the pattern string by any delimiter, I should create a new 
class for every delimiter

I would change the delimiter either in the object or in the class at any time

--
components: Library (Lib)
messages: 140010
nosy: py.user
priority: normal
severity: normal
status: open
title: In string.Template it's impossible to transform delimiter in the derived 
class
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



[issue11230] "Full unicode import system" not in 3.2

2011-07-07 Thread Ned Deily

Changes by Ned Deily :


--
nosy: +georg.brandl

___
Python tracker 

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



[issue12504] packaging: fix uninstall and stop skipping its tests

2011-07-07 Thread Thomas Holmes

Thomas Holmes  added the comment:

I have made the change you suggested, creating a new list and simply amending 
to minimize the diff. This new patch has been attached.

I looked through the rest of database.py and did not see any other generators 
that appeared to erroneously hold a file handle open. If you are able to 
identify one that actually is a problem I would be happy to change it.

In addition there is one generator function (list_distinfo_files) which feeds 
off of the generator I have changed but I didn't see a need to alter them as 
they work fine as generators.

--

___
Python tracker 

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



[issue12504] packaging: fix uninstall and stop skipping its tests

2011-07-07 Thread Thomas Holmes

Changes by Thomas Holmes :


Added file: http://bugs.python.org/file22612/6e15ba060803.diff

___
Python tracker 

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



[issue12326] Linux 3: tests should avoid using sys.platform == 'linux2'

2011-07-07 Thread STINNER Victor

STINNER Victor  added the comment:

@neologix: I don't understand why do you want to hurry, this issue will not be 
fixed in the next release (3.2.1, it's too late), and I don't think that the 
next release (3.3? or is it something before?) will come before few months.

--

I don't think that replacing "linux3" by "linux" for sys.platform does change 
anything. I agree with neologix:

> Any application relying on sys.platform == 'linux2' is already broken.

Even if we change sys.platform in Python 2.7.3, 3.2.2 and/or 3.3, I bet that 
some Linux distro will bundle older versions with Linux 3. It means that we 
will have "linux2", "linux3", "linux". It is just worse.

--

I propose to just patch the code checking for linux2 where it is inappropriate. 
I attached linux3.patch: patch for Python 3.2 fixing mention of linux2. It 
replaces sys.platform == 'linux2' by sys.platform in ('linux2', 'linux3'), 
os.uname()[0] == 'Linux' or platform.system() == 'Linux', depending on the 
context. In setup.py, I used os.uname()[0] to avoid bootstrap issues, but it is 
maybe possible to use platform.system() there.

--

@loewis: What is the code responsable to use/load Lib/plat-* modules?

Can we use a symlink from plat-linux2 to plat-linux3? Or should we copy the 
whole directory?

--

@lemburg: What will be the value of sys.system on Cygwin? "windows" or 
"cygwin"? It looks like sys.platform is "cygwin" if Python was compiled using 
Cygwin, "win32" if Python was compiled using Visual Studio. sys.system is maybe 
redundant with platform.system() (except that platform requires to call 
os.uname, but only once).

@lemburg: sys.system_info looks to be redundant with the platform module.

--
keywords: +patch
Added file: http://bugs.python.org/file22613/linux3.patch

___
Python tracker 

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



[issue12181] SIGBUS error on OpenBSD (sparc64)

2011-07-07 Thread STINNER Victor

STINNER Victor  added the comment:

@neologix: New try. Why did you remove your patch?

--

___
Python tracker 

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



[issue1195571] simple callback system for Py_FatalError

2011-07-07 Thread STINNER Victor

STINNER Victor  added the comment:

> Sorry, the documentation in the patch is wrong

Can you update your patch please?

--

___
Python tracker 

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