Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 11 Dec 2020 15:01:00 -0800
From:      Chris <bsd-lists@bsdforge.com>
To:        Douglas Thrift <douglaswth@gmail.com>
Cc:        freebsd-python@freebsd.org
Subject:   Re: simple python 2 to python question
Message-ID:  <6a2a88964650221c7d33aca73379bac2@bsdforge.com>
In-Reply-To: <880d220f-1da9-6594-247c-3a98f9e48ce3@gmail.com>
References:  <6a21383315418d6ca2711709bd173e08@bsdforge.com> <880d220f-1da9-6594-247c-3a98f9e48ce3@gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On 2020-12-11 14:41, Douglas Thrift wrote:
> 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
> 
> Python 3 changed the syntax for octal literals to start with '0o' rather 
> than with
> just '0', so '0o600' is correct.
A huge thanks, doug! :-)
I guess I should have already known that. But it just looked so wrong.

--Chris




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6a2a88964650221c7d33aca73379bac2>