Bug 968308 - [abrt] asciidoc-8.6.8-1.fc18: a2x:150:write_file:UnicodeEncodeError: 'ascii' codec can't encode character u'\u2019' in position 292: ordinal not in range(128)
Summary: [abrt] asciidoc-8.6.8-1.fc18: a2x:150:write_file:UnicodeEncodeError: 'ascii' ...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: asciidoc
Version: 18
Hardware: x86_64
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Stanislav Ochotnicky
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: abrt_hash:441bbff9b1a40a1b0a38be1f2b4...
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-05-29 12:35 UTC by Lubo
Modified: 2013-12-15 03:32 UTC (History)
4 users (show)

Fixed In Version: asciidoc-8.6.8-3.fc20
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-12-15 03:32:06 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
File: backtrace (2.71 KB, text/plain)
2013-05-29 12:35 UTC, Lubo
no flags Details
File: core_backtrace (366 bytes, text/plain)
2013-05-29 12:35 UTC, Lubo
no flags Details
File: environ (3.95 KB, text/plain)
2013-05-29 12:35 UTC, Lubo
no flags Details
sample file with unexpected character encoding (165 bytes, text/plain)
2013-06-03 09:30 UTC, Lubo
no flags Details

Description Lubo 2013-05-29 12:35:42 UTC
Description of problem:
invoked slightly silly command (fop with epub):
# a2x --icons --fop -fepub ams-readme.txt

Version-Release number of selected component:
asciidoc-8.6.8-1.fc18

Additional info:
reporter:       libreport-2.1.4
cmdline:        python /usr/bin/a2x --icons --fop -fepub ams-readme.txt
executable:     /usr/bin/a2x
kernel:         3.9.4-200.fc18.x86_64
runlevel:       N 5
uid:            1000

Truncated backtrace:
a2x:150:write_file:UnicodeEncodeError: 'ascii' codec can't encode character u'\u2019' in position 292: ordinal not in range(128)

Traceback (most recent call last):
  File "/usr/bin/a2x", line 958, in <module>
    a2x.execute()
  File "/usr/bin/a2x", line 378, in execute
    self.__getattribute__('to_'+self.format)()
  File "/usr/bin/a2x", line 780, in to_epub
    self.update_epub_manifest(opf_file)
  File "/usr/bin/a2x", line 758, in update_epub_manifest
    write_file(opf_file, opf.toxml())
  File "/usr/bin/a2x", line 150, in write_file
    f.write(data)
UnicodeEncodeError: 'ascii' codec can't encode character u'\u2019' in position 292: ordinal not in range(128)

Local variables in innermost frame:
filename: '/home/carik/ams-readme.epub.d/OEBPS/content.opf'
data: u'<?xml version="1.0" ?>\n<package unique-identifier="articleid" version="2.0" xmlns="http://www.idpf.org/2007/opf"><metadata><dc:identifier id="articleid" xmlns:dc="http://purl.org/dc/elements/1.1/">_idm206730851600</dc:identifier><dc:title xmlns:dc="http://purl.org/dc/elements/1.1/">Developer\u2019s guide to AS3953 GUI</dc:title><dc:date xmlns:dc="http://purl.org/dc/elements/1.1/">May 2013</dc:date><dc:creator opf:file-as="Carik, Lubomir" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:opf="http://www.idpf.org/2007/opf">Lubomir Carik</dc:creator><dc:language xmlns:dc="http://purl.org/dc/elements/1.1/">en</dc:language></metadata><manifest><item href="toc.ncx" id="ncxtoc" media-type="application/x-dtbncx+xml"/><item href="docbook-xsl.css" id="css" media-type="text/css"/><item href="index.html" id="idm206730851600" media-type="application/xhtml+xml"/><item href="ar01s01.html" id="idm206730084192" media-type="application/xhtml+xml"/><item href="ar01s02.html" id="idm206727735072" media-type="application/xhtml+xml"/><item href="ar01s03.html" id="idm206730822544" media-type="application/xhtml+xml"/><item href="ar01s04.html" id="idm206730819328" media-type="application/xhtml+xml"/><item href="ar01s05.html" id="idm206730945552" media-type="application/xhtml+xml"/><item href="images/icons/important.png" id="a2x-1" media-type="image/png"/><item href="images/icons/tip.png" id="a2x-2" media-type="image/png"/><item href="images/icons/warning.png" id="a2x-3" media-type="image/png"/><item href="images/icons/caution.png" id="a2x-4" media-type="image/png"/><item href="images/icons/note.png" id="a2x-5" media-type="image/png"/></manifest><spine toc="ncxtoc"><itemref idref="idm206730851600"/><itemref idref="idm206730084192"/><itemref idref="idm206727735072"/><itemref idref="idm206730822544"/><itemref idref="idm206730819328"/><itemref idref="idm206730945552"/></spine></package>'
mode: 'w'
f: <closed file '/home/carik/ams-readme.epub.d/OEBPS/content.opf', mode 'w' at 0x1722540>

Comment 1 Lubo 2013-05-29 12:35:46 UTC
Created attachment 754332 [details]
File: backtrace

Comment 2 Lubo 2013-05-29 12:35:49 UTC
Created attachment 754333 [details]
File: core_backtrace

Comment 3 Lubo 2013-05-29 12:35:52 UTC
Created attachment 754334 [details]
File: environ

Comment 4 Stanislav Ochotnicky 2013-05-30 09:20:35 UTC
Would it be possible to attach given ams-readme.txt file? It would certainly help with reproducing/fixing

Comment 5 Lubo 2013-06-03 09:30:29 UTC
Created attachment 756214 [details]
sample file with unexpected character encoding

Hi, I can't attach original (full file). But at least a sub-set of original file to reproduce the crash...

Comment 6 Stanislav Ochotnicky 2013-06-03 12:16:15 UTC
Thanks for reproducer. The problem is actually in the way a2x tries to modify epub manifest when using --icons (regardless of using --fop). I obviously doesn't handle encoding properly at all. I whipped up a patch really quickly just to verify a fix, but will need to clean it up before submitting upstream.

Comment 7 Fedora Update System 2013-12-04 09:46:32 UTC
asciidoc-8.6.8-3.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/asciidoc-8.6.8-3.fc20

Comment 8 Fedora Update System 2013-12-05 00:40:32 UTC
Package asciidoc-8.6.8-3.fc20:
* should fix your issue,
* was pushed to the Fedora 20 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing asciidoc-8.6.8-3.fc20'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2013-22724/asciidoc-8.6.8-3.fc20
then log in and leave karma (feedback).

Comment 9 Fedora Update System 2013-12-15 03:32:06 UTC
asciidoc-8.6.8-3.fc20 has been pushed to the Fedora 20 stable repository.  If problems still persist, please make note of it in this bug report.


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