diff --git a/404main b/404main index bef3227..c398678 100755 --- a/404main +++ b/404main @@ -128,7 +128,7 @@ def main(): if len(sys.argv) == 3 and sys.argv[2]: distro = sys.argv[2] if not get_package_version(cache, distro, 'bash'): - print '«%s» is not a valid distribution.' % distro + print u'«%s» is not a valid distribution.' % distro print ('Remember that for 404main to work with a certain ' 'distribution it must be in your /etc/apt/sources.list ' 'file.') @@ -139,12 +139,12 @@ def main(): distro = process.stdout.read().strip('\n') if not get_package_version(cache, distro, sys.argv[1]): - print 'Can\'t find package «%s» in distribution «%s».' % \ - (sys.argv[1], distro) + print (u"Can't find package «%s» in distribution «%s»." + % (sys.argv[1], distro)) sys.exit(1) - print 'Checking package «%s» in distribution «%s»...' % \ - (sys.argv[1], distro) + print (u'Checking package «%s» in distribution «%s»...' + % (sys.argv[1], distro)) find_main(cache, sys.argv[1]) @@ -159,8 +159,8 @@ def main(): print ' ', package if all_in_main: - print ('Package «%s» and all its dependencies and build dependencies ' - 'are in main.') % sys.argv[1] + print (u'Package «%s» and all its dependencies and build dependencies ' + u'are in main.') % sys.argv[1] if __name__ == '__main__': diff --git a/debian/changelog b/debian/changelog index f6442d3..452a478 100644 --- a/debian/changelog +++ b/debian/changelog @@ -19,6 +19,8 @@ ubuntu-dev-tools (0.129) UNRELEASED; urgency=low * syncpackage: Show changes to be synced when performing native syncs. * syncpackage: Support --bug (extra bugs to be closed by the sync) with native syncs. (Bugs are closed one individually, via the API, post-sync) + * dgetlp, submittodebian, 404main: Use unicode strings for literal strings + containing non-ASCII characters (LP: #836661) -- Stefano Rivera Sat, 03 Sep 2011 21:04:38 +0200 diff --git a/dgetlp b/dgetlp index c6ded51..91337dc 100755 --- a/dgetlp +++ b/dgetlp @@ -219,10 +219,10 @@ def download(dscinfo, number, filename, verify=True): fd.close() outfd.close() except urllib2.HTTPError, err: - status("Failed to fetch «%s» file, aborting.", ftype) + status(u"Failed to fetch «%s» file, aborting.", ftype) error(106, "Error: (%d %s)", err.code, err.msg) except urllib2.URLError, err: - status("Failed to fetch «%s» file, aborting.", ftype) + status(u"Failed to fetch «%s» file, aborting.", ftype) error(105, "Error: %s", err) except IOError, err: status('Could not create "%s"', filename) diff --git a/submittodebian b/submittodebian index caa3d18..3d4ffc4 100755 --- a/submittodebian +++ b/submittodebian @@ -35,13 +35,13 @@ from ubuntutools.question import YesNoQuestion try: from debian.changelog import Changelog except ImportError: - print ('This utility requires modules from the «python-debian» package, ' - 'which isn\'t currently installed.') + print (u"This utility requires modules from the «python-debian» package, " + u"which isn't currently installed.") sys.exit(1) if not os.path.exists('/usr/bin/reportbug'): - print ('This utility requires the «reportbug» package, which isn\'t ' - 'currently installed.') + print (u"This utility requires the «reportbug» package, which isn't " + u"currently installed.") sys.exit(1) def get_most_recent_debian_version(changelog): @@ -104,7 +104,7 @@ def check_file(fname, critical = True): else: if not critical: return False - print "Couldn't find «%s».\n" % fname + print u"Couldn't find «%s».\n" % fname sys.exit(1) def edit_debdiff(debdiff):