Issue 27753: py_compile.compile() does not specify if it can accept a file like object or a bytes like object with the file's data. (original ) (raw )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) *
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) *
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) *
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) *
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)
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) *
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:34
admin
set
github: 71940
2016-08-13 18:49:33
r.david.murray
set
status: open -> closednosy: + r.david.murray messages: + resolution: fixedstage: resolved
2016-08-13 18:48:42
python-dev
set
nosy: + python-dev messages: +
2016-08-13 17:51:13
SilentGhost
set
messages: +
2016-08-13 17:47:52
Decorater
set
messages: +
2016-08-13 17:47:26
Decorater
set
files: + py_compile.rst
2016-08-13 17:01:35
SilentGhost
set
messages: +
2016-08-13 16:52:26
Decorater
set
messages: +
2016-08-13 16:43:16
xiang.zhang
set
nosy: + xiang.zhang messages: +
2016-08-13 15:41:42
SilentGhost
set
type: behaviormessages: + nosy: + SilentGhost
2016-08-13 15:17:50
Decorater
create