Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.057 X-Spam-Evidence: '*H*': 0.89; '*S*': 0.00; 'syntax': 0.04; 'debug': 0.07; 'python': 0.11; '-------': 0.16; 'octal': 0.16; 'overriding': 0.16; 'permissions,': 0.16; 'syntaxerror:': 0.16; 'wrote:': 0.18; 'wed,': 0.18; '>>>': 0.22; 'code,': 0.22; 'header :User-Agent:1': 0.23; '2.x': 0.24; 'source': 0.25; 'header:In- Reply-To:1': 0.27; 'chris': 0.29; 'leave': 0.29; 'am,': 0.29; 'unix': 0.29; 'file': 0.32; 'supposed': 0.32; 'checking': 0.33; 'guess': 0.33; 'sense': 0.34; "i'd": 0.34; 'equal': 0.35; 'there': 0.35; 'error.': 0.37; 'to:addr:python-list': 0.38; 'to:addr:python.org': 0.39; 'dave': 0.60; 'most': 0.60; 'course': 0.61; 'invalid': 0.68; 'received:74.208': 0.68; 'comment.': 0.84; 'received:74.208.4.194': 0.84; 'surround': 0.84; 'angel': 0.91; '2013': 0.98 Date: Tue, 30 Apr 2013 11:58:33 -0400 From: Dave Angel User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130329 Thunderbird/17.0.5 MIME-Version: 1.0 To: python-list@python.org Subject: Re: shmid = shmget(SHM_KEY, SHM_SIZE, 0o666) - syntax error. References: <517FE68A.1000703@davea.name> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V02:K0:BuQM3Mpl4JMefY8s59P1gk0mkRr3QEvLq84IuvYMAZf P8vYomPAOncK/oDtHz0lOV2ea02qifF7cB6xlm0+E/RaBYSgec cKvwrC5/ejHwm9dKexcd4IIJDjzT8sqSSag8x7GlMKw2NNuZfT JahUnTJRZMLubzns4hr65qi9W3eB1WZRSnjWf/W5HJOu8XyJ1V UE0BsFVrBG6HQ5iZY0UW738rtxmxNP9549Wrv/7wVrCZTEUjdP W5Qhho5dxWidfN9OtgLJdF0PS29I2OKEQpCevVvG2UjBW3Ekig EsGZuvVUjzOptCtla4c73GGF4XH8Za+UxtnDJcXExe0c0PzKQ= = X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 30 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1367337534 news.xs4all.nl 15953 [2001:888:2000:d::a6]:58928 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:44550 On 04/30/2013 11:49 AM, Chris Angelico wrote: > On Wed, May 1, 2013 at 1:43 AM, Dave Angel wrote: >> On 04/30/2013 11:27 AM, tromeo@mdlogix.com wrote: >>> >>> >>> Please help me to debug >>> >>> ------- >>> shmid = shmget(SHM_KEY, SHM_SIZE, 0o666) >>> ^ >>> SyntaxError: invalid syntax >>> >> >> 0o666 is indeed a syntax error. What is that value supposed to be? If it's >> intended to be an int that's equal to octal 666, just use 438 > > Without checking docs, I would guess that to be Unix file permissions, > which make most sense in octal. > > So put the octal description in the comment. I think the Python 2.x syntax for octal is a travesty. And of course it's non-portable to Python 3. I would not intentionally leave 0666 in my source code, unless there was some other overriding reason for it. And then I'd surround it with snide remarks. -- DaveA