Re: [Python-Dev] [Csv] skipfinalspace

2008-10-20 Thread John Machin

Tom Brown wrote:
(Continuing thread started at 
http://mail.python.org/pipermail/csv/2008-October/000688.html)


On Sun, Oct 19, 2008 at 16:46, Andrew McNamara 
<[EMAIL PROTECTED] > wrote:


 >I downloaded the 2.6 source tar ball, but is it too late for new
features to
 >get into versions <3?

Yep.

 >How would you feel about adding the following tests to
Lib/test/test_csv.py
 >and getting them to pass?
 >
 >Also http://www.python.org/doc/2.5.2/lib/csv-fmt-params.html says
 >"*skipinitialspace *When True, whitespace immediately following the
 >delimiter is ignored."
 >but my tests show whitespace at the start of any field is ignored,
including
 >the first field.

I suspect (but I haven't checked) that it means "after the delimiter and
before any quoted field (or some variation on that).

I agree that whitespace after the delimiter and before any quoted field 
is skipped. Also whitespace after the start of the line and before any 
quoted field is skipped.



All of the "dialect" parameters are there to allow parsing of a specific
common form of CSV file. Because there is no formal definition of the
format, the module simply aims to parse (and produce the same result)
as common applications such as Excel and Access. Changing the behaviour
in any non-backwards compatible way is sure to get screams of anguish
from many users. Even when the behaviour appears to be a bug, you can
be sure people are counting on it working like that.


skipinitialspace defaults to false and by the same logic skipfinalspace 
should default to false to preserve compatibility with the csv module in 
2.6. On the other hand, the switch to version 3 is as good a time as any 
to break backwards compatibility to adopt something that works better 
for new users.


Read Andrew's lips: They don't want "better", they want "the same as MS".

Based on my experience parsing several hundred csv generated by many 
different people I think it would be nice to at least have a dialect 
that is excel + skipinitialspace=True + skipfinalspace=True.


Based on my experience extracting data from innumerable csv files (and 
infinite varieties thereof), spreadsheet files, and database tables, in 
99.99% of cases one should automatically apply the following 
transformations to each text field:

   * strip leading whitespace
   * strip trailing whitespace
   * replace embedded runs of whitespace by a single space
and one needs to ensure that the definition of whitespace includes the 
no-break space (NBSP) character.


As this "space normalisation" is needed for all input sources, the csv 
module is IMHO the wrong place to put it. A string method would be a 
better idea.


Cheers,
John
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Python 2.5.3: call for patches

2008-10-20 Thread Jeroen Ruigrok van der Werven
Martin,

-On [20081007 09:27], "Martin v. Löwis" ([EMAIL PROTECTED]) wrote:
>Within a few weeks, we will release Python 2.5.3. This will be the last
>bug fix release of Python 2.5, afterwards, future releases of 2.5 will
>only include security fixes, and no binaries (for Windows or OSX) will
>be provided anymore (from python.org).

Since we tripped over these with Trac/Genshi we would appreciate if the
following could be applied (if not already):

http://bugs.python.org/issue2231
http://bugs.python.org/issue2246

(http://bugs.python.org/issue2321 seems to be in 2.5 already based on the
last comment)

-- 
Jeroen Ruigrok van der Werven  / asmodai
イェルーン ラウフロック ヴァン デル ウェルヴェン
http://www.in-nomine.org/ | http://www.rangaku.org/ | GPG: 2EAC625B
Ignorance is the opportunity to learn...
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] [Python-3000] Backporting multiprocessing?

2008-10-20 Thread skip

>> Maybe doing the modest amount of translation required of the 2.6 unit
>> tests so they run under 0.52 would help.  See what fails and then see
>> what fixes correspond to fixing those failing tests.

Christian> Sounds like a good plan. Let's get started! Are you going to
Christian> commit your work to the Google Code repository anytime soon?

I checked in the contents of my multiprocessing.tar file and opened issues
#1 and #2.

Skip

___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Python 2.5.3: call for patches

2008-10-20 Thread A.M. Kuchling
yOn Mon, Oct 20, 2008 at 11:57:36AM +0200, Jeroen Ruigrok van der Werven wrote:
> http://bugs.python.org/issue2231

This fixes a memory leak in itertools.chain(), which was greatly
changed between 2.5 and 2.6, and the patch was to code not present in
2.5.  Are you sure this bug affected 2.5 at all?

> http://bugs.python.org/issue2246

Already backported to 2.5 in rev. 61287.

> (http://bugs.python.org/issue2321 seems to be in 2.5 already 

Correct; rev. 61485.

--amk
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Python 2.5.3: call for patches

2008-10-20 Thread Martin v. Löwis
> Since we tripped over these with Trac/Genshi we would appreciate if the
> following could be applied (if not already):

Ok, I've marked them as candidates for a backport.

Regards,
Martin
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com