kujira70 / pythonxy

Automatically exported from code.google.com/p/pythonxy
0 stars 0 forks source link

Python (x,y) fails to start when the HOME path contains non-ASCII characters #146

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
If relevant, please answer to the following questions:
1. What version of Python(x,y) have you installed?
2.6.2
2. Which components have you installed (Python(x,y) installer: component
page):
    a. Have you selected the "Recommended" component selection?
Yes
3. Have you selected the option "Customize installation directories"?
b. No
5. Where did you install Python(x,y) itself?
a. default path
6. Have you installed Python(x,y):
    a. For "Current user only"
7. What is your operating system?
a. Windows XP
8. When you installed Python(x,y), were you logged in as :
b. an administrator of the machine
10. Regarding installed softwares on your machine, how did you clean your
machine before installing Python(x,y) (multiple answers are possible):
b. you uninstalled any previous Python distribution (including the
official .msi)

What steps will reproduce the problem?
1. Tried to launch the main icon
2. Nothing happens
3. Launched xyhome from console

What is the expected output? What do you see instead?
Traceback (most recent call last):
  File "xyhome.pyw", line 21, in <module>
    from urllib import urlopen
  File "C:\Python26\lib\site-packages\xy\xyhome.pyw", line 629, in main
    form=MainWindow(options)
  File "C:\Python26\lib\site-packages\xy\xyhome.pyw", line 125, in __init__
    self.scanstartup()
  File "C:\Python26\lib\site-packages\xy\xyhome.pyw", line 518, in 
scanstartup
    default_startup()
  File "C:\Python26\lib\site-packages\xy\config.py", line 85, in 
default_startup
    filename=osp.join(STARTUP_PATH, CONF.get(None, 'startup'))
  File "C:\Python26\lib\ntpath.py", line 108, in join
    path += "\\" + b
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc0 in position 26: 
ordinal not in range(128)

Please provide any additional information below.
This is because my user name contains non-ASCII characters, which leads to 
having them in the HOME variable. The bug is similar to #91, but it is not 
the IPython fault. The userconfig.get_home_dir returns unicode string, 
while ntpath tries to treat it like the str object (or something like 
that).
And I don't want to change my HOME environment variable as it may affect 
many other programs.
Some workaround would be to have the XY_SETTINGS env variable that will be 
checked prior to the HOME. This will allow users setting it to something 
like "C:\Document and Settings\XY" and have Python (x, y) working.

Original issue reported on code.google.com by emiro...@gmail.com on 27 Jan 2010 at 10:43

GoogleCodeExporter commented 9 years ago
Have the same bug on Python(x, y) 2.6.5. 

Original comment by menchau...@gmail.com on 30 Apr 2010 at 11:35

GoogleCodeExporter commented 9 years ago
I implemented patch for xy/userconfig.py (see attached file). It's in Mercurial 
patch
format.

Original comment by menchau...@gmail.com on 30 Apr 2010 at 1:23

Attachments:

GoogleCodeExporter commented 9 years ago
I had the same problem on Python(x, y) 2.6.6.1 , the provided patch worked well 
but 2 other "UnicodeDecodeError: 'ascii' codec can't decode byte" came out, I 
had to modify :
- C:\Python26\Lib\site-packages\spyderlib\widgets\projectexplorer.py line 127
self.root_path = unicode(root_path)
TO 
self.root_path = root_path.decode(sys.getfilesystemencoding())

- C:\Python26\Lib\site-packages\spyderlib\spyder.py line 1519
            u"" % (get_conf_path(), issues_link, group_link, issues_link))
TO
            u"" % (get_conf_path().decode(sys.getfilesystemencoding()), issues_link, group_link, issues_link))

Original comment by frall...@gmail.com on 17 Jun 2011 at 7:32

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
I succeeded in opening spyder at hte first time but now if I re open it , 
another "UnicodeDecodeError: 'ascii' codec can't decode byte" error :
- C:\Python26\Lib\site-packages\rope\base\project.py line 177
                execfile(config.real_path, run_globals)
TO
                execfile(config.real_path.decode(sys.getfilesystemencoding()), run_globals)

I launch C:\Python26\python.exe C:\Python26\Scripts\xyhome.pyw and see all 
"Plugin ... found" lines but then it prints indefinetily :
"""

Original exception was:
Error in sys.excepthook:

Original exception was:
Error in sys.excepthook:

...
"""

I can't see what is the error message before that, the cmd.exe buffer is full, 
I can't go backward enough further...

To get it working again, I had to remove this directory as indicated in the 
spyder bug crashing panel :
C:\Documents and Settings\Propriétaire\Mes documents\.spyder2 
C:\Documents and Settings\Owner\My Documents\.spyder2 

Original comment by frall...@gmail.com on 17 Jun 2011 at 7:59

GoogleCodeExporter commented 9 years ago
Hi, i'm having the same problem with spyder, whenever i want to work with syper 
again i need to delete folder where spyder.ini is located... 

Does anyone solve this yet?

Original comment by nunoport...@gmail.com on 29 Nov 2011 at 5:07

GoogleCodeExporter commented 9 years ago
Issue 210 has been merged into this issue.

Original comment by pierre.raybaut on 18 Dec 2011 at 9:47

GoogleCodeExporter commented 9 years ago
I am also getting Unicode decode error while installing pytimechart on my 
Windows7 64-bit m/c. Please do Needful.

>ctype = ctype.encode(default_encoding) # omit in 3.x!
UnicodeDecodeError: 'ascii' codec can't decode byte 0xf0 in position 4: ordinal 
not in range(128)

Original comment by vanajaur...@gmail.com on 28 Jul 2014 at 7:32