[issue12982] Document that importing .pyo files needs python -O

2016-08-20 Thread Berker Peksag
Berker Peksag added the comment: Yes, this can be closed as 'out of date'. I've just updated -O documentation to remove the mention of .pyo extension. Thanks! -- nosy: +berker.peksag resolution: -> out of date stage: needs patch -> resolved status: open -> closed _

[issue12982] Document that importing .pyo files needs python -O

2016-08-20 Thread Roundup Robot
Roundup Robot added the comment: New changeset 8e9dc3e4ea91 by Berker Peksag in branch '3.5': Issue #12982: Thanks to PEP 488, Python no longer creates .pyo files https://hg.python.org/cpython/rev/8e9dc3e4ea91 New changeset 1455851e7332 by Berker Peksag in branch 'default': Issue #12982: Merge f

[issue12982] Document that importing .pyo files needs python -O

2016-08-19 Thread Caleb Hattingh
Caleb Hattingh added the comment: Presumably PEP488 (and the 4 years of inactivity) means that this issue could be closed? -- nosy: +cjrh ___ Python tracker ___

[issue12982] Document that importing .pyo files needs python -O

2012-06-19 Thread Eric O. LEBIGOT
Eric O. LEBIGOT added the comment: Thank you for this lucid account of the situation, Terry. As for where in the documentation something additional could be said about .pyo files and the -O option, I must say that it is already mentioned in some relevant places (http://docs.python.org/tutori

[issue12982] Document that importing .pyo files needs python -O

2012-06-14 Thread Terry J. Reedy
Terry J. Reedy added the comment: Eric, can you find a place in the current doc where -O and .pyo are mentioned, and where you think a sentence should go. What sentence(s) would you like to see. Other comments: __debug__ is intended to be a process-global compilation value (implemented as a

[issue12982] Document that importing .pyo files needs python -O

2012-06-14 Thread Ronan Lamy
Ronan Lamy added the comment: Doing it at the interpreter level is trivial (cf. patch), except for an annoying bug I noticed (see below). Doing it from user code might require some care to avoid disrupting existing import hooks, but AFAICT something like sys.path_hooks.append(FileFinder.path_

[issue12982] Document that importing .pyo files needs python -O

2012-06-14 Thread Eric Snow
Eric Snow added the comment: > I am not fully sure why -O is essentially required for running .pyo > files: why not have the Python interpreter handle everything > automatically based on the extension? In part because it would take work to make it happen and apparently no one feels strongly en

[issue12982] Document that importing .pyo files needs python -O

2012-06-14 Thread R. David Murray
R. David Murray added the comment: Because: 1) The __debug__ flag is defined to be process-global. If you test it in one module, your code should be able to assume that it has the same value in all other modules 2) python-dev does not support running .pyo code without -O turned on. In

[issue12982] Document that importing .pyo files needs python -O

2012-06-14 Thread Michael Herrmann
Michael Herrmann added the comment: That is *exactly* my point :) -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubsc

[issue12982] Document that importing .pyo files needs python -O

2012-06-14 Thread Eric O. LEBIGOT
Eric O. LEBIGOT added the comment: Terry, it seems that the doc I was quoting is for version 1.5.1 (http://docs.python.org/release/1.5.1p1/tut/node43.html). I can't find it in more recent versions of the doc. I should not have quoted an obsolete version of the documentation—I'm not sure how t

[issue12982] Document that importing .pyo files needs python -O

2012-06-13 Thread Terry J. Reedy
Terry J. Reedy added the comment: The response from pydev is that running .pyc with -O or running .pyo without is not officially supported. Even if mixing usually works now, it does not always work properly for code with __debug__, assert, or __doc__. The scope of possible malfunctions may in

[issue12982] Document that importing .pyo files needs python -O

2012-06-12 Thread Ronan Lamy
Changes by Ronan Lamy : -- nosy: +Ronan.Lamy ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python

[issue12982] Document that importing .pyo files needs python -O

2012-06-12 Thread Terry J. Reedy
Terry J. Reedy added the comment: Michael, you should ask the closed source library distributor to distribute all files as .pyc so you have access to docstrings while programming and to avoid the problem with reading them. He could also distribute an all-.pyo version. A mixture seems accident

[issue12982] Document that importing .pyo files needs python -O

2012-06-12 Thread Michael Herrmann
Michael Herrmann added the comment: Dear Eric OL, I see - I had read your e-mail but because of the similar names I thought the message here was yours too, and thus only replied once. I apologize! I can of course find a workaround such as renaming .pyo to .pyc. However, I would like to avoid

[issue12982] Document that importing .pyo files needs python -O

2012-06-12 Thread Eric O. LEBIGOT
Eric O. LEBIGOT added the comment: Hi Michael, Thank you for your message. You are mentioning the suggestion of "the other Eric" (Araujo). My suggestion was to rename your .pyo files as .pyc files; it is hackish (according to a previous post from Eric Araujo), but might save you some trouble

[issue12982] Document that importing .pyo files needs python -O

2012-06-12 Thread R. David Murray
R. David Murray added the comment: Actually it's a lot easier than that, although it is very much a hack: just rename the .pyo files to .pyc, and python without -O will happily import them. Since the optimization happens when the bytecode is written, this does what you want. -- nosy

[issue12982] Document that importing .pyo files needs python -O

2012-06-12 Thread Michael Herrmann
Michael Herrmann added the comment: Hi Eric, thank you for your quick reply. I'm not the first one who encounters this problem and in my opinion it is simply counter-intuitive that you cannot read a mixture of .pyo and .pyc files. That is why I think that my proposed change is valuable. In t

[issue12982] Document that importing .pyo files needs python -O

2012-06-12 Thread Éric Araujo
Changes by Éric Araujo : -- title: .pyo file can't be imported unless -O is given -> Document that importing .pyo files needs python -O ___ Python tracker ___ __