Closed lod closed 1 year ago
This patch changes the error to a different error, but doesn't fix it for me.
>>> import pycdlib
>>> iso = pycdlib.PyCdlib()
>>> iso.new(rock_ridge='1.09', vol_ident='CIDATA')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/lab/lib/python3.11/site-packages/pycdlib/pycdlib.py", line 3895, in new
self.pvd = headervd.pvd_factory(sys_ident_bytes, vol_ident_bytes,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/lab/lib/python3.11/site-packages/pycdlib/headervd.py", line 809, in pvd_factory
pvd.new(0, sys_ident, vol_ident, set_size, seqnum, log_block_size,
File "/lab/lib/python3.11/site-packages/pycdlib/headervd.py", line 318, in new
self.volume_creation_date.new(now)
File "/lab/lib/python3.11/site-packages/pycdlib/dates.py", line 256, in new
self.date_str = time.strftime(self.TIME_FMT, local).encode('utf-8') + '{:0<2}'.format(self.hundredthsofsecond).encode('utf-8') + struct.pack('=b', self.gmtoffset)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
struct.error: required argument is not an integer
>>> import pycdlib
>>> iso = pycdlib.PyCdlib()
>>> iso.new(rock_ridge='1.09', vol_ident='CIDATA')
> /lab/lib/python3.11/site-packages/pycdlib/utils.py(223)gmtoffset_from_tm()
-> return offset_hours
(Pdb) type(offset_hours)
<class 'float'>
(Pdb) offset_hours
-5.0
(Pdb) int(offset_hours)
-5
See my comment in https://github.com/clalancette/pycdlib/issues/107#issuecomment-1368573568 , where I fixed this a different way. Given that, I'm going to close this out. But thanks for the contribution!
Fixes 117
Rework gmtoffset_from_tm to use seconds based maths