Errors when description contains extended characters

Bug #954983 reported by Jonathan Lange
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
pkgme
Fix Released
High
Jonathan Lange

Bug Description

Someone submitted an application with extended characters (“, ”, and ’). pkgme blew up when writing the packaging for that application:

[2012-03-14 12:14:40,278: INFO/MainProcess] Got task from broker: djpkgme.tasks.BuildPackageTask[1f91567a-a46d-4f0a-96e3-f0d80b71cbef]
[2012-03-14 12:14:40,279: INFO/PoolWorker-4] djpkgme.tasks.BuildPackageTask[1f91567a-a46d-4f0a-96e3-f0d80b71cbef]: Building package for 698: https://myapps.developer.ubuntu.com/internal_packages/2012/03/013287816X_1.pdf
[2012-03-14 12:14:42,112: ERROR/MainProcess] Task djpkgme.tasks.BuildPackageTask[1f91567a-a46d-4f0a-96e3-f0d80b71cbef] raised exception: UnicodeEncodeError('ascii', u"Source: ubuntuunleashed2012editioncovering11.10and12.047e\nSection: misc\nPriority: extra\nMaintainer: A Person <email address hidden>\nBuild-Depends: debhelper (>=7)\n\nPackage: ubuntuunleashed2012editioncovering11.10and12.047e\nArchitecture: all\nSection: misc\nPriority: extra\nDepends: xdg-utils, ${misc:Depends}\nDescription: 'Ubuntu Unleashed' is filled with unique and advanced information for everyone who wants to make the most of the Ubuntu Linux operating system. This new edition has been thoroughly revised and updated by a long-time Ubuntu community leader to reflect the exciting new Ubuntu 11.10 (Oneiric Ocelot) and the forthcoming Ubuntu 12.04.\n .\n Former Ubuntu Forum administrator Matthew Helmke covers all you need to know about Ubuntu 11.10/12.04 installation, configuration, productivity, multimedia, development, system administration, server operations, networking, virtualization, security, DevOps, and more\u2014including intermediate-to-advanced techniques you won\u2019t find in any other book.\n .\n Helmke presents up-to-the-minute introductions to Ubuntu\u2019s key productivity and Web development tools, programming languages, hardware support, and more. You\u2019ll find brand-new coverage of the new Unity desktop, new NoSQL database support and Android mobile development tools, and many other Ubuntu 11.10/12.04 innovations. Whether you\u2019re new to Ubuntu or already a power user, you\u2019ll turn to this book constantly: for new techniques, new solutions, and new ways to do even more with Ubuntu!\n .\n Matthew Helmke served from 2006 to 2011 on the Ubuntu Forum Council, providing leadership and oversight of the Ubuntu Forums, and spent two years on the Ubuntu regional membership approval board for Europe, the Middle East, and Africa. He has written about Ubuntu for several magazines and websites, is a lead author of 'The Official Ubuntu Book'. He works for The iPlant Collaborative, which is funded by the National Science Foundation and is building cyberinfrastructure for the biological sciences to support the growing use of massive amounts of data and computationally intensive forms of research.\n .\n * Quickly install Ubuntu, configure it, and get your hardware running right\n * Configure and customize the new Unity desktop (or alternatives such as GNOME)\n * Get started with multimedia and productivity applications, including LibreOffice\n * Manage Linux services, users, and software packages\n * Administer and use Ubuntu from the command line\n * Automate tasks and use shell scripting\n * Provide secure remote access\n * Manage kernels and modules\n * Administer file, print, email, proxy, LDAP, and database services (both SQL and NoSQL)\n * Use both Apache and alternative HTTP servers\n * Support and use virtualization\n * Use Ubuntu in cloud environments\n * Learn the basics about popular programming languages including Python, PHP, and Perl, and how to use Ubuntu to develop in them\n * Learn how to get started developing Android mobile devices\n", 921, 922, 'ordinal not in range(128)')
Traceback (most recent call last):
  File "/usr/lib/pymodules/python2.6/celery/execute/trace.py", line 47, in trace
    return cls(states.SUCCESS, retval=fun(*args, **kwargs))
  File "/usr/lib/pymodules/python2.6/celery/app/task/__init__.py", line 247, in __call__
    return self.run(*args, **kwargs)
  File "/srv/pkgme-service.canonical.com/production/pkgme-service/sourcecode/../src/djpkgme/tasks.py", line 432, in run
    self._submit_error(metadata, (exc_type, exc_obj, None))
  File "/srv/pkgme-service.canonical.com/production/pkgme-service/sourcecode/../src/djpkgme/tasks.py", line 416, in run
    packaged_app_path = self.build_package(metadata, overrides)
  File "/srv/pkgme-service.canonical.com/production/pkgme-service/sourcecode/../src/djpkgme/tasks.py", line 347, in build_package
    working_path, allowed_backend_names=ALLOWED_BACKEND_NAMES)
  File "/srv/pkgme-service.canonical.com/production/pkgme-service/sourcecode/pkgme/pkgme/__init__.py", line 46, in write_packaging
    Writer().write(files, path)
  File "/srv/pkgme-service.canonical.com/production/pkgme-service/sourcecode/pkgme/pkgme/write.py", line 29, in write
    write_file(target_path, package_file.get_contents())
  File "/srv/pkgme-service.canonical.com/production/pkgme-service/sourcecode/pkgme/pkgme/package_files.py", line 98, in get_contents
    return t.render(self.values)
  File "/srv/pkgme-service.canonical.com/production/pkgme-service/sourcecode/pkgme/pkgme/template_file.py", line 16, in render
    return str(t)
UnicodeEncodeError: 'ascii' codec can't encode character u'\u2014' in position 921: ordinal not in range(128)

Related branches

Jonathan Lange (jml)
tags: added: unicode
Jonathan Lange (jml)
tags: added: packager-feedback
Jonathan Lange (jml)
Changed in pkgme:
status: New → In Progress
assignee: nobody → Jonathan Lange (jml)
importance: Undecided → High
Jonathan Lange (jml)
Changed in pkgme:
status: In Progress → Fix Committed
James Westby (james-w)
Changed in pkgme:
status: Fix Committed → Fix Released
milestone: none → 0.2
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.