From: "Paul Varner" <fuzzyray@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/gentoolkit:master commit in: pym/gentoolkit/equery/
Date: Thu, 30 Jun 2016 20:44:54 +0000 (UTC) [thread overview]
Message-ID: <1467319164.b72e032ea252757c4309516c865fafaf7354036b.fuzzyray@gentoo> (raw)
commit: b72e032ea252757c4309516c865fafaf7354036b
Author: Paul Varner <fuzzyray <AT> gentoo <DOT> org>
AuthorDate: Thu Jun 30 20:39:24 2016 +0000
Commit: Paul Varner <fuzzyray <AT> gentoo <DOT> org>
CommitDate: Thu Jun 30 20:39:24 2016 +0000
URL: https://gitweb.gentoo.org/proj/gentoolkit.git/commit/?id=b72e032e
equery: Fix UnicodeDecodeError in python2.7
This fix explicitly decodes the content of the USE description files as
UTF-8. This fixes the UnicodeDecodeError in Python 2.7. Tested with a
POSIX locale with Python 2.7, 3.4 and 3.5.
X-Gentoo-bug: 587606
X-Gentoo-bug-url: https://bugs.gentoo.org/show_bug.cgi?id=587606
pym/gentoolkit/equery/uses.py | 2 ++
1 file changed, 2 insertions(+)
diff --git a/pym/gentoolkit/equery/uses.py b/pym/gentoolkit/equery/uses.py
index 79ed00f..adf8b6c 100644
--- a/pym/gentoolkit/equery/uses.py
+++ b/pym/gentoolkit/equery/uses.py
@@ -138,6 +138,7 @@ def get_global_useflags():
path = os.path.join(settings["PORTDIR"], 'profiles', 'use.desc')
with open(_unicode_encode(path, encoding=_encodings['fs'])) as open_file:
for line in open_file:
+ line = _unicode_decode(line)
if line.startswith('#'):
continue
# Ex. of fields: ['syslog', 'Enables support for syslog\n']
@@ -158,6 +159,7 @@ def get_global_useflags():
try:
with open(_unicode_encode(path, encoding=_encodings['fs'])) as open_file:
for line in open_file:
+ line = _unicode_decode(line)
if line.startswith('#'):
continue
fields = [field.strip() for field in line.split(" - ", 1)]
next reply other threads:[~2016-06-30 20:45 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-30 20:44 Paul Varner [this message]
-- strict thread matches above, loose matches on Subject: below --
2024-03-07 18:49 [gentoo-commits] proj/gentoolkit:master commit in: pym/gentoolkit/equery/ Sam James
2024-03-07 18:49 Sam James
2023-09-19 19:13 Sam James
2023-08-05 5:38 Sam James
2023-07-18 22:30 Sam James
2023-07-18 22:26 Sam James
2022-07-28 15:29 Brian Dolbec
2022-07-28 15:29 Brian Dolbec
2022-07-10 18:41 Brian Dolbec
2022-07-10 18:01 Brian Dolbec
2022-07-10 16:23 Brian Dolbec
2022-07-10 16:23 Brian Dolbec
2022-07-10 1:24 Brian Dolbec
2022-07-09 5:17 Sam James
2018-05-01 12:32 Mike Pagano
2017-09-05 15:32 Mike Gilbert
2016-06-30 23:36 Paul Varner
2016-06-06 19:29 Brian Dolbec
2015-11-09 20:52 Brian Dolbec
2015-11-09 2:42 Brian Dolbec
2015-11-08 17:37 Brian Dolbec
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1467319164.b72e032ea252757c4309516c865fafaf7354036b.fuzzyray@gentoo \
--to=fuzzyray@gentoo.org \
--cc=gentoo-commits@lists.gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox