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: catch user cfg file error and improve error message #72844

Closed
AndrewKontokanis mannequin opened this issue Nov 10, 2016 · 4 comments
Closed

IDLE: catch user cfg file error and improve error message #72844

AndrewKontokanis mannequin opened this issue Nov 10, 2016 · 4 comments
Assignees
Labels
3.7 (EOL) end of life topic-IDLE type-bug An unexpected behavior, bug, or error

Comments

@AndrewKontokanis
Copy link
Mannequin

AndrewKontokanis mannequin commented Nov 10, 2016

BPO 28658
Nosy @terryjreedy, @ned-deily
Superseder
  • bpo-21973: IDLE: catch user cfg file error, better error message, continue
  • Files
  • error.log.pdf
  • 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 = <Date 2016-11-11.20:56:12.819>
    created_at = <Date 2016-11-10.14:35:00.912>
    labels = ['expert-IDLE', 'type-bug', '3.7']
    title = 'IDLE: catch user cfg file error and improve error message'
    updated_at = <Date 2016-11-11.22:27:20.857>
    user = 'https://bugs.python.org/AndrewKontokanis'

    bugs.python.org fields:

    activity = <Date 2016-11-11.22:27:20.857>
    actor = 'Andrew Kontokanis'
    assignee = 'terry.reedy'
    closed = True
    closed_date = <Date 2016-11-11.20:56:12.819>
    closer = 'terry.reedy'
    components = ['IDLE']
    creation = <Date 2016-11-10.14:35:00.912>
    creator = 'Andrew Kontokanis'
    dependencies = []
    files = ['45426']
    hgrepos = []
    issue_num = 28658
    keywords = []
    message_count = 4.0
    messages = ['280509', '280603', '280611', '280619']
    nosy_count = 3.0
    nosy_names = ['terry.reedy', 'ned.deily', 'Andrew Kontokanis']
    pr_nums = []
    priority = 'normal'
    resolution = 'duplicate'
    stage = 'resolved'
    status = 'closed'
    superseder = '21973'
    type = 'behavior'
    url = 'https://bugs.python.org/issue28658'
    versions = ['Python 3.5', 'Python 3.6', 'Python 3.7']

    @AndrewKontokanis
    Copy link
    Mannequin Author

    AndrewKontokanis mannequin commented Nov 10, 2016

    When I try and launch IDLE, the icon appears on the dock for a second and then disappears and the application doesn't run.
    I was trying to install new themes but when I managed to do find .idlerc folder I had messed up with some idle folder. I tried to uninstall and install but it didn't work.
    Trying to find solution I read some hints to check through terminal and I took these messages in attachment. I didn't find the same solution with the previous problems so I opened an question

    @AndrewKontokanis AndrewKontokanis mannequin added the type-crash A hard crash of the interpreter, possibly with a core dump label Nov 10, 2016
    @terryjreedy
    Copy link
    Member

    The exception message says that your problem is a bad byte in one of the config files. The most likely culprit is the one you edited, which I presume is ~/.idlerc/config-highlight.cfg. "Invalid start byte' suggests that it tried to decode as utf-8, but you used a non-ascii char and saved with some other encoding. I suggest you stick with ascii only for theme names. The set of theme item names should match the all-ascii set used in idlelib/config-highlight.def.

    For future reference: a crash is a segfault or Mac equivalent, without a python traceback. Uploaded text files should be plain ascii or utf-8 text, uncompressed and not wrapped. "I have a problem. Help me" requests should normally go to python-list or other forums. The tracker is for bug reports and enhancement requests.

    In this case, I decided to make this a bug and enhancement issue and changed the title accordingly. The bug is that IDLE stopped instead of continuing without the user configuration, the same as it would if there were no file. I propose to catch the exception and replace the traceback with the file name and error (the enhancement). At least for user config files, IDLE should then continue (the bugfix). The revised message will be something like the following.

    "Unable to read .../.idlerc/config-highlight.cfg.
    UnicodeDecodeError: ...
    IDLE will continue without this user config file."

    @terryjreedy terryjreedy added the 3.7 (EOL) end of life label Nov 11, 2016
    @terryjreedy terryjreedy changed the title MacOsX idle don't run IDLE: catch user cfg file error and improve error message Nov 11, 2016
    @terryjreedy terryjreedy added type-bug An unexpected behavior, bug, or error and removed type-crash A hard crash of the interpreter, possibly with a core dump labels Nov 11, 2016
    @terryjreedy
    Copy link
    Member

    This is effectively a duplicate of bpo-21973. In both issues, an error in the file causes an exception that is not caught, but should be.

    @AndrewKontokanis
    Copy link
    Mannequin Author

    AndrewKontokanis mannequin commented Nov 11, 2016

    Thank you very much. The actual problem was that on copy paste it made an alias and not a real copy of the file that you mentioned. So It really helped me to solve the problem.

    @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.7 (EOL) end of life topic-IDLE type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants