simple python 2 to python 3 question

Chris bsd-lists at bsdforge.com
Fri Dec 11 22:12:20 UTC 2020


On 2020-12-11 14:06, 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 ;-)
Here it is in more context, in case it helps:
              h = open(self.pw_file, 'a')
              if uid != -1:
                  lchown(self.pw_file, uid, -1)
             chmod(self.pw_file, 0600)

Thanks again!
> 
> Thanks!
> 
> --Chris


More information about the freebsd-python mailing list