[issue4871] zipfile can't decrypt

2009-01-07 Thread Glade Diviney

New submission from Glade Diviney :

If a password is supplied using zpifile.read(objName, password), a 
TypeError occurs:

  File "C:\Program Files\Python30\lib\zipfile.py", line 420, in __init__
self._UpdateKeys(p)
  File "C:\Program Files\Python30\lib\zipfile.py", line 424, in 
_UpdateKeys
self.key0 = self._crc32(c, self.key0)
  File "C:\Program Files\Python30\lib\zipfile.py", line 413, in _crc32
return ((crc >> 8) & 0xff) ^ self.crctable[(crc ^ ch) & 0xff]
TypeError: unsupported operand type(s) for ^: 'int' and 'str'

This is resolved in zipfile.py by replacing this line in __init__:
 self._UpdateKeys(ord(p))

--
components: Library (Lib)
messages: 79368
nosy: gladed
severity: normal
status: open
title: zipfile can't decrypt
type: behavior
versions: Python 3.0

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



[issue4871] zipfile can't decrypt

2009-01-08 Thread Glade Diviney

Glade Diviney  added the comment:

In this case under test, the password string had been clipped from a 
filename, so I suppose it would have been Unicode.

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