simple python 2 to python question

Douglas Thrift douglaswth at gmail.com
Fri Dec 11 22:41:46 UTC 2020


On 12/11/2020 2:06 PM, Chris wrote:
> Hello all,
> I'm working on a port I maintain to become py3x compatible.
> I'm down to one lousy error:
> passwd.py", line 25    chmod(self.pw_file, 0600)
>                             ^
> SyntaxError: invalid token
> 
> I tried to sort it, but failed. So allowed 2to3 to take a shot
> at it, and it returned:
> chmod(self.pw_file, 0o600)
> 
> which just seems wrong.
> 
> What am I missing -- aside from more familiarity with python3 ;-)
> 
> Thanks!
> 
> --Chris
> _______________________________________________
> freebsd-python at freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/freebsd-python
> To unsubscribe, send any mail to "freebsd-python-unsubscribe at freebsd.org"

Python 3 changed the syntax for octal literals to start with '0o' rather 
than with just '0', so '0o600' is correct.
-- 
Douglas William Thrift
<https://douglasthrift.net/>


More information about the freebsd-python mailing list