Author ncoghlan
Recipients Tim.Graham, abarry, brett.cannon, eric.smith, martin.panter, ncoghlan, ned.deily, r.david.murray, rhettinger, serhiy.storchaka, yan12125, yselivanov
Date 2016-09-17.12:06:16
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1474113976.99.0.477329835242.issue28128@psf.upfronthosting.co.za>
In-reply-to
Content
Eric's basic approach sounds fine to me.

The "pre-compiled .pyc files won't trigger SyntaxWarning" problem isn't new, as it exists for the old 3.5 warnings as well (-B prevents writing bytecode, which may be handy while working on this. Unfortunately, there's no equivalent to prevent reading it except deleting the offending bytecode file):

  $ python3 -B -c "import syntax_warning" 
  /home/ncoghlan/devel/py36/syntax_warning.py:3: SyntaxWarning: name 'x' is assigned to before global declaration
    global x
  $ python3 -c "import syntax_warning" 
  /home/ncoghlan/devel/py36/syntax_warning.py:3: SyntaxWarning: name 'x' is assigned to before global declaration
    global x
  $ python3 -c "import syntax_warning" 
  $ rm __pycache__/syntax_warning.cpython-35.pyc 
  $ python3 -B -c "import syntax_warning" 
  /home/ncoghlan/devel/py36/syntax_warning.py:3: SyntaxWarning: name 'x' is assigned to before global declaration
    global x

As long as folks are running their tests at least once in fresh environments they'll see the warning.
History
Date User Action Args
2016-09-17 12:06:17ncoghlansetrecipients: + ncoghlan, brett.cannon, rhettinger, eric.smith, ned.deily, r.david.murray, martin.panter, serhiy.storchaka, yselivanov, Tim.Graham, yan12125, abarry
2016-09-17 12:06:16ncoghlansetmessageid: <1474113976.99.0.477329835242.issue28128@psf.upfronthosting.co.za>
2016-09-17 12:06:16ncoghlanlinkissue28128 messages
2016-09-17 12:06:16ncoghlancreate