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

Exports fail #863

Closed
jdunmire opened this issue Nov 20, 2016 · 0 comments · Fixed by #1010
Closed

Exports fail #863

jdunmire opened this issue Nov 20, 2016 · 0 comments · Fixed by #1010

Comments

@jdunmire
Copy link

This occurs using the HEAD of master on Ubuntu 16.04.
When any export is attempted the following error is reported:

Return exporter instance
emit ('error', 1, 'Error during Exporter', 'Traceback (most recent call last):\n File "/usr/local/lib/python2.7/dist-packages/gourmet/threadManager.py", line 98, in run\n self.do_run()\n File "/usr/local/lib/python2.7/dist-packages/gourmet/plugin_loader.py", line 395, in _\n retval = f(self,args,*kwargs)\n File "/usr/local/lib/python2.7/dist-packages/gourmet/exporters/exporter.py", line 583, in do_run\n self.write_footer()\n File "/usr/local/lib/python2.7/dist-packages/gourmet/plugins/import_export/gxml_plugin/gxml2_exporter.py", line 128, in write_footer\n encoding = "UTF-8")\n File "/usr/lib/python2.7/xml/dom/minidom.py", line 1747, in writexml\n writer.write('%s' % (encoding, newl))\nAttributeError: 'unicode' object has no attribute 'write'\n')
emit ('done',)

I've tracked this to the type(self.out)==str test on lines 554 and 555 of exporter.py. self.out at this point is a unicode type, not str. It looks like the type was changed at about hash bbccf35

It looks like the problem occurs in a few other places, so I don't have a pull-request ready, but I am working on it.

jdunmire pushed a commit to jdunmire/gourmet that referenced this issue Nov 20, 2016
Fixes thinkle#863
Test for both unecode and str so that code is backwards compatible (I
hope).

On branch ubuntu1604fixes
modified:   gourmet/check_encodings.py
modified:   gourmet/exporters/exporter.py
modified:   gourmet/gtk_extras/dialog_extras.py
modified:   gourmet/importers/html_importer.py
modified:   gourmet/importers/importer.py
modified:   gourmet/importers/plaintext_importer.py
modified:   gourmet/importers/webextras.py
modified:   gourmet/plugins/import_export/archive_plugin/zip_readers.py
modified:   gourmet/plugins/import_export/mastercook_import_plugin/mastercook_plaintext_importer.py
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 a pull request may close this issue.

1 participant