[issue7033] C/API - Document exceptions

2009-12-29 Thread lekma

lekma  added the comment:

> lekma, this patch is now listed in the 2.7 "what's new" document as
> contributed by "the lekma user", please tell us if you want your name
> there.

Nope, that's ok (it's perfect).

--

___
Python tracker 

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



[issue7589] setup.py shouldn't try to build nis module when nis headers aren't available

2009-12-29 Thread Benjamin Peterson

Benjamin Peterson  added the comment:

Applied in r77128.

--
nosy: +benjamin.peterson
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



[issue4696] email module does not unfold headers

2009-12-29 Thread R. David Murray

R. David Murray  added the comment:

While I agree with you, this represents a significant API change and so
is only going to be dealt with in the new version of the email package
(see http://wiki.python.org/moin/Email%20SIG)

--
nosy: +r.david.murray
priority:  -> normal
title: email module does not fold headers -> email module does not unfold 
headers
versions: +Python 3.2 -Python 2.6

___
Python tracker 

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



[issue4491] email.Header.decode_header() doesn't work if encoded-word was separeted by CRLF

2009-12-29 Thread R. David Murray

Changes by R. David Murray :


--
priority:  -> normal
resolution:  -> duplicate
stage:  -> committed/rejected
superseder:  -> decode_header does not follow RFC 2047

___
Python tracker 

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



[issue4046] test_formatdate_usegmt fails on non-englisch locale

2009-12-29 Thread R. David Murray

R. David Murray  added the comment:

I'm not able to reproduce this problem, and I would not expect to be
able to, since LANG should have no effect unless setlocale is called,
which the regression tests should not be doing without restoring it
afterward (and which the tests are not doing at all if you just run
test_email).

That said, I'm on linux, and issue 5125, which is also still open,
suggests this might be an OS X specific problem (maybe specific to
Apple's version of Python?).  Can you reproduce it with the python.org
version of 3.1?

--
nosy: +r.david.murray, ronaldoussoren
priority:  -> normal

___
Python tracker 

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



[issue6203] 3.x locale does not default to C, contrary to the documentation and to 2.x behavior

2009-12-29 Thread R. David Murray

Changes by R. David Murray :


--
versions: +Python 3.2 -Python 3.1

___
Python tracker 

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



[issue7585] [patch] difflib should separate filename from timestamp with tab

2009-12-29 Thread anatoly techtonik

anatoly techtonik  added the comment:

This patch makes sure filename and date split by tab in every case when 
date is provided.

--

___
Python tracker 

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



[issue2259] Poor support other than 44.1khz, 16bit audio files?

2009-12-29 Thread Oki Mikito

Oki Mikito  added the comment:

Hello,

My apology for failing to reply ... Here's a small AIFF file (24-bit, 
48000hz). Try this to see if it can be opened using aifc. Thank you!

--
Added file: http://bugs.python.org/file15696/24b48k.aif

___
Python tracker 

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



[issue2259] Poor support other than 44.1khz, 16bit audio files?

2009-12-29 Thread Oki Mikito

Changes by Oki Mikito :


Removed file: http://bugs.python.org/file15695/24b48k.aif

___
Python tracker 

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



[issue2259] Poor support other than 44.1khz, 16bit audio files?

2009-12-29 Thread Oki Mikito

Oki Mikito  added the comment:

Hello,

My apology for failing to reply ... Here's a small AIFF file (24-bit, 
48000hz). Try this file to see if it can be opened using aifc. Thank you!

--
Added file: http://bugs.python.org/file15695/24b48k.aif

___
Python tracker 

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



[issue5116] expose _CrtSetReportMode via the msvcrt module

2009-12-29 Thread Brian Curtin

Brian Curtin  added the comment:

I just noticed that this already exists in py3k, added in r57823 (lacks
docs but I'll cover them in the py3k fix for #7579)

--

___
Python tracker 

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



[issue7579] Patch to add docstrings to msvcrt

2009-12-29 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc  added the comment:

Committed r77126 in trunk.
I reflowed the text for getch(), so that help(msvcrt) displays nicely in a 
80-chars-wide console (this was my "test")

I was about to merge it into py3k, when I realized that the documentation 
should be updated to match the str/bytes distinction.
Can someone suggest a patch for py3k? (and for Doc/library/msvcrt.rst as 
well)

--

___
Python tracker 

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



[issue7585] [patch] difflib should separate filename from timestamp with tab

2009-12-29 Thread Brian Curtin

Brian Curtin  added the comment:

I agree that splitting with a tab character is good, but I think it
should be split by a tab character in every case. 

If the separator is different based on what data is provided, then it
complicates parsing and would have to be explained in documentation that
we provide different header formats.

--

___
Python tracker 

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



[issue5420] Queue deprecation warning patch

2009-12-29 Thread Benjamin Peterson

Benjamin Peterson  added the comment:

It's too late now for deprecation in 3.2...

--

___
Python tracker 

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



[issue7413] datetime.datetime.isoformat truncation problem

2009-12-29 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc  added the comment:

Fixed with r77122 (trunk) and r77125 (release26-maint).

py3k uses PyUnicode_FromFormat directly and does not have this problem.
I merged the test there nonetheless.

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



[issue7590] 'exceptions' module mentioned in documentation

2009-12-29 Thread Georg Brandl

Georg Brandl  added the comment:

Thanks, should be fixed in r77121.

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



[issue7033] C/API - Document exceptions

2009-12-29 Thread Georg Brandl

Georg Brandl  added the comment:

lekma, this patch is now listed in the 2.7 "what's new" document as
contributed by "the lekma user", please tell us if you want your name there.

--

___
Python tracker 

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



[issue7588] unittest.TestCase.shortDescription isn't short anymore

2009-12-29 Thread Brett Cannon

Changes by Brett Cannon :


--
assignee:  -> michael.foord

___
Python tracker 

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



[issue7590] 'exceptions' module mentioned in documentation

2009-12-29 Thread Brett Cannon

Brett Cannon  added the comment:

You're right, July, that the exceptions module does not exist in Python 3.

--
nosy: +brett.cannon

___
Python tracker 

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



[issue7579] Patch to add docstrings to msvcrt

2009-12-29 Thread Georg Brandl

Georg Brandl  added the comment:

Patch looks good, can someone with the ability to test it please commit it?

--

___
Python tracker 

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



[issue7596] test_logging sometimes fails

2009-12-29 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Also: 
http://www.python.org/dev/buildbot/all/builders/x86%20Ubuntu%20trunk/builds/182/steps/test/logs/stdio

--

___
Python tracker 

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



[issue7596] test_logging sometimes fails

2009-12-29 Thread Antoine Pitrou

New submission from Antoine Pitrou :

test_logging sometimes fails with the following error, e.g. on the
buildbots (*):

Error in atexit._run_exitfuncs:
Traceback (most recent call last):
  File
"/home/buildbot/cpython-ucs4/trunk.pitrou-ubuntu-wide/build/Lib/atexit.py",
line 24, in _run_exitfuncs
func(*targs, **kargs)
  File
"/home/buildbot/cpython-ucs4/trunk.pitrou-ubuntu-wide/build/Lib/logging/__init__.py",
line 1556, in shutdown
h.flush()
AttributeError: 'NoneType' object has no attribute 'flush'
Error in sys.exitfunc:
Traceback (most recent call last):
  File
"/home/buildbot/cpython-ucs4/trunk.pitrou-ubuntu-wide/build/Lib/atexit.py",
line 24, in _run_exitfuncs
func(*targs, **kargs)
  File
"/home/buildbot/cpython-ucs4/trunk.pitrou-ubuntu-wide/build/Lib/logging/__init__.py",
line 1556, in shutdown
h.flush()
AttributeError: 'NoneType' object has no attribute 'flush'
[874213 refs]


(*)
http://www.python.org/dev/buildbot/all/builders/AMD64%20Ubuntu%20wide%20trunk/builds/185/steps/test/logs/stdio

--
assignee: vinay.sajip
components: Library (Lib), Tests
messages: 97005
nosy: pitrou, vinay.sajip
priority: high
severity: normal
stage: needs patch
status: open
title: test_logging sometimes fails
type: behavior
versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2

___
Python tracker 

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



[issue7595] Doc typo for select.kevent()

2009-12-29 Thread Georg Brandl

Georg Brandl  added the comment:

Thanks, fixed (in docs and docstring) in r77120.

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



[issue936813] fast modular exponentiation

2009-12-29 Thread Mark Dickinson

Mark Dickinson  added the comment:

This patch still(!) applies almost perfectly cleanly to trunk.  On a 64-
bit machine, I'm getting a failure in test_auto_overflow, coming from:

>>> pow(0L, 0, 9223372036854775807)
28051505152L

I haven't looked hard to figure out where this is coming from, but my 
guess is that the 15-bitness of digits is hard-coded in the patch 
somewhere.

My general feeling is that three-argument pow is such a little-used 
operation in Python that it's not worth the extra code to speed it up.

--

___
Python tracker 

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



[issue7575] tes_math fails Mac OS X 10.4 due to OverflowError in test_mtestfile

2009-12-29 Thread Mark Dickinson

Mark Dickinson  added the comment:

Fixed in r77116 (trunk), r77117 (py3k).

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



[issue7561] PyByteArray_AS_STRING used unsafely

2009-12-29 Thread Mark Dickinson

Mark Dickinson  added the comment:

Having the ob_bytes field be NULL for a bytearray seems like a strange 
choice;  does anyone know why bytearray was designed this way?  Is it 
mainly for ease of combination with the stringlib library?

There does seem to be an awful lot of code that acts as though it 
expects x->ob_bytes to always be non-NULL for a valid PyByteArrayObject* 
x.  IMO, the use of pointer arithmetic with NULL pointers that Stefan 
pointed out should definitely be fixed.

The long_new problem looks like a trivial fix:  I'd fix it already, but 
given the number of other problems with this macro I'm not sure whether 
it should be fixed in Objects/longobject.c, or in the 
PyByteArray_AS_STRING macro itself.

I guess this is up to Georg and Benjamin, but I don't think 3.2 or 3.1.2 
should go out of the door with this bug present.

--
priority: critical -> release blocker

___
Python tracker 

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



[issue7588] unittest.TestCase.shortDescription isn't short anymore

2009-12-29 Thread Brian Curtin

Brian Curtin  added the comment:

It looks like this was changed in r70837

--
nosy: +brian.curtin

___
Python tracker 

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



[issue5576] Don't use PyLong_SHIFT with _PyLong_AsScaledDouble()

2009-12-29 Thread Mark Dickinson

Mark Dickinson  added the comment:

Here's a patch:

 - rename _PyLong_AsScaledDouble to _PyLong_Frexp (for the benefit of
   anyone foolish enough to be using an undocumented private API
   function)
 - make the exponent type Py_ssize_t instead of int
 - do the scaling by PyLong_SHIFT in _PyLong_Frexp instead of in the
   functions that call it (e.g., loghelper in the math module)
 - remove longintrepr.h include from math module, since it's no longer
   needed
 - change _PyLong_Frexp algorithm to do correct rounding
 - refactor PyLong_Double to use _PyLong_Frexp.

--
Added file: http://bugs.python.org/file15694/issue5576.patch

___
Python tracker 

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



[issue5576] Don't use PyLong_SHIFT with _PyLong_AsScaledDouble()

2009-12-29 Thread Mark Dickinson

Mark Dickinson  added the comment:

> Long double (80 bits) exponent is in range [-16382; 16383] and so 
would
> fits in an int, unsigned int, size_t or Py_ssize_t.

Sure, but I don't think that's relevant to the point I was attempting to 
make:  PyLong_AsScaledDouble returns the number of bits in the given 
PyLong, and that number can be (theoretically) as large as 
PY_SSIZE_T_MAX * PyLong_SHIFT.  So Py_ssize_t is a better fit than int 
to hold this number:  otherwise you'll get unnecessary overflows on a 
64-bit system.

I'm working on refactoring PyLong_AsScaledDouble and PyLong_AsDouble to 
have them both use the same core code.  This would make 
PyLong_AsScaledDouble correctly rounded, and hence independent of the 
implementation of a PyLong (in particular, independent of the decision 
to use 15-bit or 30-bit digits for PyLongs: this decision really 
shouldn't affect the result of a log function or any other functions 
using _PyLong_AsScaledDouble).

--

___
Python tracker 

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



[issue7548] If a generator raises TypeError when being unpacked, an unrelated error message is shown

2009-12-29 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc  added the comment:

This is a duplicate of issue4806.

--
nosy: +amaury.forgeotdarc
resolution:  -> duplicate
status: open -> closed
superseder:  -> Function calls taking a generator as star argument can mask 
TypeErrors in the generator

___
Python tracker 

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



[issue7595] Doc typo for select.kevent()

2009-12-29 Thread Chad Whitacre

New submission from Chad Whitacre :

I believe the default "flags" argument to select.kevent() should be given 
as KQ_EV_ADD, not KQ_ADD.

http://docs.python.org/dev/py3k/library/select.html

--
assignee: georg.brandl
components: Documentation, Library (Lib)
messages: 96996
nosy: georg.brandl, whit537
severity: normal
status: open
title: Doc typo for select.kevent()
versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2

___
Python tracker 

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



[issue3745] _sha256 et al. encode to UTF-8 by default

2009-12-29 Thread Marc-Andre Lemburg

Marc-Andre Lemburg  added the comment:

Gregory P. Smith wrote:
> 
> Gregory P. Smith  added the comment:
> 
> lemburg - see which issue #?

Sorry, the message got truncated for some reason.

I was referring to http://bugs.python.org/issue3745

This was discussed on python-dev: 
http://mail.python.org/pipermail/python-dev/2009-December/094593.html

> Anyways perhaps the right thing to do instead of trunk r65961 would have 
> been to change the s# to an s*.

That would have worked as well.

> Undoing it will be more painful now as several changes have gone in since 
> that require undoing and possibly redoing differently.

Using s* should pretty much avoid the need to use GET_BUFFER_VIEW_OR_ERROUT(),
so if you want to keep the other changes, removing the use of the
macro should be fairly straight-forward, unless I'm missing something.

--

___
Python tracker 

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



[issue7539] unicode exceptions terminate pdb.pm() loop

2009-12-29 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc  added the comment:

Here is a patch, along with the test that I modified a little bit:
- it uses _saferepr (and repr.Repr) to render the exception object
- it also fixes exception raised by the "p" action.
- The test uses a raw docstring, to avoid chr(255) in the string

--
nosy: +amaury.forgeotdarc
Added file: http://bugs.python.org/file15693/pdb-unicode-exc.patch

___
Python tracker 

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



[issue7566] Add ntpath.sameopenfile support for Windows

2009-12-29 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



[issue7572] Strange issue : cursor.commit() with sqlite

2009-12-29 Thread Gerhard Häring

Gerhard Häring  added the comment:

You confuse two things here: cursors and connections.

Indeed closing a connection without calling commit() on it will do an
implicit rollback, i. e. any changes on the database will not be persisted.

Closing cursors, however does nothing except invalidating the cursor
object for further usage. Cursors are basically only used for executing
SQL and looping over resultsets. You can reuse them or you can close
them and open new ones. But they have no relationship whatsoever with
transactions.

I hope this clears things up. I'm closing the issue now.

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

___
Python tracker 

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



[issue7572] Strange issue : cursor.commit() with sqlite

2009-12-29 Thread Gerhard Häring

Changes by Gerhard Häring :


--
title: Strabge issue : cursor.commit() with sqlite -> Strange issue : 
cursor.commit() with sqlite

___
Python tracker 

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



[issue7572] Strabge issue : cursor.commit() with sqlite

2009-12-29 Thread lakshmipathi

lakshmipathi  added the comment:

ok..let me put this question ,in different manner.
Here is my code (example2)
--
import sqlite3
def loopy():
return 'GNU'
#get connection object 
conn = sqlite3.connect("/tmp/example2")
#get curson obj. and invoke execute
cur = conn.cursor()
cur.execute('''create table stk (txt text)''')
#insert a single record
conn.create_function("loopy",0,loopy)
t=(loopy(),)
cur.execute("insert into stk values (?)",t)
#I have close it without committing. -So my record length == 0
cur.close()
#But when  i open again new cursor cur1
cur1=conn.cursor()
cur1.execute("select * from stk")
row = cur1.fetchall()
# i expect this assert to pass - since there is no record 
assert len(row) < 1

---
I used sqlite3 /tmp/example2 and select * from stk returned zero records
as expected.
--
So commit refers to committing to Database not with in the program.

--

___
Python tracker 

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



[issue3745] _sha256 et al. encode to UTF-8 by default

2009-12-29 Thread Roumen Petrov

Roumen Petrov  added the comment:

gregory - refer to setup.py logic to build modules

--

___
Python tracker 

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



[issue7569] ctypes doc improvement: c_char_p

2009-12-29 Thread Georg Brandl

Georg Brandl  added the comment:

OK, applied in r77108.

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



[issue7585] [patch] difflib should separate filename from timestamp with tab

2009-12-29 Thread anatoly techtonik

anatoly techtonik  added the comment:

Filenames may contain spaces too.

--- handle dis Sun Dec 27 16:08:28 2009
--- или вот это пон, дек 27 16:08:28 2009

The last line is space separated filename and date in Russian locale. 
Patch tool should handle that, but as you may see it is not always 
possible. That's why difflib modification with \t separator will greatly 
improve interoperability of difflib patches regardless of timestamp 
format.

Stripping trailing whitespace when there is no timestamp serves the same 
purpose. We can assume that patch tools are perfect, but I wouldn't 
write my tool if that was true, so its better to be friendly on difflib 
side and generate the output that won't require more work than necessary 
to use it.

--

___
Python tracker 

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



[issue7594] shlex refactoring

2009-12-29 Thread Ezio Melotti

Ezio Melotti  added the comment:

Thanks for the patch.

Three minor things:
1) the source contains non-ASCII chars and an encoding declaration at
the beginning of the file. PEP8 says that "using \x, \u or \U escapes is
the preferred way to include non-ASCII data in string literals", so I
would use \x escapes and remove the encoding declaration;
2) the class "stream_source" should be named "StreamSource" unless there
are compatibility or consistency issues;
3) patches should be done against trunk first (your patch applies fine
on trunk too and the tests pass), they will then be ported to py3k.

--
keywords: +needs review
nosy: +ezio.melotti
priority:  -> normal
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



[issue7594] shlex refactoring

2009-12-29 Thread Brian Harring

New submission from Brian Harring :

Currently, shlex.shlex's internal read_token is a bit of a nasty mess to
follow and pretty poorly performant.

The refactoring I'll be attaching essentially inverts the state machine
approach read_token uses- instead, converting it over to a more
procedural set of loops.  The benefits of this is that it's far, far
easier to track what the code is actually doing and the performance goes
up fairly drastically via tightening the various for loops (for example,
if doing quoting, you only care about escapes and the terminating quote-
thus a loop there).

End result, the refactored code actually has whitespace in it and still
is shorter- specifically the tokenenizer was converted into a generator
to preserve state internally, thus simplifying the code flow immensely.

Beyond that, this should still be api compatible... and is 2x faster,
passing tests.

Note this patch is cut against 2.6.4; assuming folks are happy w/ the
general approach, I'll rebase it to py3k trunk.

>From there, I'd be willing to tackle the other shlex issues where
applicable, but personally... not w/out the refactoring base, since that
state machine is a pita to trace out.

--
components: Library (Lib)
files: shlex-py2.6.4-20091229.patch
keywords: patch
messages: 96987
nosy: ferringb
severity: normal
status: open
title: shlex refactoring
type: performance
versions: Python 2.6, Python 2.7, Python 3.2
Added file: http://bugs.python.org/file15692/shlex-py2.6.4-20091229.patch

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