trentm / go-tool

Automatically exported from code.google.com/p/go-tool
Other
10 stars 8 forks source link

Can't handle non-ascii folder names #11

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. create a directory named vidéos
2. cd vidéos
3. go -a vids

What is the expected output? What do you see instead?

Should add a shortcut but instead I get the following exception traceback:

Traceback (most recent call last):
  File "/usr/lib/python2.6/runpy.py", line 122, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib/python2.6/runpy.py", line 34, in _run_code
    exec code in run_globals
  File "/usr/local/lib/python2.6/dist-packages/go.py", line 765, in <module>
    retval = main(sys.argv)
  File "/usr/local/lib/python2.6/dist-packages/go.py", line 649, in main
    setShortcut(name, value)
  File "/usr/local/lib/python2.6/dist-packages/go.py", line 195, in setShortcut
    fout.write(dom.toxml())
  File "/usr/lib/python2.6/xml/dom/minidom.py", line 45, in toxml
    return self.toprettyxml("", "", encoding)
  File "/usr/lib/python2.6/xml/dom/minidom.py", line 60, in toprettyxml
    return writer.getvalue()
  File "/usr/lib/python2.6/StringIO.py", line 270, in getvalue
    self.buf += ''.join(self.buflist)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 18:
ordinal not in range(128)

What version of the product are you using? On what operating system?

1.2.1 on Ubuntu 9.10 and Python 2.6.4

Original issue reported on code.google.com by andrewtr...@gmail.com on 29 Apr 2010 at 8:44

GoogleCodeExporter commented 9 years ago
Oh and when you try to add a folder with non-ascii characters, it also clears 
the
users shortcuts.xml file which deletes all the other shortcuts and makes go
subsequently throw exceptions on every invocation because it can't parse the
shortcuts xml.

Original comment by andrewtr...@gmail.com on 29 Apr 2010 at 8:47