Maurits van Rees, on 2010-03-03:
> Right, by default this gets mode 420 and it should be 493.
>>>> tarfile.filemode(493)
> '-rwxr-xr-x'
>>>> oct(493)
> '0755'

As Wichert wrote in the zope-checkins list, it is clearer to write
"tarfile.filemode(0755)".  I tried doing that before my commit but got
octals and hexadecimals confused and tried with 0x755, which did not
quite work of course.  Fixed on trunk now in r109648 to indeed use the
octal 0755.

For laughs, I could not figure those numbers out yesterday, so how I
came to that value of 493 was by brute forcing it like this in a
python prompt:

>>> import tarfile
>>> goal = '-rwxr-xr-x'
>>> for i in range(1000):
...     if tarfile.filemode(i) == goal:
...         print i


Maurits van Rees |
            Work |
What are you going to create today?

Zope-CMF maillist  -

See for bug reports and feature requests

Reply via email to