Re: 'r' vs 'rb' in csv (was Re: Python SHA-1 as a method for unique file identification ? [help!])

2006-06-26 Thread Andrew McNamara
>> On a semi-related note, I have a database on Linux that imports from a >> Macintosh CSV file. The 'csv' module says to always open files in >> binary mode, but this didn't work in my case: I had to open it as 'rU' >> (text with universal newlines) or 'csv' misparsed it. I'd like the >> program

Re: 'r' vs 'rb' in csv (was Re: Python SHA-1 as a method for unique file identification ? [help!])

2006-06-26 Thread John Machin
On 27/06/2006 6:39 AM, Mike Orr wrote: > Tim Peters wrote: >> [EP <[EMAIL PROTECTED]>] >>> This inquiry may either turn out to be about the suitability of the >>> SHA-1 (160 bit digest) for file identification, the sha function in >>> Python ... or about some error in my script >> It's your script.

'r' vs 'rb' in csv (was Re: Python SHA-1 as a method for unique file identification ? [help!])

2006-06-26 Thread Mike Orr
Tim Peters wrote: > [EP <[EMAIL PROTECTED]>] > > This inquiry may either turn out to be about the suitability of the > > SHA-1 (160 bit digest) for file identification, the sha function in > > Python ... or about some error in my script > > It's your script. Always open binary files in binary mode

Re: Python SHA-1 as a method for unique file identification ? [help!]

2006-06-21 Thread Tim Peters
[EP <[EMAIL PROTECTED]>] > This inquiry may either turn out to be about the suitability of the > SHA-1 (160 bit digest) for file identification, the sha function in > Python ... or about some error in my script It's your script. Always open binary files in binary mode. It's a disaster on Windows

Re: Python SHA-1 as a method for unique file identification ? [help!]

2006-06-21 Thread Justin Ezequiel
EP wrote: > This inquiry may either turn out to be about the suitability of the > SHA-1 (160 bit digest) for file identification, the sha function in > Python ... or about some error in my script. > > This is on Windows XP. > > def hashit(pth): > fs=open(pth,'r').read() > sh=sha.new(fs).hex

Python SHA-1 as a method for unique file identification ? [help!]

2006-06-21 Thread EP
This inquiry may either turn out to be about the suitability of the SHA-1 (160 bit digest) for file identification, the sha function in Python ... or about some error in my script. Any insight appreciated in advance. I am trying to reduce duplicate files in storage at home - I have a large numbe