Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

py_compile.compile() does not specify if it can accept a file like object or a bytes like object with the file's data. #71940

Closed
AraHaan mannequin opened this issue Aug 13, 2016 · 9 comments
Labels
docs Documentation in the Doc dir stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error

Comments

@AraHaan
Copy link
Mannequin

AraHaan mannequin commented Aug 13, 2016

BPO 27753
Nosy @bitdancer, @zhangyangyu, @AraHaan
Files
  • py_compile.rst: patched documentation file. (3.5)
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2016-08-13.18:49:33.198>
    created_at = <Date 2016-08-13.15:17:50.034>
    labels = ['type-bug', 'library', 'docs']
    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."
    updated_at = <Date 2016-08-13.18:49:33.188>
    user = 'https://github.com/AraHaan'

    bugs.python.org fields:

    activity = <Date 2016-08-13.18:49:33.188>
    actor = 'r.david.murray'
    assignee = 'docs@python'
    closed = True
    closed_date = <Date 2016-08-13.18:49:33.198>
    closer = 'r.david.murray'
    components = ['Documentation', 'Library (Lib)']
    creation = <Date 2016-08-13.15:17:50.034>
    creator = 'Decorater'
    dependencies = []
    files = ['44095']
    hgrepos = []
    issue_num = 27753
    keywords = []
    message_count = 9.0
    messages = ['272590', '272591', '272593', '272594', '272595', '272599', '272600', '272607', '272608']
    nosy_count = 6.0
    nosy_names = ['r.david.murray', 'SilentGhost', 'docs@python', 'python-dev', 'xiang.zhang', 'Decorater']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue27753'
    versions = ['Python 3.5', 'Python 3.6']

    @AraHaan
    Copy link
    Mannequin Author

    AraHaan mannequin commented Aug 13, 2016

    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

    @AraHaan AraHaan mannequin assigned docspython Aug 13, 2016
    @AraHaan AraHaan mannequin added docs Documentation in the Doc dir stdlib Python modules in the Lib dir labels Aug 13, 2016
    @SilentGhost
    Copy link
    Mannequin

    SilentGhost mannequin commented Aug 13, 2016

    It says "The source code is loaded from the file name *file*". That seems unambiguous enough to me.

    @SilentGhost SilentGhost mannequin added the type-bug An unexpected behavior, bug, or error label Aug 13, 2016
    @zhangyangyu
    Copy link
    Member

    Maybe in the sentence, name should be named?

    @AraHaan
    Copy link
    Mannequin Author

    AraHaan mannequin commented Aug 13, 2016

    yeah, true and to specify that it cannot be anything but a file.

    @SilentGhost
    Copy link
    Mannequin

    SilentGhost mannequin commented Aug 13, 2016

    Do you care to propose an improved wording?

    @AraHaan
    Copy link
    Mannequin Author

    AraHaan mannequin commented Aug 13, 2016

    Ok, file uploaded.

    @SilentGhost
    Copy link
    Mannequin

    SilentGhost mannequin commented Aug 13, 2016

    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.

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Aug 13, 2016

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

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

    New changeset dda25c37d02b by R David Murray in branch 'default':
    Merge: bpo-27753: fix typo (name->named).
    https://hg.python.org/cpython/rev/dda25c37d02b

    @bitdancer
    Copy link
    Member

    Agreed, the current wording is correct and complete, except for the name vs named bit. I've fixed that.

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    docs Documentation in the Doc dir stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants