<br><br><div class="gmail_quote">On Tue, Jun 12, 2012 at 1:04 PM, <a href="mailto:fwierzbicki@gmail.com">fwierzbicki@gmail.com</a> <span dir="ltr"><<a href="mailto:fwierzbicki@gmail.com" target="_blank">fwierzbicki@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On Tue, Jun 12, 2012 at 9:38 AM, Alex Gaynor <<a href="mailto:alex.gaynor@gmail.com">alex.gaynor@gmail.com</a>> wrote:<br>
> For PyPy: I'm not an expert in our import, but from looking at the source<br>
><br>
> 1) imp.cache_from_source is unimplemented, it's an AttributeError.<br>
</div>Jython does not (yet) have a cache_from_source.<br>
<div class="im"><br>
> 2) sys.dont_write_bytecode is always false, we don't respect that flag (we really<br>
> should IMO, but it's not a high priority for me, or anyone else apparently)<br>
</div>Jython does support sys.dont_write_bytecode, but doesn't support<br>
sys.dont_read_bytecode yet - do you happen to know when<br>
dont_read_bytecode was added?</blockquote><div><br></div><div>It was never added since it doesn't currently exist; I said *add* sys.dont_read_bytecode, not *use*. =)</div><div><br></div><div>Would the flag actually be beneficial? Have you had issues where people assumed that Jython should be able to read bytecode since they just didn't worry about a VM that can't read bytecode? I mean I'm open to suggestions as ways to control bytecode reading to fail gracefully in case someone runs Jython (or IronPython) in a directory where PyPy or CPython was run previously and thus the bytecode exists from them. That's why I asked what marshal.loads() does; if it returns None or raises some exception that can be distinguished from a failure of badly formatted marshal data then I could rely on that as another option.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> It should be pretty straightforward, and<br>
so I'll probably add it to our 2.7.<br></blockquote><div><br></div><div>I would assume it would just be a flag for you. Importlib and other stdlib code would be where all the work would be to start obeying the flag (if it is added).</div>