#8148 Error exporting with certain attachments

unreleased
closed
bitesize (71)
General
nobody
2017-03-31
2017-03-07
No

Ran into this error. Looks like attachment paths need some unicode handling

04:10:28,132 ERROR [taskd:allura.tasks.export_tasks.bulk_export:58b8eca6bcf63a2f70b65a8e:allura.tasks.export_tasks] Error exporting: discussion on openemr
Traceback (most recent call last):
  File "/var/local/allura/Allura/allura/tasks/export_tasks.py", line 107, in export
    app.bulk_export(f, export_path, with_attachments)
  File "/var/local/allura/ForgeDiscussion/forgediscussion/forum_main.py", line 244, in bulk_export
    self.export_attachments(forum.threads, export_path)
  File "/var/local/allura/ForgeDiscussion/forgediscussion/forum_main.py", line 262, in export_attachments
    self.save_attachments(post_path, post.attachments)
  File "/var/local/allura/Allura/allura/app.py", line 777, in save_attachments
    with open(attachment_path, 'w') as fl:
UnicodeEncodeError: 'ascii' codec can't encode characters in position 132-133: ordinal not in range(128)

Discussion

  • Dave Brondsema

    Dave Brondsema - 2017-03-27
    • status: open --> in-progress
    • assigned_to: Dave Brondsema
     
  • Dave Brondsema

    Dave Brondsema - 2017-03-27
    • status: in-progress --> review
     
  • Dave Brondsema

    Dave Brondsema - 2017-03-27

    Fix on db/8148

    Adding unicode into the automated tests didn't catch this; best to test manually:

    • add an attachment with a non-ascii filename to a discussion or anywhere
    • go to Admin > Export and export with attachments
    • watch allura log file to ensure no errors
    • zip file should be good (at location specified by bulk_export_pathin .ini)
     
  • Kenton Taylor

    Kenton Taylor - 2017-03-31

    Merged.

     
  • Kenton Taylor

    Kenton Taylor - 2017-03-31
    • status: review --> closed
     

Log in to post a comment.