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 won't start in custom directory. #48131

Closed
kimsey0 mannequin opened this issue Sep 16, 2008 · 28 comments
Closed

IDLE won't start in custom directory. #48131

kimsey0 mannequin opened this issue Sep 16, 2008 · 28 comments
Labels
OS-windows stdlib Python modules in the Lib dir topic-IDLE type-crash A hard crash of the interpreter, possibly with a core dump

Comments

@kimsey0
Copy link
Mannequin

kimsey0 mannequin commented Sep 16, 2008

BPO 3881
Nosy @loewis, @devdanzin, @kimsey0
Files
  • symlink.diff
  • 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 2009-01-24.16:27:07.586>
    created_at = <Date 2008-09-16.13:47:38.042>
    labels = ['expert-IDLE', 'library', 'OS-windows', 'type-crash']
    title = "IDLE won't start in custom directory."
    updated_at = <Date 2009-11-16.08:59:08.434>
    user = 'https://github.com/kimsey0'

    bugs.python.org fields:

    activity = <Date 2009-11-16.08:59:08.434>
    actor = 'ggenellina'
    assignee = 'none'
    closed = True
    closed_date = <Date 2009-01-24.16:27:07.586>
    closer = 'loewis'
    components = ['IDLE', 'Library (Lib)', 'Windows']
    creation = <Date 2008-09-16.13:47:38.042>
    creator = 'kimsey0'
    dependencies = []
    files = ['12832']
    hgrepos = []
    issue_num = 3881
    keywords = ['patch']
    message_count = 28.0
    messages = ['73301', '73315', '73316', '80027', '80032', '80033', '80034', '80035', '80036', '80038', '80039', '80041', '80043', '80082', '80102', '80110', '80114', '80129', '80131', '80146', '80189', '80259', '80278', '80369', '80376', '80420', '80459', '95331']
    nosy_count = 6.0
    nosy_names = ['loewis', 'ggenellina', 'ajaksu2', 'kimsey0', 'zlm', 'srid']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = None
    status = 'closed'
    superseder = None
    type = 'crash'
    url = 'https://bugs.python.org/issue3881'
    versions = ['Python 2.6', 'Python 3.0', 'Python 3.1', 'Python 2.7']

    @kimsey0
    Copy link
    Mannequin Author

    kimsey0 mannequin commented Sep 16, 2008

    Hello.

    I run Python 2.5.2 (r252:60911, Feb 21 2008, 13:11:45) on Windows Vista
    Home Premium.
    IDLE won't start if not installed in the default directory.
    When insalled in a custom directory, running idle.py
    (\Lib\idlelib\idle.py) produces this error:

    "Traceback (most recent call last):
    File "C:\Programmer\Python\lib\idlelib\idle.py", line 21, in <module>
    idlelib.PyShell.main()
    File "C:\Programmer\Python\lib\idlelib\PyShell.py", line 1390, in main
    root= Tk(className="Idle")
    File "C:\Programmer\Python\lib\idlelib\Tkinter.py", line 1636, in
    __init__ self.tk = _tkinter.create(screenName, baseName, className,
    interactive, wantobjects, useTk, sync, use)
    _tkinter.TclError: Can't find a usable init.tcl in the following
    directories: {C:\Programmer\Python\tcl\tcl8.4}
    {C:\Programmer\Python\tcl\tcl8.4} C:/Programmer/Python/tcl/tcl8.4
    C:/Programmer/Python/lib/tcl8.4 C:/Programmer/Python/lib/tcl8.4
    C:/lib/tcl8.4 C:/library C:/tcl8.4/library

    This probable means that Tcl wasn't installed properly."

    @kimsey0 kimsey0 mannequin added topic-IDLE stdlib Python modules in the Lib dir OS-windows type-crash A hard crash of the interpreter, possibly with a core dump labels Sep 16, 2008
    @loewis
    Copy link
    Mannequin

    loewis mannequin commented Sep 16, 2008

    Do you have TCL_DIR or TK_DIR environment variables set?

    @kimsey0
    Copy link
    Mannequin Author

    kimsey0 mannequin commented Sep 16, 2008

    No, nothing.
    It's just a standart clean installation.

    @zlm
    Copy link
    Mannequin

    zlm mannequin commented Jan 17, 2009

    Hi. I have the same problem, but i'm running Pyhton 2.6.1. I'm using
    Windows Vista 32bit SP1.

    I installed Python to C:\Program Files\Python\2.6\ and when I try to run
    idle from the start menu, it doesn't work.

    When I try to run it from the command line, the same error is displayed:

    "C:\Program Files\Python\2.6\Lib\idlelib>python idle.py
    Traceback (most recent call last):
      File "idle.py", line 21, in <module>
        idlelib.PyShell.main()
      File "C:\Programas\Python\2.6\lib\idlelib\PyShell.py", line 1386, in main
        root = Tk(className="Idle")
      File "C:\Programas\Python\2.6\lib\lib-tk\Tkinter.py", line 1643, in
    __init__
        self.tk = _tkinter.create(screenName, baseName, className,
    interactive, want
    objects, useTk, sync, use)
    _tkinter.TclError: Can't find a usable init.tcl in the following
    directories:
        {C:\Programas\Python\2.6\tcl\tcl8.5}
    C:/Programas/Python/2.6/lib/tcl8.5 C:/P
    rogramas/Python/lib/tcl8.5 C:/Programas/lib/tcl8.5
    C:/Programas/Python/library C
    :/Programas/library C:/Programas/tcl8.5.2/library C:/tcl8.5.2/library

    This probably means that Tcl wasn't installed properly."

    @loewis
    Copy link
    Mannequin

    loewis mannequin commented Jan 17, 2009

    zlm, did you chose to install Tcl/Tk when installing Python?

    @zlm
    Copy link
    Mannequin

    zlm mannequin commented Jan 17, 2009

    Yes, I did.

    @loewis
    Copy link
    Mannequin

    loewis mannequin commented Jan 17, 2009

    Yes, I did.

    So do you have a file C:\Programas\Python\2.6\tcl\tcl8.5\init.tcl ?

    @zlm
    Copy link
    Mannequin

    zlm mannequin commented Jan 17, 2009

    So do you have a file C:\Programas\Python\2.6\tcl\tcl8.5\init.tcl ?

    Yes, I have.

    Could this problem be related to paths with slashes and backslashes? In
    the error log, the first path (the right one) has backslashes, but the
    others have slashes.

    " {C:\Programas\Python\2.6\tcl\tcl8.5}
    C:/Programas/Python/2.6/lib/tcl8.5 C:/P
    rogramas/Python/lib/tcl8.5 C:/Programas/lib/tcl8.5
    C:/Programas/Python/library C
    :/Programas/library C:/Programas/tcl8.5.2/library C:/tcl8.5.2/library"

    @loewis
    Copy link
    Mannequin

    loewis mannequin commented Jan 17, 2009

    Could this problem be related to paths with slashes and backslashes?

    Unlikely. The exact same package works on many other machines, so there
    must be something strange with your machine.

    Can you run the Sysinternals filemon to find out what files it is accessing?

    @kimsey0
    Copy link
    Mannequin Author

    kimsey0 mannequin commented Jan 17, 2009

    I don't think it's just his machine (and mine), but i don't think so.
    Unfortunealy, i don't have a Windows Vista key ready, else i'd have
    testet it on a clean install, but i'll try to install the same package
    on the next computer with Vista i stumple upon.

    @zlm
    Copy link
    Mannequin

    zlm mannequin commented Jan 17, 2009

    Can you run the Sysinternals filemon to find out what files it is
    accessing?

    I tried Sysinternals ProcessMonitor (equivalent of filemon to Windows
    Vista), but the simple act of trying to open IDLE produces thousands of
    entries to the log window.

    I also don't think this is a problem of my machine, because i'm not the
    only one with this problem. I think this situation can be easily
    reproduced by installing Pyhton to other than the default path on
    Windows Vista.

    @loewis
    Copy link
    Mannequin

    loewis mannequin commented Jan 17, 2009

    I think this situation can be easily
    reproduced by installing Pyhton to other than the default path on
    Windows Vista.

    I could not reproduce it that way. I just installed Python 2.6.1 into
    c:\tmp\python26, on Vista SP1 x64 (although I installed the 32-bit
    version of Python), and IDLE works just fine.

    @kimsey0
    Copy link
    Mannequin Author

    kimsey0 mannequin commented Jan 17, 2009

    Okay, i'll try to find a key for Vista in all my drawers, and install a
    clean version, try it, and then i'll tell you the result.
    I just can't see what could produce the error at our computers.

    @ggenellina
    Copy link
    Mannequin

    ggenellina mannequin commented Jan 18, 2009

    I installed Python to C:\Program Files\Python\2.6\ and when I try to
    run idle from the start menu, it doesn't work.

    > "C:\Program Files\Python\2.6\Lib\idlelib>python idle.py
    > Traceback (most recent call last):
    >   File "idle.py", line 21, in <module>
    >     idlelib.PyShell.main()
    >   File "C:\Programas\Python\2.6\lib\idlelib\PyShell.py", line 1386, 

    Note the TWO different paths: C:\Program Files\Python\2.6\ and C:
    \Programas\Python\2.6

    Do you have a PYTHONPATH environment variable?
    Did you install twice, once per directory? Perhaps one of them without
    tcl support?

    @kimsey0
    Copy link
    Mannequin Author

    kimsey0 mannequin commented Jan 18, 2009

    I don't think thats the solution.
    "C:\Program Files\Python\2.6\" and
    "C:\Programas\Python\2.6\"
    are the same, as "C:\Program Files\Python\2.6\" is a symbolic link to
    "C:\Programas\Python\2.6\" to allow compatibility with different
    operation system languages.

    @loewis
    Copy link
    Mannequin

    loewis mannequin commented Jan 18, 2009

    I don't think thats the solution.
    "C:\Program Files\Python\2.6\" and
    "C:\Programas\Python\2.6\"
    are the same, as "C:\Program Files\Python\2.6\" is a symbolic link to
    "C:\Programas\Python\2.6\" to allow compatibility with different
    operation system languages.

    It could be a hint to the problem, though.

    Jacob: what language version is your Vista installation? Is
    "c:\Programmer" the local translation of "c:\Program Files"?

    Perhaps something doesn't work right with symbolic links on Vista.
    Unfortunately, I have only the English version of Vista for testing.

    Can you two please install Python into a non-standard folder that
    isn't a symbolic link?

    @kimsey0
    Copy link
    Mannequin Author

    kimsey0 mannequin commented Jan 18, 2009

    Great idea :)
    Maybe we're starting to find the problem.
    I'm using a Danish version of Windows Vista Home Premium SP1, and
    C:\Programmer is the danish path for C:\Program Files.
    I'll try that, and leave another message when i'we tried it.

    @zlm
    Copy link
    Mannequin

    zlm mannequin commented Jan 18, 2009

    "Programas" is the portuguese translation to "Program Files".

    I have just installed it to C:\Test\Python and IDLE is working!

    The problem should be related to the Vista symbolic links.

    @loewis
    Copy link
    Mannequin

    loewis mannequin commented Jan 18, 2009

    The problem should be related to the Vista symbolic links.

    Unfortunately, it isn't as simple as "install into a symbolic
    link, and it fails". I created c:\temp -> c:\tmp, and installed
    into c:\temp (i.e. into the symlink), and it still worked fine.

    @devdanzin
    Copy link
    Mannequin

    devdanzin mannequin commented Jan 19, 2009

    Maybe it's "install into a symbolic link pointing to a path with spaces
    in it, and idle fails"?

    @zlm
    Copy link
    Mannequin

    zlm mannequin commented Jan 19, 2009

    I reinstalled Python to "C:\Program Files\Python\" (I wrote this path in
    the installer) and IDLE works fine. I can access the Python folder by
    going to "C:\Programas\Python".

    Then, I unninstalled and installed again to "C:\Programas\Python". IDLE
    doesn't work. I can still access the Python folder by going to
    "C:\Programas\Python".

    Jacob, can you try installing it to "C:\Program Files\Python" to sse if
    that works?

    @kimsey0
    Copy link
    Mannequin Author

    kimsey0 mannequin commented Jan 20, 2009

    Installing to C:\Program Files\Python\ worked.
    Now we just have to find out WHY it doesn't work with the
    C:\[Programmer/Programmas]\ to C:\Program Files\ link.

    @loewis
    Copy link
    Mannequin

    loewis mannequin commented Jan 20, 2009

    Installing to C:\Program Files\Python\ worked.
    Now we just have to find out WHY it doesn't work with the
    C:\[Programmer/Programmas]\ to C:\Program Files\ link.

    With process monitor, I made partial progress (after installing
    the German Vista version). It looks like that there is an explicit
    Deny ACL entry for read for Everyone in the Programme symlink.
    As a consequence, os.listdir(r"c:\programme") fails, even though
    os.listdir(r"c:\program files") succeeds. It looks like Tcl wants
    to list the contents of the symlink (I'm not yet sure why), and
    that this fails (ACCESS_DENIED).

    @loewis
    Copy link
    Mannequin

    loewis mannequin commented Jan 22, 2009

    Here is a patch that should fix the problem. It uses Vista's
    GetFinalPathNameByHandleW to expand symbolic links before passing the
    path to Tcl.

    @kimsey0
    Copy link
    Mannequin Author

    kimsey0 mannequin commented Jan 22, 2009

    Fantastic.
    I started this post in October, and now we finaly found a solution.
    Thank you Martin.
    Will this patch be included in future versions of python?
    Best regards, Jacob.

    @zlm
    Copy link
    Mannequin

    zlm mannequin commented Jan 23, 2009

    I got my problem fixed in 4 days!
    Thank you for all your help, Martin!

    @loewis
    Copy link
    Mannequin

    loewis mannequin commented Jan 24, 2009

    Committed as r68893, r68894, r68898, r68901.

    @loewis loewis mannequin closed this as completed Jan 24, 2009
    @ggenellina
    Copy link
    Mannequin

    ggenellina mannequin commented Nov 16, 2009

    This patch had unintended consequences; see bpo-6906

    @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
    OS-windows stdlib Python modules in the Lib dir topic-IDLE type-crash A hard crash of the interpreter, possibly with a core dump
    Projects
    None yet
    Development

    No branches or pull requests

    0 participants