homepage

This issue tracker has been migrated to GitHub , and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author W00D00
Recipients W00D00, doerwalter, georg.brandl, r.david.murray, skip.montanaro
Date 2009年10月24日.08:13:52
SpamBayes Score 0.0001153051
Marked as misclassified No
Message-id <1256372035.62.0.270190586827.issue7185@psf.upfronthosting.co.za>
In-reply-to
Content
Hi Everyone,
I have tried the "utf-8-sig" and it does not work in this case or 
rather I think not the csv module is wrong. The seek() does not work 
correctly in the csv file or object.
With "utf-8-sig" the file is opend correctly and the first row does not 
include the BOM problem. It is great. 
I am sorry I have not known this until now. (I am not a python expert 
yet :))
However, I have gote some misstake like this 'AFTE\ufeffVALUE".WAV' 
during my running script.
"AFTER" is a valid string in the given csv file but the BOM follows it.
This happens after when I seek up to "0" some times in the csv file.
And the string "aftevalue" LEAVE_HIGHWAY-E" is produced which is wrong.
My sollution is that I convert the csv object into a list after the 
file openeing:
 InDistancesFile = codecs.open( Root, 'r', encoding='utf-8' )
 txt = InDistancesFile.read()[1:] # to leave the BOM
 lines = txt.splitlines()[1:] # to leave the first row which is 
a header
 InDistancesObj = list(csv.reader( lines )) # convert the csv 
reader object into a simple list
Many thanks for your help,
Istvan
History
Date User Action Args
2009年10月24日 08:13:55W00D00setrecipients: + W00D00, skip.montanaro, doerwalter, georg.brandl, r.david.murray
2009年10月24日 08:13:55W00D00setmessageid: <1256372035.62.0.270190586827.issue7185@psf.upfronthosting.co.za>
2009年10月24日 08:13:54W00D00linkissue7185 messages
2009年10月24日 08:13:53W00D00create

AltStyle によって変換されたページ (->オリジナル) /