This looks like a bug caused by the attempt to remove "wubi.exe" from the startup folder. This logic was introduced in 11.04 I believe, which inserts wubi.exe in the startup folder if a user tries to do a normal dual boot but all four primary partitions are used.
The problem is that the startup folder is not set. It looks like ntpath.py should handle this, but it probably isn't. The workaround is likely to set the startup environment variable by editing the registry (regedit) and setting: 'HKEY_LOCAL_MACHINE', 'SOFTWARE\Microsoft\Windows\CurrentVersion' '\Explorer\Shell Folders', 'Common Startup'
def join(a, *p):
"""Join two or more pathname components, inserting "\\" as needed"""
path = a
for b in p:
b_wins = 0 # set to 1 iff b makes path irrelevant
if path == "":
b_wins = 1
elif isabs(b):
# This probably wipes out path so far. However, it's more
# complicated if path begins with a drive letter:
# 1. join('c:', '/a') == 'c:/a'
# 2. join('c:/', '/a') == 'c:/a'
# But
# 3. join('c:/a', '/b') == '/b'
# 4. join('c:', 'd:/') = 'd:/'
# 5. join('c:/', 'd:/') = 'd:/'
if path[1:2] != ":" or b[1:2] == ":":
# Path doesn't start with a drive letter, or cases 4 and 5. b_wins = 1
# Else path has a drive letter, and b doesn't but is absolute.
elif len(path) > 3 or (len(path) == 3 and path[-1] not in "/\\"):
# case 3 b_wins = 1
if b_wins:
path = b
else:
# Join, and ensure there's a separator.
assert len(path) > 0
if path[-1] in "/\\": <== line 90, should never get here
This looks like a bug caused by the attempt to remove "wubi.exe" from the startup folder. This logic was introduced in 11.04 I believe, which inserts wubi.exe in the startup folder if a user tries to do a normal dual boot but all four primary partitions are used.
The problem is that the startup folder is not set. It looks like ntpath.py should handle this, but it probably isn't. The workaround is likely to set the startup environment variable by editing the registry (regedit) and setting:
'HKEY_ LOCAL_MACHINE' , 'SOFTWARE\ Microsoft\ Windows\ CurrentVersion'
'\Explorer\ Shell Folders',
'Common Startup'
Relevant code: backends\ win32\backend. py
\lib\wubi\
def remove_ existing_ binary( self): join(self. get_startup_ folder( ), 'wubi.exe') exists( binary) :
MOVEFILE_ DELAY_UNTIL_ REBOOT = 4
ctypes. windll. kernel32. MoveFileExW( binary, None,
MOVEFILE_ DELAY_UNTIL_ REBOOT)
log.exception ("Couldn' t remove Wubi from startup:")
binary = os.path.
if os.path.
try:
except (OSError, IOError):
============
\lib\wubi\ backends\ win32\backend. py
def join(a, *p):
"""Join two or more pathname components, inserting "\\" as needed"""
path = a
for b in p:
b_wins = 0 # set to 1 iff b makes path irrelevant
if path == "":
b_wins = 1
elif isabs(b):
b_wins = 1
# This probably wipes out path so far. However, it's more
# complicated if path begins with a drive letter:
# 1. join('c:', '/a') == 'c:/a'
# 2. join('c:/', '/a') == 'c:/a'
# But
# 3. join('c:/a', '/b') == '/b'
# 4. join('c:', 'd:/') = 'd:/'
# 5. join('c:/', 'd:/') = 'd:/'
if path[1:2] != ":" or b[1:2] == ":":
# Path doesn't start with a drive letter, or cases 4 and 5.
# Else path has a drive letter, and b doesn't but is absolute.
path[-1] not in "/\\"):
b_wins = 1
elif len(path) > 3 or (len(path) == 3 and
# case 3
if b_wins:
path = b
else:
# Join, and ensure there's a separator.
assert len(path) > 0
if path[-1] in "/\\": <== line 90, should never get here