This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author ncoghlan
Recipients CuriousLearner, ncoghlan
Date 2017-06-21.06:43:16
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1498027397.11.0.620805025664.issue30721@psf.upfronthosting.co.za>
In-reply-to
Content
The specific error in question here is the one where Python 3 reads the old Python 2 stream redirection syntax as a combination of the right shift operator and tuple creation:

```
>>> print >> sys.stderr, "message"
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: unsupported operand type(s) for >>: 'builtin_function_or_method' and '_io.TextIOWrapper'
```

Searching for that error message indicates that people are hitting it reasonably frequently, so we may be able to save them a trip to Google by adding a custom 'Did you mean "print(<output>, file={:100!r})'.format(rhs)"? message when the right-shift operand dispatch is about to report the default "no implementation" type error, and the LHS is the print builtin.
History
Date User Action Args
2017-06-21 06:43:17ncoghlansetrecipients: + ncoghlan, CuriousLearner
2017-06-21 06:43:17ncoghlansetmessageid: <1498027397.11.0.620805025664.issue30721@psf.upfronthosting.co.za>
2017-06-21 06:43:17ncoghlanlinkissue30721 messages
2017-06-21 06:43:16ncoghlancreate