[Zope-Checkins] CVS: Zope/lib/python/App - tar.py:1.8

Brian Lloyd brian at zope.com
Mon Jan 19 11:28:09 EST 2004


Update of /cvs-repository/Zope/lib/python/App
In directory cvs.zope.org:/tmp/cvs-serv11247

Modified Files:
	tar.py 
Log Message:
fix mtime overflow


=== Zope/lib/python/App/tar.py 1.7 => 1.8 ===
--- Zope/lib/python/App/tar.py:1.7	Tue Nov 18 08:16:58 2003
+++ Zope/lib/python/App/tar.py	Mon Jan 19 11:28:08 2004
@@ -28,7 +28,14 @@
 
 def oct12(i):
     i=oct(i)
-    return '0'*(11-len(i))+i+' '
+    v = '0'*(11-len(i))+i+' '
+    if len(v) > 12:
+        left = v[:-12]
+        for c in left:
+            if c != '0':
+                raise ValueError, 'value too large for oct12'
+        return v[-12:]
+    return v
 
 def pad(s,l):
     ls=len(s)




More information about the Zope-Checkins mailing list