1 |
commit: ee0ac6e6b18438098070d9162d6939832f2d14ed |
2 |
Author: Zac Medico <zmedico <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu Oct 1 20:53:15 2015 +0000 |
4 |
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri Oct 2 05:05:54 2015 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=ee0ac6e6 |
7 |
|
8 |
checksum._open_file: fix BytesWarning |
9 |
|
10 |
Fix the following warning message: |
11 |
|
12 |
pym/portage/checksum.py:25: BytesWarning: str() on a bytes instance |
13 |
func_call = "open('%s')" % filename |
14 |
|
15 |
Acked-by: Brian Dolbec <dolsen <AT> gentoo.org> |
16 |
|
17 |
pym/portage/checksum.py | 4 ++-- |
18 |
1 file changed, 2 insertions(+), 2 deletions(-) |
19 |
|
20 |
diff --git a/pym/portage/checksum.py b/pym/portage/checksum.py |
21 |
index 642602e..cdf4670 100644 |
22 |
--- a/pym/portage/checksum.py |
23 |
+++ b/pym/portage/checksum.py |
24 |
@@ -7,7 +7,7 @@ from portage.const import PRELINK_BINARY, HASHING_BLOCKSIZE |
25 |
from portage.localization import _ |
26 |
from portage import os |
27 |
from portage import _encodings |
28 |
-from portage import _unicode_encode |
29 |
+from portage import _unicode_decode, _unicode_encode |
30 |
import errno |
31 |
import stat |
32 |
import subprocess |
33 |
@@ -22,7 +22,7 @@ def _open_file(filename): |
34 |
return open(_unicode_encode(filename, |
35 |
encoding=_encodings['fs'], errors='strict'), 'rb') |
36 |
except IOError as e: |
37 |
- func_call = "open('%s')" % filename |
38 |
+ func_call = "open('%s')" % _unicode_decode(filename) |
39 |
if e.errno == errno.EPERM: |
40 |
raise portage.exception.OperationNotPermitted(func_call) |
41 |
elif e.errno == errno.EACCES: |