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.

classification
Title: py_compile.compile() does not specify if it can accept a file like object or a bytes like object with the file's data.
Type: behavior Stage: resolved
Components: Documentation, Library (Lib) Versions: Python 3.6, Python 3.5
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: docs@python Nosy List: Decorater, SilentGhost, docs@python, python-dev, r.david.murray, xiang.zhang
Priority: normal Keywords:

Created on 2016-08-13 15:17 by Decorater, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
py_compile.rst Decorater, 2016-08-13 17:47 patched documentation file. (3.5)
Messages (9)
msg272590 - (view) Author: Decorater (Decorater) * Date: 2016-08-13 15:17
py_compile.compile() does not specify if it can accept a file like object or a bytes like object with the file's data.

Although I need something that can allow me to import byte like objects if the object contains valid python script data.
(basically it would have to act as a import unless I have to exec the data in it which would be totally bad as it would not be able to retain all of the data.

Long story short I need a way to import the data returned from the dec_script() function in this: https://bpaste.net/show/694c231c566c
msg272591 - (view) Author: SilentGhost (SilentGhost) * (Python triager) Date: 2016-08-13 15:41
It says "The source code is loaded from the file name *file*". That seems unambiguous enough to me.
msg272593 - (view) Author: Xiang Zhang (xiang.zhang) * (Python committer) Date: 2016-08-13 16:43
Maybe in the sentence, name should be named?
msg272594 - (view) Author: Decorater (Decorater) * Date: 2016-08-13 16:52
yeah, true and to specify that it cannot be anything but a file.
msg272595 - (view) Author: SilentGhost (SilentGhost) * (Python triager) Date: 2016-08-13 17:01
Do you care to propose an improved wording?
msg272599 - (view) Author: Decorater (Decorater) * Date: 2016-08-13 17:47
Ok, file uploaded.
msg272600 - (view) Author: SilentGhost (SilentGhost) * (Python triager) Date: 2016-08-13 17:51
I don't see how this is an improvement. Before it clearly said that the first argument must be file name, now it's an oddly confusing statement. Also, typically we don't list all the possibilities of what the arguments must not be.
msg272607 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2016-08-13 18:48
New changeset b1e4c8a3e786 by R David Murray in branch '2.7':
#27753: fix typo (name->named).
https://hg.python.org/cpython/rev/b1e4c8a3e786

New changeset c1cc1f616285 by R David Murray in branch '3.5':
#27753: fix typo (name->named).
https://hg.python.org/cpython/rev/c1cc1f616285

New changeset dda25c37d02b by R David Murray in branch 'default':
Merge: #27753: fix typo (name->named).
https://hg.python.org/cpython/rev/dda25c37d02b
msg272608 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2016-08-13 18:49
Agreed, the current wording is correct and complete, except for the name vs named bit.  I've fixed that.
History
Date User Action Args
2022-04-11 14:58:34adminsetgithub: 71940
2016-08-13 18:49:33r.david.murraysetstatus: open -> closed

nosy: + r.david.murray
messages: + msg272608

resolution: fixed
stage: resolved
2016-08-13 18:48:42python-devsetnosy: + python-dev
messages: + msg272607
2016-08-13 17:51:13SilentGhostsetmessages: + msg272600
2016-08-13 17:47:52Decoratersetmessages: + msg272599
2016-08-13 17:47:26Decoratersetfiles: + py_compile.rst
2016-08-13 17:01:35SilentGhostsetmessages: + msg272595
2016-08-13 16:52:26Decoratersetmessages: + msg272594
2016-08-13 16:43:16xiang.zhangsetnosy: + xiang.zhang
messages: + msg272593
2016-08-13 15:41:42SilentGhostsettype: behavior

messages: + msg272591
nosy: + SilentGhost
2016-08-13 15:17:50Decoratercreate