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 vstinner
Recipients barry, serhiy.storchaka, vstinner, xiang.zhang
Date 2018-07-11.09:33:44
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1531301625.0.0.56676864532.issue34084@psf.upfronthosting.co.za>
In-reply-to
Content
> I expected it should be easy to reproduce a crash, but I failed to find an example.

I don't understand how parsetok.c is supposed to handle "from __future__ import barry_as_FLUFL":

* Parser/parsetok.c tests (ps->p_flags & CO_FUTURE_BARRY_AS_BDFL)
* Python/future.c uses "if (strcmp(feature, FUTURE_BARRY_AS_BDFL) == 0) { ff->ff_features |= CO_FUTURE_BARRY_AS_BDFL; }"
* Python/pythonrun.c: PARSER_FLAGS() copies CO_FUTURE_BARRY_AS_BDFL flag as PyPARSE_BARRY_AS_BDFL

The only way to use "<>" operator seems to pass explicitly CO_FUTURE_BARRY_AS_BDFL flag to compile() flags, which is not the convenient way to use "from __future__ import barry_as_FLUFL" :-(

Code:
---
import inspect
CO_FUTURE_BARRY_AS_BDFL = 0x40000
flags = CO_FUTURE_BARRY_AS_BDFL
code = "print(1 <> 2)"
try:
    compile(code, "filename", "exec", flags=0)
except SyntaxError:
    print("ok")
else:
    raise Exception("SyntaxError expected")
compile(code, "filename", "exec", flags=flags)
print("ok")
---

Maybe we need a test for the easter egg. Or maybe we should remove it? :-p
History
Date User Action Args
2018-07-11 09:33:45vstinnersetrecipients: + vstinner, barry, serhiy.storchaka, xiang.zhang
2018-07-11 09:33:45vstinnersetmessageid: <1531301625.0.0.56676864532.issue34084@psf.upfronthosting.co.za>
2018-07-11 09:33:44vstinnerlinkissue34084 messages
2018-07-11 09:33:44vstinnercreate