* aifc.py: don't die on invalid MARK chunk

* calendar.py: remove stuff now built in time; some cleanup and
  generalization in the calendar printing
* cmd.py: use __init__.
* tzparse.py: This module is no longer necessary -- use builtin time instead!
This commit is contained in:
Guido van Rossum 1993-06-20 21:02:22 +00:00
parent 52fc1f607e
commit 9b3bc71598
4 changed files with 104 additions and 133 deletions

View file

@ -563,11 +563,20 @@ class Aifc_read:
def _readmark(self, chunk):
nmarkers = _read_short(chunk)
for i in range(nmarkers):
id = _read_short(chunk)
pos = _read_long(chunk)
name = _read_string(chunk)
self._markers.append((id, pos, name))
# Some files appear to contain invalid counts.
# Cope with this by testing for EOF.
try:
for i in range(nmarkers):
id = _read_short(chunk)
pos = _read_long(chunk)
name = _read_string(chunk)
self._markers.append((id, pos, name))
except EOFError:
print 'Warning: MARK chunk contains only',
print len(self._markers),
if len(self._markers) == 1: print 'marker',
else: print 'markers',
print 'instead of', nmarkers
class Aifc_write:
# Variables used in this class: