On 10.05.2016 00:15, Daniel Shahaf wrote:
stef...@apache.org wrote on Sun, May 08, 2016 at 14:15:43 -0000:
######################################################################
+# Permission constants used with e.g. chmod() and open().
+# Define them here at a central location, so people aren't tempted to
+# use octal literals which are not portable between Python 2 and 3.
For future reference, octal constants with leading "0o" work in both py2
and py3:
0o777 # works in py2 and py3
0777 # works in py2; syntax error in py3
Interesting. The online source that I found made it seem
like there was no compatible way and suggested decimals.
Anyway, using symbolic constants is certainly even better.
-- Stefan^2.