DevinShackle / google-sites-mirror

Automatically exported from code.google.com/p/google-sites-mirror
0 stars 0 forks source link

Cannot download files with accented characters #1

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Download a page with an attachment that includes an accented character
in the name (e.g.: "á.txt")

What is the expected output? What do you see instead?
- Expected output: full site stored in the output folder
- Actual output: 

Traceback (most recent call last):
  File "C:\Python26\Scripts\gsmirror-script.py", line 8, in <module>
    load_entry_point('gsmirror==1.0.2', 'console_scripts', 'gsmirror')()
  File "build\bdist.win32\egg\gsmirroring\gsmirror.py", line 137, in main
  File "build\bdist.win32\egg\gsmirroring\site_controller.py", line 273, in
save
_site_to_disk
  File "build\bdist.win32\egg\gsmirroring\site_controller.py", line 333, in
save
_page_to_disk
  File "build\bdist.win32\egg\gsmirroring\site_controller.py", line 330, in
save
_page_to_disk
  File "build\bdist.win32\egg\gsmirroring\site_controller.py", line 342, in
save
_attachment_to_file
  File "build\bdist.win32\egg\gsmirroring\xml_module.py", line 124, in
add_eleme
nt
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe1' in
position 55:
 ordinal not in range(128)

What version of the product are you using? On what operating system?
- gsmirror-1.0.2.zip
- Windows XP

Please provide any additional information below.
- Try to encode the file name to UTF-8 in xml_module.py:124

Original issue reported on code.google.com by mszkla...@gmail.com on 27 May 2010 at 8:28

GoogleCodeExporter commented 9 years ago
Replacing xml_module.py:124 with the following line seems to work:

element.setAttribute('source', unicode(source))

Original comment by mszkla...@gmail.com on 27 May 2010 at 9:30

GoogleCodeExporter commented 9 years ago
Proposed solution also worked for me.

Please update source code, it's an important issue for non-english speakers.

Original comment by carlos.p...@gmail.com on 3 Jun 2011 at 9:30