Skip to content

IDLE: startup problem when HOME does not exist #60066

Closed as duplicate
Closed as duplicate

Description

@CemalDuman
mannequin
BPO 15862
Nosy @terryjreedy, @serwy, @mlouielu

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 2012-09-04.21:43:34.286>
labels = ['expert-IDLE', 'type-bug', '3.7']
title = 'IDLE: startup problem when HOME does not exist'
updated_at = <Date 2017-07-10.05:56:07.434>
user = 'https://bugs.python.org/CemalDuman'

bugs.python.org fields:

activity = <Date 2017-07-10.05:56:07.434>
actor = 'louielu'
assignee = 'terry.reedy'
closed = False
closed_date = None
closer = None
components = ['IDLE']
creation = <Date 2012-09-04.21:43:34.286>
creator = 'Cemal.Duman'
dependencies = []
files = []
hgrepos = []
issue_num = 15862
keywords = []
message_count = 9.0
messages = ['169840', '169843', '171503', '171631', '171675', '228519', '228528', '297256', '298025']
nosy_count = 4.0
nosy_names = ['terry.reedy', 'roger.serwy', 'Cemal.Duman', 'louielu']
pr_nums = []
priority = 'normal'
resolution = None
stage = 'test needed'
status = 'open'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue15862'
versions = ['Python 3.6', 'Python 3.7']

Activity

  1. CemalDuman commented on Sep 4, 2012

    CemalDumanmannequin
    MannequinAuthor

    Hi
    Unfortunately i'm using Vista on my corparate laptop I can open my Python CLI without any problem but IDLE is not responding. When i started idle.py by issuing following command:

    C:\Python27>python.exe Lib\idlelib\idle.py

    I see following output:

    C:\Python27>
    Warning: os.path.expanduser("~") points to
    H:\,
    but the path does not exist.

    H:\ is my network drive. When i run the os.path.expanduser("~") at CLI i get following directory.

    'C:\\Users\\edumcem\'

    Thanks / Cemal

  2. serwy commented on Sep 4, 2012

    serwymannequin
    Mannequin

    IDLE not responding is likely due to bpo-13582, since the warning message would cause IDLE to terminate abruptly when launched with pythonw.exe.

    What does os.path.expanduser("~") evaluate to when executed from the IDLE shell?

  3. serwy commented on Sep 28, 2012

    serwymannequin
    Mannequin

    With Python 2.7.3 on Win7, I tried the following:

    C:\Python27>set HOME=H:\
    C:\Python27>python -m idlelib.idle

    I do receive the same warning messages described by Cemal, since I don't have a valid H:\ drive. However, IDLE is responsive. Running IDLE using Lib\idlelib\idle.bat fails, though.

    Also, launching IDLE from the start menu still works.

    Cemal, can you confirm this?

  4. added
    type-bugAn unexpected behavior, bug, or error
    on Sep 28, 2012
  5. CemalDuman commented on Sep 30, 2012

    CemalDumanmannequin
    MannequinAuthor

    Hi,

    yes exactly...

    I changed my home by using below commands.
    C:\Python27>set HOME=C:\
    C:\Python27>python -m idlelib.idle

    it is working. But if i reboot my computer HOME changes again to network drive. I think sth abour corporate programs rewrites this paramters.

    Thanks / Cemal

  6. serwy commented on Sep 30, 2012

    serwymannequin
    Mannequin

    In your original message, did IDLE eventually start when you ran:

    C:\Python27>python.exe Lib\idlelib\idle.py

    ? If yes, then the bug is likely due to bpo-13582.

    If I understand correctly, when you reboot your computer, IDLE won't launch from the shortcut in the start menu?

  7. BreamoreBoy commented on Oct 5, 2014

    BreamoreBoymannequin
    Mannequin

    @terry what is your take on this?

  8. terryjreedy commented on Oct 5, 2014

    @terryjreedy
    Member

    This is one of multiple reports about problems with finding and reading HOME/.idlerc/*.*. I believe that if nothing else, Idle should issue a warning message (that not not crash Idle), set a flag, and continue. The configuration dialog should also warn that changes will not be saved.

    This particular situation is about a Windows system with HOME set but pointing to a directory on a drive that is not currently mounted. The user could create a .bat file that resets HOME, but Idle could also try harder to find a usable directory (so that the installed version specific icons work). Currently USERPROFILE is used (in os.expanduser) as a backup if HOME does not exist. It could also be used as a backup is HOME exists buts is not usable. Dittle for HOMEDRIVE and HOMEPATH used to backup USERPROFILE. Or Idle could change 'x:somepath', where x is not 'c', to 'c:somepath'.

    Or maybe Idle should recognize an IDLE_RC env var so a user like Cemal can run idle with the same set of user config files regardless of whether connected to a corporate network or not. This would also help someone (like me) who wants to use the same config files regardless of whether logged in and running as admin or normal user.

  9. changed the title [-]IDLE not working when due to wrong Hard Drive point of os.path.expanduser[/-] [+]IDLE: startup problem when HOME does not exist[/+] on Oct 5, 2014
  10. terryjreedy commented on Jun 29, 2017

    @terryjreedy
    Member

    bpo-8231, msg297255 suggests some refactoring to make this sort of thing testable without crippling a developer system.

  11. self-assigned this
    on Jun 29, 2017
  12. mlouielu commented on Jul 10, 2017

    mlouielumannequin
    Mannequin

    Terry: How about to support XDG base directory on Unix1?

  13. transferred this issue fromon Apr 10, 2022
  14. serhiy-storchaka commented on Sep 16, 2026

    @serhiy-storchaka
    Member

    Since 3.8, os.path.expanduser() on Windows ignores HOME and uses USERPROFILE, so a HOME pointing to an unmounted drive no longer affects IDLE. If the user profile directory itself is unavailable, #157636 makes IDLE start with default settings and show a warning instead of exiting. An IDLE_RC environment variable or XDG support would be a new feature and needs a separate issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

topic-IDLEtype-bugAn unexpected behavior, bug, or error

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions