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

bug fix: there is no way to save or load a file that has a python 2 string name #32

Merged
merged 1 commit into from
Jun 6, 2016

Conversation

chfw
Copy link
Contributor

@chfw chfw commented May 18, 2016

I am not sure the reason why those assertions are there in the first place. Given Python heavily uses duct typing, I would say please do it in C++.

And it prevent you from doing the following basic things using python 2. Yes, it is a bug because odfpy v0.9.6 allows you do the following.

>>> from odf.opendocument import load
>>> load("abc.ods")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "odf/opendocument.py", line 960, in load
    or 'BufferedReader' in repr(odffile)  or 'BytesIO' in repr(odffile))
AssertionError
>>> from odf.opendocument import OpenDocumentSpreadsheet
>>> book=OpenDocumentSpreadsheet()
>>> book.write("abc.ods")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "odf/opendocument.py", line 589, in write
    assert('wb' in repr(outputfp) or 'BufferedWriter' in repr(outputfp)  or 'BytesIO' in repr(outputfp))
AssertionError
>>> 

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

Successfully merging this pull request may close these issues.

2 participants