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

loading ods with Chinese characters fails with Python 2.7 #19

Closed
ghost opened this issue Jul 25, 2015 · 6 comments
Closed

loading ods with Chinese characters fails with Python 2.7 #19

ghost opened this issue Jul 25, 2015 · 6 comments

Comments

@ghost
Copy link

ghost commented Jul 25, 2015

it works however with Python 3.4

see the two attachments test01.py and test1.ods at this Debian bug report:

https://bugs.debian.org/783789

it used to work before the Python 3 changes

@ghost
Copy link
Author

ghost commented Jul 25, 2015

This helps, but maybe it is not the correct fix:

--- a/odf/attrconverters.py
+++ b/odf/attrconverters.py
@@ -103,7 +103,7 @@
 def __save_prefix(attribute, arg, element):
     prefix = arg.split(':',1)[0]
     if prefix == arg:
-        return str(arg)
+        return arg
     namespace = element.get_knownns(prefix)
     if namespace is None:
         #raise ValueError( "'%s' is an unknown prefix" % str(prefix))

@fisxoj
Copy link

fisxoj commented Feb 2, 2016

I'm encountering this as well. Was there a reason to cast the return value to a string instead of unicode? (3f9eeff#diff-752a348151632fef555f0894ed7fffeeL104)

@markplindsay
Copy link

@fisxoj it looks like this WAS fixed in d6d37d0, but it hasn't made it into PyPI yet.

PyPI has 1.3.1 (2015-07-18) and the fix was committed 2015-08-01.

@fisxoj
Copy link

fisxoj commented Feb 3, 2016

@sorenroug It looks like you were our savior last time around. Do you think a new release to PyPi might be possible?

@sorenroug
Copy link
Member

Yes, the fix was committed in August, but it didn't work on both Python 2 and 3. I've done some investigation and closed the issue. There is a new release on PyPi.

@fisxoj
Copy link

fisxoj commented Feb 4, 2016

Thanks, @sorenroug!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants