[issue16059] Serialize MD5 computation-state and resume later

2012-09-26 Thread Ye Yuan

New submission from Ye Yuan:

Serialize/deserialize md5 context. Pseudocode:

import md5
# Start hash generation
m = md5.new()
m.update("Content")

# Serialize m
serialized_m = serialize(m)

# In another function/machine, deserialize m
# and continue hash generation
m2 = deserialize(serialized_m)
m2.update("More content")
m2.digest() 

There are C++ lib but no Python one.

--
components: Library (Lib)
messages: 171367
nosy: Ye.Yuan
priority: normal
severity: normal
status: open
title: Serialize MD5 computation-state and resume later
type: enhancement
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



[issue16048] Tutorial-classes-remarks: replace paragragh

2012-09-26 Thread Chris Rebert

Changes by Chris Rebert :


--
nosy: +cvrebert

___
Python tracker 

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



[issue16032] IDLE 3.2 is crashing multiple times

2012-09-26 Thread Ned Deily

Changes by Ned Deily :


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



[issue16036] simplify int() signature docs

2012-09-26 Thread Chris Jerdonek

Chris Jerdonek added the comment:

Ezio, do you want to commit this or should I?

--

___
Python tracker 

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



[issue16032] IDLE 3.2 is crashing multiple times

2012-09-26 Thread Omanand Jha Vatsa

Omanand Jha Vatsa added the comment:

Thanks Ned. It is working for me now. Followed your steps to verify the 
version. Thanks again.

--

___
Python tracker 

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



[issue16058] ConfigParser no longer deepcopy compatible in 2.7

2012-09-26 Thread Robert Collins

New submission from Robert Collins:

In 2.6 deepcopy(ConfigParser) worked, in 2.7 it doesn't due to the _optcre 
variable which is a compiled regex pattern.

--
components: Library (Lib)
messages: 171364
nosy: rbcollins
priority: normal
severity: normal
status: open
title: ConfigParser no longer deepcopy compatible in 2.7
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



[issue16057] Subclasses of JSONEncoder should not be insturcted to call JSONEncoder.decode

2012-09-26 Thread Justin Lebar

New submission from Justin Lebar:

The JSONEncoder documentation says we can implement our own encoder as:

  >>> class ComplexEncoder(json.JSONEncoder):
  ... def default(self, obj):
  ... if isinstance(obj, complex):
  ... return [obj.real, obj.imag]
  ... return json.JSONEncoder.default(self, obj)

Later on, we give the following example of how to implement the default method 
in a subclass of json.JSONEncoder:

  def default(self, o):
  try:
  iterable = iter(o)
  except TypeError:
  pass
  else:
  return list(iterable)
  return JSONEncoder.default(self, o)

These are both incorrect, as a quick reading of the source will reveal.  
JSONEncoder.default() throws for all input values.  We should 
s/JSONEncoder.default/JSONEncoder.encode/ here, I think.

--
assignee: docs@python
components: Documentation
messages: 171363
nosy: Justin.Lebar, docs@python
priority: normal
severity: normal
status: open
title: Subclasses of JSONEncoder should not be insturcted to call 
JSONEncoder.decode
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



[issue16056] shadowed test names in std lib regression tests

2012-09-26 Thread Chris Jerdonek

Chris Jerdonek added the comment:

Thanks a lot for the report.  Does the 2.7 branch have similar instances?

--
nosy: +ezio.melotti, michael.foord, pitrou

___
Python tracker 

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



[issue16056] shadowed test names in std lib regression tests

2012-09-26 Thread Chris Jerdonek

Changes by Chris Jerdonek :


--
nosy: +chris.jerdonek

___
Python tracker 

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



[issue16056] shadowed test names in std lib regression tests

2012-09-26 Thread Xavier de Gaye

New submission from Xavier de Gaye:

The attached script, named find_duplicate_test_names.py, prints
duplicate regression test method names in a given directory tree.
Running this script on the standard library test suite shows few
duplicates, see below.  It means that some of those tests are not
run while they are probably meant to be.

Here is find_duplicate_test_names.py output on the default branch:

$ ./python find_duplicate_test_names.py Lib/test
Duplicate test method names:
Lib/test/test_types.py: .ClassCreationTests.test_new_class_exec_body
Lib/test/test_heapq.py: .TestErrorHandling.test_get_only
Lib/test/test_complex.py: .ComplexTest.test_truediv
Lib/test/test_webbrowser.py: .OperaCommandTest.test_open_new
Lib/test/test_dis.py: .DisTests.test_big_linenos
Lib/test/test_dis.py: .DisTests.test_dis_object
Lib/test/test_import.py: .ImportTests.test_import_name_binding
Lib/test/test_email/test_email.py: .TestQuopri.test_encode_one_long_line
Lib/test/test_email/test_email.py: 
.TestLongHeaders.test_splitter_split_on_punctuation_only_if_fws

--
components: Library (Lib)
files: find_duplicate_test_names.py
messages: 171361
nosy: xdegaye
priority: normal
severity: normal
status: open
title: shadowed test names in std lib regression tests
type: behavior
versions: Python 3.3
Added file: http://bugs.python.org/file27315/find_duplicate_test_names.py

___
Python tracker 

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



[issue14771] Occasional failure in test_ioctl

2012-09-26 Thread Ezio Melotti

Ezio Melotti added the comment:

Can you still reproduce this issue? Do you use any specific flag to run the 
tests? What OS is this?
I tried on linux, solaris, and aix with ``./python -m test -F test_ioctl`` for 
about 1k loops, and couldn't reproduce the issue.

--
nosy: +ezio.melotti

___
Python tracker 

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



[issue11461] UTF-16 incremental decoder doesn't support partial surrogate pair

2012-09-26 Thread STINNER Victor

Changes by STINNER Victor :


--
title: Reading UTF-16 with codecs.readline() breaks on surrogate pairs -> 
UTF-16 incremental decoder doesn't support partial surrogate pair

___
Python tracker 

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



[issue11461] Reading UTF-16 with codecs.readline() breaks on surrogate pairs

2012-09-26 Thread STINNER Victor

Changes by STINNER Victor :


--
versions: +Python 3.2, Python 3.3, Python 3.4

___
Python tracker 

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



[issue16055] incorrect error text for int(base=1000, x='1')

2012-09-26 Thread Chris Jerdonek

Chris Jerdonek added the comment:

Locations:

Objects/longobject.c
1994:"int() arg 2 must be >= 2 and <= 36");
4273:"int() arg 2 must be >= 2 and <= 36");

--

___
Python tracker 

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



[issue15815] Add numerator to ZeroDivisionError messages

2012-09-26 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Not enough, at present, to leave this open.

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



[issue16055] incorrect error text for int(base=1000, x='1')

2012-09-26 Thread Chris Jerdonek

New submission from Chris Jerdonek:

The following error text is incorrect in at least one way:

>>> int(base=1000, x='1')
Traceback (most recent call last):
  File "", line 1, in 
ValueError: int() arg 2 must be >= 2 and <= 36

The *base* argument can also be 0.  Secondly, the text should probably say 
"base arg" instead of "arg 2" since 1000 is not in position 2.

The 2.7 code does not have the second issue:

>>> int(base=1000, x='1')
Traceback (most recent call last):
  File "", line 1, in 
ValueError: int() base must be >= 2 and <= 36

--
components: Library (Lib)
keywords: easy
messages: 171357
nosy: chris.jerdonek, ezio.melotti
priority: normal
severity: normal
stage: test needed
status: open
title: incorrect error text for int(base=1000, x='1')
type: behavior
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



[issue4733] Add a "decode to declared encoding" version of urlopen to urllib

2012-09-26 Thread Lino Mastrodomenico

Lino Mastrodomenico added the comment:

FYI, the exact algorithm for determining the encoding of HTML documents is 
http://www.whatwg.org/specs/web-apps/current-work/multipage/parsing.html#determining-the-character-encoding

There are lots of different algorithms documented all over the intertubes for 
determining HTML encoding; the one above is the one used by browsers.

But that should only be used as part of a full HTML parsing library (e.g. 
https://code.google.com/p/html5lib/), urlopen should not attempt to do encoding 
sniffing from the data transferred.

--

___
Python tracker 

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



[issue15815] Add numerator to ZeroDivisionError messages

2012-09-26 Thread Mark Dickinson

Mark Dickinson added the comment:

I'll add my -1 to this;  I don't really see the use.

--

___
Python tracker 

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



[issue15815] Add numerator to ZeroDivisionError messages

2012-09-26 Thread Ezio Melotti

Ezio Melotti added the comment:

Terry, do you still think that adding the numerator would be useful?

--

___
Python tracker 

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



[issue13248] deprecated in 3.2/3.3, should be removed in 3.4

2012-09-26 Thread Ezio Melotti

Changes by Ezio Melotti :


--
title: deprecated in 3.2, should be removed in 3.3 -> deprecated in 3.2/3.3, 
should be removed in 3.4
versions: +Python 3.4 -Python 3.3

___
Python tracker 

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



[issue6975] symlinks incorrectly resolved on Linux

2012-09-26 Thread Ezio Melotti

Changes by Ezio Melotti :


--
keywords: +easy

___
Python tracker 

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



[issue7300] Unicode arguments in str.format()

2012-09-26 Thread Ezio Melotti

Changes by Ezio Melotti :


--
nosy: +chris.jerdonek
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



[issue4733] Add a "decode to declared encoding" version of urlopen to urllib

2012-09-26 Thread Ezio Melotti

Changes by Ezio Melotti :


--
versions: +Python 3.4 -Python 3.3

___
Python tracker 

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



[issue14886] json C vs pure-python implementation difference

2012-09-26 Thread Ezio Melotti

Changes by Ezio Melotti :


--
stage:  -> needs patch

___
Python tracker 

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



[issue10665] Expand unicodedata module documentation

2012-09-26 Thread Ezio Melotti

Changes by Ezio Melotti :


--
versions: +Python 3.4

___
Python tracker 

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



[issue14679] Define an __all__ for html.parser

2012-09-26 Thread Ezio Melotti

Ezio Melotti added the comment:

The issue with Django seems to be solved, but as Terry suggested in 
http://mail.python.org/pipermail/python-dev/2012-April/119087.html, adding an 
__all__ would be a good idea.  I'm changing the scope of the issue accordingly.

--
assignee:  -> ezio.melotti
components: +Library (Lib)
stage:  -> needs patch
title: Changes to html.parser break third-party code -> Define an __all__ for 
html.parser
versions: +Python 3.4 -Python 3.3

___
Python tracker 

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



[issue2292] Missing *-unpacking generalizations

2012-09-26 Thread Ezio Melotti

Changes by Ezio Melotti :


--
keywords:  -after moratorium
versions: +Python 3.4 -Python 3.3

___
Python tracker 

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



[issue4153] Unicode HOWTO up to date?

2012-09-26 Thread Ezio Melotti

Changes by Ezio Melotti :


--
assignee:  -> ezio.melotti

___
Python tracker 

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



[issue16036] simplify int() signature docs

2012-09-26 Thread Chris Jerdonek

Chris Jerdonek added the comment:

Good improvement.  LGTM.

--

___
Python tracker 

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



[issue11313] Speed up default encode()/decode()

2012-09-26 Thread Ezio Melotti

Ezio Melotti added the comment:

Can this be closed?

--

___
Python tracker 

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



[issue5846] Deprecate obsolete functions in unittest

2012-09-26 Thread Ezio Melotti

Changes by Ezio Melotti :


--
type:  -> enhancement
versions: +Python 3.4 -Python 3.3

___
Python tracker 

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



[issue11461] Reading UTF-16 with codecs.readline() breaks on surrogate pairs

2012-09-26 Thread Ezio Melotti

Changes by Ezio Melotti :


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



[issue4758] Python 3.x internet documentation needs work

2012-09-26 Thread Ezio Melotti

Changes by Ezio Melotti :


--
resolution:  -> out of date
stage: needs patch -> committed/rejected
status: languishing -> closed

___
Python tracker 

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



[issue10669] Document Deprecation Warnings and how to fix

2012-09-26 Thread Ezio Melotti

Changes by Ezio Melotti :


--
nosy: +chris.jerdonek
versions: +Python 3.3, Python 3.4

___
Python tracker 

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



[issue8401] Strange behavior of bytearray slice assignment

2012-09-26 Thread Ezio Melotti

Ezio Melotti added the comment:

> >>> a[:] = -10 # This should raise ValueError, not 
> >>> TypeError.
> >>> a[:] = 10 # This should raise OverflowError, not 
> >>> TypeError.

FTR, these two now raise OverflowError.

--
versions: +Python 3.3, Python 3.4 -Python 3.1

___
Python tracker 

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



[issue16036] simplify int() signature docs

2012-09-26 Thread Éric Araujo

Éric Araujo added the comment:

Latest patch LGTM.

--

___
Python tracker 

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



[issue7844] Add -3 warning for absolute imports.

2012-09-26 Thread Mark Dickinson

Changes by Mark Dickinson :


--
resolution:  -> out of date
status: open -> closed

___
Python tracker 

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



[issue6519] Reorder 'with' statement for files in Python Tutorial

2012-09-26 Thread Ezio Melotti

Changes by Ezio Melotti :


--
nosy: +chris.jerdonek
versions: +Python 3.3, Python 3.4 -Python 3.1

___
Python tracker 

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



[issue6412] Titlecase as defined in Unicode Case Mappings not followed

2012-09-26 Thread Ezio Melotti

Changes by Ezio Melotti :


--
versions: +Python 3.3, Python 3.4 -Python 3.1

___
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

2012-09-26 Thread Ezio Melotti

Changes by Ezio Melotti :


--
versions: +Python 3.4 -Python 3.2

___
Python tracker 

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



[issue6973] subprocess.Popen.send_signal doesn't check whether the process has terminated

2012-09-26 Thread Ezio Melotti

Changes by Ezio Melotti :


--
versions: +Python 2.7, Python 3.2, Python 3.3, Python 3.4 -Python 2.6, Python 
3.1

___
Python tracker 

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



[issue1087] py3k os.popen result is not iterable, patch attached

2012-09-26 Thread Roundup Robot

Roundup Robot added the comment:

New changeset c8cc94a0ba4c by Ezio Melotti in branch 'default':
#1087: use proper skips in test_os.
http://hg.python.org/cpython/rev/c8cc94a0ba4c

--
nosy: +python-dev

___
Python tracker 

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



[issue13056] test_multibytecodec.py:TestStreamWriter is skipped after PEP393

2012-09-26 Thread STINNER Victor

STINNER Victor added the comment:

> Victor, do you know if multibytecodec has been ported to the new API yet?

No, it has no. CJK codecs still use the legacy API (Py_UNICODE).

--

___
Python tracker 

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



[issue14097] Improve the "introduction" page of the tutorial

2012-09-26 Thread Ezio Melotti

Changes by Ezio Melotti :


--
nosy: +chris.jerdonek
versions: +Python 3.4

___
Python tracker 

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



[issue12707] Deprecate addinfourl getters

2012-09-26 Thread Ezio Melotti

Changes by Ezio Melotti :


--
type:  -> enhancement
versions: +Python 3.4 -Python 3.3

___
Python tracker 

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



[issue13056] test_multibytecodec.py:TestStreamWriter is skipped after PEP393

2012-09-26 Thread Ezio Melotti

Ezio Melotti added the comment:

Victor, do you know if multibytecodec has been ported to the new API yet?
If I removed the "if", I still get a failure.

test test_multibytecodec failed -- Traceback (most recent call last):
  File "/home/wolf/dev/py/py3k/Lib/test/test_multibytecodec.py", line 187, in 
test_gb18030
self.assertEqual(s.getvalue(), b'123\x907\x959')
AssertionError: b'123\x907\x959\x907\x959' != b'123\x907\x959'

--
keywords: +3.3regression

___
Python tracker 

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



[issue6027] test_xmlrpc_net fails when the ISP returns "302 Found"

2012-09-26 Thread Ezio Melotti

Ezio Melotti added the comment:

da148f0d86bd added a skip to the test (see #13434).  Also xmlrpc.com now 
redirects to xmlrpc.scripting.com.

--
resolution:  -> out of date
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



[issue16054] IDLE Preferences Crashes on click

2012-09-26 Thread Ned Deily

Ned Deily added the comment:

This is due to a bug in the current Cocoa Tk as released in ActiveTcl 8.5.12.1 
(and 8.5.12).  Try installing the previous ActiveTcl version, 8.5.11.1:

http://downloads.activestate.com/ActiveTcl/releases/8.5.11.1/

--
nosy: +ned.deily
resolution:  -> duplicate
stage:  -> committed/rejected
status: open -> closed
superseder:  -> IDLE crashes selecting Preferences menu with OS X ActiveState 
Tcl/Tk 8.5.12.1
title: Preferences Crashes on click -> IDLE Preferences Crashes on click
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



[issue13263] Group some os functions in submodules

2012-09-26 Thread Ezio Melotti

Ezio Melotti added the comment:

Now it's too late to fix this, so I'm closing it.

--
resolution:  -> out of date
stage: needs patch -> 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



[issue13224] Change str(x) to return only the (qual)name for some types

2012-09-26 Thread Ezio Melotti

Changes by Ezio Melotti :


--
versions: +Python 3.4 -Python 3.3

___
Python tracker 

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



[issue16054] Preferences Crashes on click

2012-09-26 Thread Fredy

New submission from Fredy:

Process: Python [3627]
Path:/Applications/Python 3.2/IDLE.app/Contents/MacOS/Python
Identifier:  org.python.IDLE
Version: 3.2.3 (3.2.3)
Code Type:   X86-64 (Native)
Parent Process:  launchd [231]
User ID: 501

Date/Time:   2012-09-26 16:08:04.216 +0200
OS Version:  Mac OS X 10.8.2 (12C54)
Report Version:  10

Interval Since Last Report:  166823 sec
Crashes Since Last Report:   122
Per-App Interval Since Last Report:  465 sec
Per-App Crashes Since Last Report:   6
Anonymous UUID:  622CF890-F6C9-E63C-05B2-5E66F969E543

Crashed Thread:  0  Dispatch queue: com.apple.main-thread

Exception Type:  EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x0024

VM Regions Near 0x24:
--> 
__TEXT 0001-00011000 [4K] r-x/rwx 
SM=COW  
/Library/Frameworks/Python.framework/Versions/3.2/Resources/Python.app/Contents/MacOS/Python

Application Specific Information:
Performing @selector(preferences:) from sender NSMenuItem 0x1017a6d20

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   Tk  0x000101391e6c 
TkpConfigureMenuEntry + 1923
1   Tk  0x000101312ffe MenuWorldChanged + 61
2   Tk  0x0001012eca99 RecomputeWidgets + 47
3   Tk  0x0001012ecaa7 RecomputeWidgets + 61
4   Tk  0x0001012ecaa7 RecomputeWidgets + 61
5   Tcl 0x00010125ee81 TclServiceIdle + 76
6   Tcl 0x000101243432 Tcl_DoOneEvent + 329
7   Tk  0x00010130d832 MapFrame + 42
8   Tcl 0x00010125ee81 TclServiceIdle + 76
9   Tcl 0x000101243432 Tcl_DoOneEvent + 329
10  Tk  0x0001012e3e26 Tk_TkwaitObjCmd + 555
11  Tcl 0x0001011dd8ad TclEvalObjvInternal 
+ 782
12  Tcl 0x0001011dea9f Tcl_EvalObjv + 66
13  _tkinter.so 0x0001011c268e Tkapp_Call + 190
14  org.python.python   0x0001000b4034 PyEval_EvalFrameEx + 
29204
15  org.python.python   0x0001000b4ffa PyEval_EvalCodeEx + 
1770
16  org.python.python   0x0001000b4167 PyEval_EvalFrameEx + 
29511
17  org.python.python   0x0001000b4ffa PyEval_EvalCodeEx + 
1770
18  org.python.python   0x000100039d0a function_call + 186
19  org.python.python   0x0001c828 PyObject_Call + 104
20  org.python.python   0x0001000261aa method_call + 138
21  org.python.python   0x0001c828 PyObject_Call + 104
22  org.python.python   0x00010006dd81 slot_tp_init + 177
23  org.python.python   0x000100060fe4 type_call + 212
24  org.python.python   0x0001c828 PyObject_Call + 104
25  org.python.python   0x0001000ae0f2 PyEval_EvalFrameEx + 
4818
26  org.python.python   0x0001000b4ffa PyEval_EvalCodeEx + 
1770
27  org.python.python   0x000100039d0a function_call + 186
28  org.python.python   0x0001c828 PyObject_Call + 104
29  org.python.python   0x0001000ab5e7 
PyEval_CallObjectWithKeywords + 87
30  _tkinter.so 0x0001011c09c8 PythonCmd + 456
31  Tcl 0x0001011da53b 
TclInvokeStringCommand + 105
32  Tcl 0x0001011dd8ad TclEvalObjvInternal 
+ 782
33  Tcl 0x0001011de4bf TclEvalEx + 2183
34  Tcl 0x0001011de8bd Tcl_Eval + 44
35  Tcl 0x0001011de900 Tcl_GlobalEval + 45
36  Tk  0x00010138c4c1 PrefsHandler + 79
37  com.apple.AppKit0x7fff9a555a59 -[NSApplication 
sendAction:to:from:] + 342
38  com.apple.AppKit0x7fff9a68b44c -[NSMenuItem 
_corePerformAction] + 406
39  com.apple.AppKit0x7fff9a68b13a -[NSCarbonMenuImpl 
performActionWithHighlightingForItemAtIndex:] + 133
40  com.apple.AppKit0x7fff9a37846f -[NSMenu 
_internalPerformActionForItemAtIndex:] + 36
41  com.apple.AppKit0x7fff9a3782f7 -[NSCarbonMenuImpl 
_carbonCommandProcessEvent:handlerCallRef:] + 135
42  com.apple.AppKit0x7fff9a684245 
NSSLMMenuEventHandler + 342
43  com.apple.HIToolbox 0x7fff94e9bf0a 
DispatchEventToHandlers(EventTargetRec*, OpaqueEventRef*, HandlerCallRec*) + 
1206
44  com.apple.HIToolbox

[issue16034] bz2 module appears slower in Python 3.x versus Python 2.x

2012-09-26 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Patch updated. Fixed one error. Now readline() optimized too.

Benchmark results (reading python.bz2):

Py2.7   Py3.2   Py3.3   Py3.3
vanilla patched
4.8 4.8 -   31  read(1)
1   0.943.4e+02 3.6 read(10)
0.610.6 28  0.87read(100)
0.580.583.4 0.61read(1000)
0.590.570.880.58read(1)
0.570.560.620.58read(10)
0.570.570.590.58read()
-   -   -   30  read1(1)
-   -   3.2e+02 3.6 read1(10)
-   -   27  0.88read1(100)
-   -   3.3 0.61read1(1000)
-   -   0.880.58read1(1)
-   -   0.610.57read1(10)
-   -   0.580.57read1()
1.7 1.7 11  0.67readline()

--
Added file: http://bugs.python.org/file27314/bz2_faster_read.patch

___
Python tracker 

___diff -r 6f456d9add40 Lib/bz2.py
--- a/Lib/bz2.pyWed Sep 26 13:11:48 2012 +0200
+++ b/Lib/bz2.pyWed Sep 26 16:49:44 2012 +0300
@@ -79,7 +79,8 @@
 mode = "rb"
 mode_code = _MODE_READ
 self._decompressor = BZ2Decompressor()
-self._buffer = None
+self._buffer = b''
+self._offset = 0
 elif mode in ("w", "wb"):
 mode = "wb"
 mode_code = _MODE_WRITE
@@ -124,7 +125,8 @@
 self._fp = None
 self._closefp = False
 self._mode = _MODE_CLOSED
-self._buffer = None
+self._buffer = b''
+self._offset = 0
 
 @property
 def closed(self):
@@ -172,14 +174,14 @@
 raise io.UnsupportedOperation("The underlying file object "
   "does not support seeking")
 
-# Fill the readahead buffer if it is empty. Returns False on EOF.
-def _fill_buffer(self):
+# Non-buffered read and decompress next chunk of data.
+# Always returns at least one byte of data, unless at EOF.
+def _read1(self):
 # Depending on the input data, our call to the decompressor may not
 # return any data. In this case, try again after reading another block.
+if self._mode == _MODE_READ_EOF:
+return b''
 while True:
-if self._buffer:
-return True
-
 if self._decompressor.unused_data:
 rawblock = self._decompressor.unused_data
 else:
@@ -189,48 +191,70 @@
 if self._decompressor.eof:
 self._mode = _MODE_READ_EOF
 self._size = self._pos
-return False
+return b''
 else:
 raise EOFError("Compressed file ended before the "
-   "end-of-stream marker was reached")
+"end-of-stream marker was reached")
 
 # Continue to next stream.
 if self._decompressor.eof:
 self._decompressor = BZ2Decompressor()
 
-self._buffer = self._decompressor.decompress(rawblock)
+data = self._decompressor.decompress(rawblock)
+if data:
+return data
 
 # Read data until EOF.
 # If return_data is false, consume the data without returning it.
 def _read_all(self, return_data=True):
+data = self._buffer[self._offset:]
 blocks = []
-while self._fill_buffer():
+self._buffer = b''
+self._offset = 0
+while True:
 if return_data:
-blocks.append(self._buffer)
-self._pos += len(self._buffer)
-self._buffer = None
+blocks.append(data)
+self._pos += len(data)
+data = self._read1()
+if not data:
+break
 if return_data:
 return b"".join(blocks)
 
 # Read a block of up to n bytes.
 # If return_data is false, consume the data without returning it.
 def _read_block(self, n, return_data=True):
+if n <= 0:
+return b''
+end = n + self._offset
+data = self._buffer[self._offset:end]
+if end <= len(self._buffer):
+self._offset = end
+self._pos += len(data)
+return data
+
 blocks = []
-while n > 0 and self._fill_buffer():
-if n < len(self._buffer):
-data = self._buffer[:n]
-self._buffer = self._buffer[n:]
-else:
-data = self._buffer
-self._buffer = None
+self._buffer = b''
+self._offset = 0
+while True:
 if return_data:
 blocks.append(data)

[issue16034] bz2 module appears slower in Python 3.x versus Python 2.x

2012-09-26 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


Removed file: http://bugs.python.org/file27310/bz2_faster_read.patch

___
Python tracker 

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



[issue13386] Document documentation conventions for optional args

2012-09-26 Thread Ezio Melotti

Changes by Ezio Melotti :


--
nosy: +chris.jerdonek
type:  -> enhancement

___
Python tracker 

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



[issue16048] Tutorial-classes-remarks: replace paragragh

2012-09-26 Thread Ezio Melotti

Changes by Ezio Melotti :


--
nosy: +ezio.melotti
type:  -> enhancement

___
Python tracker 

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



[issue16044] xml.etree.ElementTree.Element: append method iterator param is broken

2012-09-26 Thread Ezio Melotti

Changes by Ezio Melotti :


--
nosy: +eli.bendersky, ezio.melotti

___
Python tracker 

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



[issue16036] simplify int() signature docs

2012-09-26 Thread Ezio Melotti

Ezio Melotti added the comment:

The latest patch is better, however I think it can be further improved.

The text is currently divided in two paragraphs:
 1) covers int(), int(num), int(x, base=b);
 2) covers int(float), and int(x, base=b);

I think it would be better to cover first int(), int(num), int(float), and then 
cover int(x, base=b).  The attached patch does this.

--
Added file: http://bugs.python.org/file27313/issue16036.diff

___
Python tracker 

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



[issue13440] Explain the "status quo wins a stalemate" principle in the devguide

2012-09-26 Thread Mike Hoy

Mike Hoy added the comment:

I'd be willing to make a patch for this if you are agreed to just adding a 
couple of links to it (or otherwise).

--
nosy: +mikehoy

___
Python tracker 

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



[issue16051] Documentation missing pipes.quote()

2012-09-26 Thread R. David Murray

R. David Murray added the comment:

Thanks for the report.

pipes.quote used to be an undocumented helper function in pipes.  When we 
decided to make it public, we moved it to the shlex module.  Therefore you'll 
find that as of Python 3.3 the source code has moved to shlex and it is 
documented in the shlex documentation.

--
nosy: +r.david.murray
resolution:  -> out of date
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



[issue16052] Typo in "What's new in 3.3"

2012-09-26 Thread Lars Buitinck

Lars Buitinck added the comment:

Sorry about the bundle, I'm an hg noob and only noticed that bundles are binary 
after I submitted it. Will create a regular patch next time.

--

___
Python tracker 

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



[issue16034] bz2 module appears slower in Python 3.x versus Python 2.x

2012-09-26 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


Added file: http://bugs.python.org/file27310/bz2_faster_read.patch

___
Python tracker 

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



[issue16052] Typo in "What's new in 3.3"

2012-09-26 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 6f456d9add40 by Georg Brandl in branch 'default':
Closes #16052: fix typo. Patch by Lars Buitinck.
http://hg.python.org/cpython/rev/6f456d9add40

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



[issue16052] Typo in "What's new in 3.3"

2012-09-26 Thread Georg Brandl

Georg Brandl added the comment:

Thanks for the report.  Note that we don't care for bundles instead of patches, 
since they are impossible to review online and clumsy to do so offline.  
Readable patches (as generated by e.g. hg export) are much preferred.

--
nosy: +georg.brandl

___
Python tracker 

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



[issue16034] bz2 module appears slower in Python 3.x versus Python 2.x

2012-09-26 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


Removed file: http://bugs.python.org/file27310/bz2_faster_read.patch

___
Python tracker 

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



[issue13896] Make shelf instances work with 'with' as context managers

2012-09-26 Thread Andrew Svetlov

Changes by Andrew Svetlov :


--
nosy: +asvetlov

___
Python tracker 

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



[issue16053] "strict" parameter is not documented in csv module

2012-09-26 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
assignee:  -> docs@python
components: +Documentation
nosy: +docs@python
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



[issue16053] "strict" parameter is not documented in csv module

2012-09-26 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

csv.Dialect.strict is not documented. However it is used in tests.

--
messages: 171334
nosy: storchaka
priority: normal
severity: normal
status: open
title: "strict" parameter is not documented in csv module

___
Python tracker 

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



[issue16052] Typo in "What's new in 3.3"

2012-09-26 Thread Lars Buitinck

New submission from Lars Buitinck:

I spotted a minor typo in the "What's new" for Py 3.3, introduced yesterday. 
See attached patch.

--
assignee: docs@python
components: Documentation
files: typo.hg
messages: 171333
nosy: docs@python, larsmans
priority: normal
severity: normal
status: open
title: Typo in "What's new in 3.3"
versions: Python 3.3
Added file: http://bugs.python.org/file27312/typo.hg

___
Python tracker 

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



[issue16034] bz2 module appears slower in Python 3.x versus Python 2.x

2012-09-26 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Here is a patch and benchmark script. This required more time than I thought.

Benchmark results:

Unpatched:

5.3 read(1)
0.5 read(10)
0.049   read(100)
0.013   read(1000)
0.009   read(1)
0.0085  read(10)
0.0082  read()
5   read1(1)
0.47read1(10)
0.046   read1(100)
0.012   read1(1000)
0.0089  read1(1)
0.0084  read1(10)
0.0082  read1()
0.15readline()

Patched:

0.73read(1)
0.082   read(10)
0.015   read(100)
0.0089  read(1000)
0.0082  read(1)
0.0084  read(10)
0.0083  read()
0.78read1(1)
0.087   read1(10)
0.016   read1(100)
0.0089  read1(1000)
0.0082  read1(1)
0.0082  read1(10)
0.008   read1()
0.14readline()

--
keywords: +patch
Added file: http://bugs.python.org/file27310/bz2_faster_read.patch
Added file: http://bugs.python.org/file27311/bz2bench.py

___
Python tracker 

___diff -r 82f25e941be2 Lib/bz2.py
--- a/Lib/bz2.pyTue Sep 25 12:34:54 2012 -0700
+++ b/Lib/bz2.pyWed Sep 26 12:34:43 2012 +0300
@@ -79,7 +79,8 @@
 mode = "rb"
 mode_code = _MODE_READ
 self._decompressor = BZ2Decompressor()
-self._buffer = None
+self._buffer = b''
+self._offset = 0
 elif mode in ("w", "wb"):
 mode = "wb"
 mode_code = _MODE_WRITE
@@ -124,7 +125,8 @@
 self._fp = None
 self._closefp = False
 self._mode = _MODE_CLOSED
-self._buffer = None
+self._buffer = b''
+self._offset = 0
 
 @property
 def closed(self):
@@ -172,14 +174,14 @@
 raise io.UnsupportedOperation("The underlying file object "
   "does not support seeking")
 
-# Fill the readahead buffer if it is empty. Returns False on EOF.
-def _fill_buffer(self):
+# Non-buffered read and decompress next chunk of data.
+# Always returns at least one byte of data, unless at EOF.
+def _read1(self):
 # Depending on the input data, our call to the decompressor may not
 # return any data. In this case, try again after reading another block.
+if self._mode == _MODE_READ_EOF:
+return b''
 while True:
-if self._buffer:
-return True
-
 if self._decompressor.unused_data:
 rawblock = self._decompressor.unused_data
 else:
@@ -189,48 +191,70 @@
 if self._decompressor.eof:
 self._mode = _MODE_READ_EOF
 self._size = self._pos
-return False
+return b''
 else:
 raise EOFError("Compressed file ended before the "
-   "end-of-stream marker was reached")
+"end-of-stream marker was reached")
 
 # Continue to next stream.
 if self._decompressor.eof:
 self._decompressor = BZ2Decompressor()
 
-self._buffer = self._decompressor.decompress(rawblock)
+data = self._decompressor.decompress(rawblock)
+if data:
+return data
 
 # Read data until EOF.
 # If return_data is false, consume the data without returning it.
 def _read_all(self, return_data=True):
+data = self._buffer[self._offset:]
 blocks = []
-while self._fill_buffer():
+self._buffer = b''
+self._offset = 0
+while True:
 if return_data:
-blocks.append(self._buffer)
-self._pos += len(self._buffer)
-self._buffer = None
+blocks.append(data)
+self._pos += len(data)
+data = self._read1()
+if not data:
+break
 if return_data:
 return b"".join(blocks)
 
 # Read a block of up to n bytes.
 # If return_data is false, consume the data without returning it.
 def _read_block(self, n, return_data=True):
+if n <= 0:
+return b''
+end = n + self._offset
+data = self._buffer[self._offset:end]
+if data:
+self._offset = end
+self._pos += len(data)
+return data
+
 blocks = []
-while n > 0 and self._fill_buffer():
-if n < len(self._buffer):
-data = self._buffer[:n]
-self._buffer = self._buffer[n:]
-else:
-data = self._buffer
-self._buffer = None
+self._buffer = b''
+self._offset = 0
+while True:
 if return_data:
 blocks.append(data)
 self._pos += len(data)
 n -= len(data)
+if 

[issue16049] Create abstract base classes by inheritance rather than a direct invocation of __metaclass__

2012-09-26 Thread Mark Dickinson

Mark Dickinson added the comment:

+1

--
nosy: +mark.dickinson

___
Python tracker 

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



[issue16035] Segmentation fault in test suite of apsw

2012-09-26 Thread Roger Binns

Roger Binns added the comment:

Thanks for finding this problem.  I can repeat it with the patch and am in the 
process of fixing it.

--

___
Python tracker 

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