PiRSquared17 / py-unrar2

Automatically exported from code.google.com/p/py-unrar2
MIT License
0 stars 0 forks source link

info needs to be shifted #6

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
For my system when setting data['datetime'] using time.strptime(info[37:51], 
'%d-%m-%y %H:%M'), it raises a value error.  Shifting info to 38:52 resolves 
the issue.

What steps will reproduce the problem?
python test_UnRAR2

What version of the product are you using? On what operating system?
POWERTUX ~ % uname -a                                                           

 2010-07-18  7:29pm
Linux POWERTUX 2.6.34-ARCH #1 SMP PREEMPT Mon Jul 5 21:03:38 UTC 2010 i686 AMD 
Athlon(tm) 64 X2 Dual Core Processor 4800+ AuthenticAMD GNU/Linux
POWERTUX ~ % python --version                                                   

 2010-07-18  7:29pm
Python 2.6.5
POWERTUX ~ % locale                                                             

 2010-07-18  7:29pm
LANG=en_US.utf8
LC_CTYPE="en_US.utf8"
LC_NUMERIC="en_US.utf8"
LC_TIME="en_US.utf8"
LC_COLLATE=C
LC_MONETARY="en_US.utf8"
LC_MESSAGES="en_US.utf8"
LC_PAPER="en_US.utf8"
LC_NAME="en_US.utf8"
LC_ADDRESS="en_US.utf8"
LC_TELEPHONE="en_US.utf8"
LC_MEASUREMENT="en_US.utf8"
LC_IDENTIFICATION="en_US.utf8"
LC_ALL=

Please provide any additional information below.

POWERTUX ~/Downloads/pyUnRAR2-0.98 % python test_UnRAR2.py                      

 2010-07-18  7:30pm
Traceback (most recent call last):
  File "test_UnRAR2.py", line 16, in <module>
    UnRAR2.RarFile('test.rar').extract()
  File "/usr/lib/python2.6/site-packages/UnRAR2/__init__.py", line 156, in extract
    return RarFileImplementation.extract(self, checker, path, withSubpath, overwrite)
  File "/usr/lib/python2.6/site-packages/UnRAR2/unix.py", line 132, in extract
    for info in self.infoiter():
  File "/usr/lib/python2.6/site-packages/UnRAR2/__init__.py", line 118, in infoiter
    for params in RarFileImplementation.infoiter(self):
  File "/usr/lib/python2.6/site-packages/UnRAR2/unix.py", line 102, in infoiter
    data['datetime'] = time.strptime(info[38:52], '%d-%m-%y %H:%M')
  File "/usr/lib/python2.6/_strptime.py", line 454, in _strptime_time
    return _strptime(data_string, format)[0]
  File "/usr/lib/python2.6/_strptime.py", line 325, in _strptime
    (data_string, format))
ValueError: time data '0-06-03 01:59 ' does not match format '%d-%m-%y %H:%M'

Original issue reported on code.google.com by valentin...@gmail.com on 19 Jul 2010 at 1:29

GoogleCodeExporter commented 9 years ago
it looks like google formatted my output funny.

distribution:
ArchLinux

uname -a:
Linux POWERTUX 2.6.34-ARCH #1 SMP PREEMPT Mon Jul 5 21:03:38 UTC 2010 i686 AMD 
Athlon(tm) 64 X2 Dual Core Processor 4800+ AuthenticAMD GNU/Linux

python --version
Python 2.6.5

locale:
LANG=en_US.utf8
LC_CTYPE="en_US.utf8"
LC_NUMERIC="en_US.utf8"
LC_TIME="en_US.utf8"
LC_COLLATE=C
LC_MONETARY="en_US.utf8"
LC_MESSAGES="en_US.utf8"
LC_PAPER="en_US.utf8"
LC_NAME="en_US.utf8"
LC_ADDRESS="en_US.utf8"
LC_TELEPHONE="en_US.utf8"
LC_MEASUREMENT="en_US.utf8"
LC_IDENTIFICATION="en_US.utf8"
LC_ALL=

Original comment by valentin...@gmail.com on 19 Jul 2010 at 1:37

GoogleCodeExporter commented 9 years ago
Probably caused by one of files in the archive being larger than 100 Mb.

Original comment by yk4e...@gmail.com on 20 Jul 2010 at 10:17

GoogleCodeExporter commented 9 years ago
Fixed in v. 0.99

Original comment by yk4e...@gmail.com on 20 Jul 2010 at 10:18