Bug 1054082 - Could not raise Legal flag with non english character
Summary: Could not raise Legal flag with non english character
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Copr
Classification: Community
Component: frontend
Version: unspecified
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Miroslav Suchý
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-01-16 08:21 UTC by Miroslav Suchý
Modified: 2014-02-06 08:32 UTC (History)
1 user (show)

Fixed In Version: copr-1.25-1
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-02-06 08:32:06 UTC
Embargoed:


Attachments (Terms of Use)
[PATCH] 1054082 - general: encode to utf8 if err in mimetext (1.49 KB, patch)
2014-01-22 00:34 UTC, Igor Gnatenko
no flags Details | Diff

Description Miroslav Suchý 2014-01-16 08:21:30 UTC
Description of problem:
Message type:       ERROR
Location:           /usr/lib/python2.7/site-packages/flask/app.py:1306
Module:             app
Function:           log_exception
Time:               2014-01-16 01:17:40,730

Message:

Exception on /coprs/stransky/FirefoxGtk3/legal_flag/ [POST]
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/flask/app.py", line 1687, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/lib/python2.7/site-packages/flask/app.py", line 1360, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/usr/lib/python2.7/site-packages/flask/app.py", line 1358, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/lib/python2.7/site-packages/flask/app.py", line 1344, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/usr/share/copr/coprs_frontend/coprs/views/misc.py", line 121, in decorated_function
    return f(*args, **kwargs)
  File "/usr/share/copr/coprs_frontend/coprs/views/coprs_ns/coprs_general.py", line 298, in copr_legal_flag
    msg = MIMEText(form.comment.data + navigate_to + contact + reported_by)
  File "/usr/lib64/python2.7/email/mime/text.py", line 30, in __init__
    self.set_payload(_text, _charset)
  File "/usr/lib64/python2.7/email/message.py", line 226, in set_payload
    self.set_charset(charset)
  File "/usr/lib64/python2.7/email/message.py", line 262, in set_charset
    self._payload = self._payload.encode(charset.output_charset)
UnicodeEncodeError: 'ascii' codec can't encode character u'\u3002' in position 30: ordinal not in range(128)

Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1. Raise a legal flag with string íářážčáěěéáíéíáýéý

Actual results:
ISE

Expected results:
no errors

Comment 1 Igor Gnatenko 2014-01-22 00:34:51 UTC
Created attachment 853528 [details]
[PATCH] 1054082 - general: encode to utf8 if err in mimetext

Comment 2 Miroslav Suchý 2014-01-22 18:08:09 UTC
Nice. Thanks for contribution.
Commited as 5b02d9d


Note You need to log in before you can comment on or make changes to this bug.