[issue6909] python 3.1 - filecmp.cmp exception based on file name

2009-09-14 Thread R. David Murray

R. David Murray  added the comment:

You should try removing the try/except to find out which line is
actually throwing the error.  I think you will find that it is the print
statement.

--
nosy: +r.david.murray

___
Python tracker 

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



[issue6909] python 3.1 - filecmp.cmp exception based on file name

2009-09-14 Thread jeff deifik

jeff deifik  added the comment:

Forgive all the print statements.

Here is the result of running this:

floup:files are
['./Julio_Iglesias-Un_Hombre_Solo-05-Qu\udce9_no_se_rompa_la_noche.mp3',
'/cygdrive/j/music/bea/Julio_Iglesias-Un_Hombre_Solo-05-Qu\udce9_no_se_rompa_la_noche.mp3']
l is greater than 1
i and j 0 1
two files 0 1
two files ./Jul /cygd
try two files 0 1
try two files (5) ./Jul /cygd
try two files exception =  'ascii' codec can't encode character '\udce9'
in position 37: ordinal not in range(128)


# Compare all files with the same size to each other
def look_through_table(the_tab):
global Options
# loop through file sizes that
for size in list(the_tab.keys()):
files = the_tab[size]   # List of all files with same size
l = len(files)
print('floup:files are', files)
if l > 1:
print('l is greater than 1')
for i in range(l):
for j in range(i + 1, l):
print('i and j', i, j)
print('two files', i, j)
print('two files', files[i][0:5], files[j][0:5])

if Options.name == False or \
os.path.basename(files[i]) ==
os.path.basename(files[j]):
# print 'cmp_two_files', files[i], files[j], \
#cmp_two_files(files[i], files[j])
try:
print('try two files', i, j)
print('try two files (5)', files[i][0:5],
files[j][0:5])
print('try two files', files[i], files[j])
if filecmp.cmp(files[i], files[j], False):
print('MATCHED')
print(files[i])
print(" and ", files[j])
else:
print('DID NOT MATCH')
except Exception as inst:
print('exception = ', inst)
pass

--

___
Python tracker 

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



[issue6909] python 3.1 - filecmp.cmp exception based on file name

2009-09-14 Thread Benjamin Peterson

Benjamin Peterson  added the comment:

Could you paste your code?

--
nosy: +benjamin.peterson

___
Python tracker 

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



[issue6909] python 3.1 - filecmp.cmp exception based on file name

2009-09-14 Thread jeff deifik

New submission from jeff deifik :

I am calling filecmp.cmp on a two files, one of which has a name of

'./Julio_Iglesias-Un_Hombre_Solo-05-Qu\udce9_no_se_rompa_la_noche.mp3'

I get an exception from filecmp.cmp saying:
 'ascii' codec can't encode character '\udce9' in position 37: ordinal
not in range(128)

I do not understand why filecmp.cmp cares what the encoding of the names
of the files are, as long as they are valid files. I would think
filecmp.cmp would only care about the content of the files.

When I give it pure ascii names, filecmp.cmp works file, however some of
my files have udce9 encoded names.

This is on a windows xp machine running cygwin (linux emulation).
I built and compiled python3.1 from source.

--
messages: 92613
nosy: jdeifik
severity: normal
status: open
title: python 3.1 - filecmp.cmp exception based on file name
type: behavior
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



[issue6909] python 3.1 - filecmp.cmp exception based on file name

2009-09-14 Thread R. David Murray

Changes by R. David Murray :


--
resolution:  -> invalid
stage:  -> committed/rejected

___
Python tracker 

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



[issue6909] python 3.1 - filecmp.cmp exception based on file name

2009-09-14 Thread jeff deifik

jeff deifik  added the comment:

Oops, you are correct, my mistake.

--
status: open -> closed

___
Python tracker 

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