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 eric.araujo
Recipients belopolsky, cben, eric.araujo, lesmana, loewis, ned.deily, pitrou, r.david.murray, ronaldoussoren
Date 2011-09-05.16:30:43
SpamBayes Score 4.0153825e-11
Marked as misclassified No
Message-id <>
We can’t just decide to enable completion by checking “'readline' in sys.modules” in site, because it always returns False.  site is imported in Python/pythonrun.c, and I guess that Modules/main.c is run afterwards.  More importantly, I think the import of readline in Modules/main.c is a CPython implementation detail, and I’d prefer to have code in site that is directly useful for other VMs.  (I’d go as far as proposing to remove the import readline from main.c, when my patch makes it obsolete.)

I re-read the docs for sys.argv and the -m switch and decided to translate to C checks (“command == NULL && filename == NULL && module == NULL”) to “if not sys.argv[0]”.  Unfortunately, sys.argv is not available when site is imported, so this is a dead end :(

So, I could try your _setupinteractive module idea, even though I think it’s a bit unclean, or drink the cool aid and set up completion in main.c.
Date User Action Args
2011-09-05 16:30:45eric.araujosetrecipients: + eric.araujo, loewis, ronaldoussoren, cben, belopolsky, pitrou, ned.deily, r.david.murray, lesmana
2011-09-05 16:30:44eric.araujosetmessageid: <>
2011-09-05 16:30:44eric.araujolinkissue5845 messages
2011-09-05 16:30:43eric.araujocreate