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

IDLE: Consistently handle non .py source files #90902

Open
terryjreedy opened this issue Feb 14, 2022 · 1 comment
Open

IDLE: Consistently handle non .py source files #90902

terryjreedy opened this issue Feb 14, 2022 · 1 comment
Assignees
Labels
3.11 only security fixes topic-IDLE type-feature A feature request or enhancement

Comments

@terryjreedy
Copy link
Member

BPO 46746
Nosy @terryjreedy

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 = 'https://github.com/terryjreedy'
closed_at = None
created_at = <Date 2022-02-14.03:33:18.063>
labels = ['expert-IDLE', 'type-feature', '3.11']
title = 'IDLE: Consistently handle non .py source files'
updated_at = <Date 2022-02-14.03:33:18.063>
user = 'https://github.com/terryjreedy'

bugs.python.org fields:

activity = <Date 2022-02-14.03:33:18.063>
actor = 'terry.reedy'
assignee = 'terry.reedy'
closed = False
closed_date = None
closer = None
components = ['IDLE']
creation = <Date 2022-02-14.03:33:18.063>
creator = 'terry.reedy'
dependencies = []
files = []
hgrepos = []
issue_num = 46746
keywords = []
message_count = 1.0
messages = ['413210']
nosy_count = 1.0
nosy_names = ['terry.reedy']
pr_nums = []
priority = 'normal'
resolution = None
stage = 'test needed'
status = 'open'
superseder = None
type = 'enhancement'
url = 'https://bugs.python.org/issue46746'
versions = ['Python 3.11']

@terryjreedy
Copy link
Member Author

Python will attempt to execute any file it can decode to unicode text as a startup script. It will only import .py files as a module. bpo-45447 turned on syntax coloring for .pyi stub files. (.pyw files and files starting with "!#.*python" were already recognized as source (scripts).) It also added '.pyi' as a possible python extension in open and save dialogs.

For this issue, fix some other modules, as appropriate, for non-.py files.

Pathbrowser: Except for the files in sys.path, pathbrowser only shows .py files and directories including such. It should be easy to also list .pyw and .pyi files and directories. Perhaps a button could be added to list all files.

Open Module: Opens a module when given a valid import name. So it cannot be used to open non-modules, which is to say, non .py files. .pyi files are condensed modules, not startup files, but opening them would require considerable change since the import machinery is currently used. We could add a message to the box saying, "To open a non-module (non .py) file, use File => Open."

Modulebrowser: This was originally called Classbrowser as it only browsed top-level classes and their methods. It now browses all classes and def-ined functions and I renamed it to indicate the expanded scope. Since it only browses .py files, I did not know that I was theoretically narrowing the scope to exclude non-.py files.

Currently, when editing a non-.py file and trying to open a module browser, a window is opened and nothing happens. This is the same as with a file with no classes or functions. Either browse or display an error message. The latter would include files with nothing to browse.

Anything else?

@terryjreedy terryjreedy added the 3.11 only security fixes label Feb 14, 2022
@terryjreedy terryjreedy self-assigned this Feb 14, 2022
@terryjreedy terryjreedy added topic-IDLE type-feature A feature request or enhancement 3.11 only security fixes labels Feb 14, 2022
@terryjreedy terryjreedy self-assigned this Feb 14, 2022
@terryjreedy terryjreedy added topic-IDLE type-feature A feature request or enhancement labels Feb 14, 2022
@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
3.11 only security fixes topic-IDLE type-feature A feature request or enhancement
Projects
Status: No status
Development

No branches or pull requests

1 participant