From owner-freebsd-python@freebsd.org Fri Dec 11 23:01:07 2020 Return-Path: Delivered-To: freebsd-python@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2D28E4BDEF2 for ; Fri, 11 Dec 2020 23:01:07 +0000 (UTC) (envelope-from bsd-lists@bsdforge.com) Received: from udns.ultimatedns.net (static-24-113-41-81.wavecable.com [24.113.41.81]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "ultimatedns.net", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ct5qk5T2Vz3JKb for ; Fri, 11 Dec 2020 23:01:06 +0000 (UTC) (envelope-from bsd-lists@bsdforge.com) Received: from ultimatedns.net (localhost [127.0.0.1]) by udns.ultimatedns.net (8.16.1/8.16.1) with ESMTP id 0BBN10i2094401; Fri, 11 Dec 2020 15:01:06 -0800 (PST) (envelope-from bsd-lists@bsdforge.com) MIME-Version: 1.0 Date: Fri, 11 Dec 2020 15:01:00 -0800 From: Chris To: Douglas Thrift Cc: freebsd-python@freebsd.org Subject: Re: simple python 2 to python question In-Reply-To: <880d220f-1da9-6594-247c-3a98f9e48ce3@gmail.com> References: <6a21383315418d6ca2711709bd173e08@bsdforge.com> <880d220f-1da9-6594-247c-3a98f9e48ce3@gmail.com> User-Agent: UDNSMS/17.0 Message-ID: <6a2a88964650221c7d33aca73379bac2@bsdforge.com> X-Sender: bsd-lists@bsdforge.com Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4Ct5qk5T2Vz3JKb X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [0.00 / 15.00]; ASN(0.00)[asn:11404, ipnet:24.113.0.0/16, country:US]; local_wl_ip(0.00)[24.113.41.81] X-BeenThere: freebsd-python@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: FreeBSD-specific Python issues List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Dec 2020 23:01:07 -0000 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