Skip to content

Unicode error when attach a non-english file. #59

Open
@bear0330

Description

@bear0330

If I attach a file named: 抽獎系統工時預估.xlsx
I got this error:

Traceback (most recent call last):
  File "C:\Python27\lib\site-packages\trac\web\main.py", line 551, in _dispatch_request
    dispatcher.dispatch(req)
  File "C:\Python27\lib\site-packages\trac\web\main.py", line 244, in dispatch
    resp = chosen_handler.process_request(req)
  File "C:\Python27\lib\site-packages\trac\attachment.py", line 529, in process_request
    data = self._do_save(req, attachment)
  File "C:\Python27\lib\site-packages\trac\attachment.py", line 782, in _do_save
    attachment.insert(filename, upload.file, size)
  File "C:\Python27\lib\site-packages\trac\attachment.py", line 345, in insert
    listener.attachment_added(self)
  File "build\bdist.win-amd64\egg\code_comments\subscription.py", line 413, in attachment_added
    Subscription.from_attachment(self.env, attachment)
  File "build\bdist.win-amd64\egg\code_comments\subscription.py", line 198, in from_attachment
    attachment.filename)
UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-7: ordinal not in range(128)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions