From owner-freebsd-python@freebsd.org Fri Dec 11 22:12:19 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 EE7054BC9C4 for ; Fri, 11 Dec 2020 22:12:19 +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 4Ct4lR5NqWz3F47 for ; Fri, 11 Dec 2020 22:12:19 +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 0BBMCDZq089635 for ; Fri, 11 Dec 2020 14:12:19 -0800 (PST) (envelope-from bsd-lists@bsdforge.com) MIME-Version: 1.0 Date: Fri, 11 Dec 2020 14:12:13 -0800 From: Chris To: freebsd-python Subject: Re: simple python 2 to python 3 question In-Reply-To: <6a21383315418d6ca2711709bd173e08@bsdforge.com> References: <6a21383315418d6ca2711709bd173e08@bsdforge.com> User-Agent: UDNSMS/17.0 Message-ID: <096056be8d2e60a4eaa7f1e78e55878f@bsdforge.com> X-Sender: bsd-lists@bsdforge.com Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4Ct4lR5NqWz3F47 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 22:12:20 -0000 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