1 |
Fix the following warning message: |
2 |
|
3 |
pym/portage/checksum.py:25: BytesWarning: str() on a bytes instance |
4 |
func_call = "open('%s')" % filename |
5 |
--- |
6 |
pym/portage/checksum.py | 4 ++-- |
7 |
1 file changed, 2 insertions(+), 2 deletions(-) |
8 |
|
9 |
diff --git a/pym/portage/checksum.py b/pym/portage/checksum.py |
10 |
index 642602e..cdf4670 100644 |
11 |
--- a/pym/portage/checksum.py |
12 |
+++ b/pym/portage/checksum.py |
13 |
@@ -7,7 +7,7 @@ from portage.const import PRELINK_BINARY, HASHING_BLOCKSIZE |
14 |
from portage.localization import _ |
15 |
from portage import os |
16 |
from portage import _encodings |
17 |
-from portage import _unicode_encode |
18 |
+from portage import _unicode_decode, _unicode_encode |
19 |
import errno |
20 |
import stat |
21 |
import subprocess |
22 |
@@ -22,7 +22,7 @@ def _open_file(filename): |
23 |
return open(_unicode_encode(filename, |
24 |
encoding=_encodings['fs'], errors='strict'), 'rb') |
25 |
except IOError as e: |
26 |
- func_call = "open('%s')" % filename |
27 |
+ func_call = "open('%s')" % _unicode_decode(filename) |
28 |
if e.errno == errno.EPERM: |
29 |
raise portage.exception.OperationNotPermitted(func_call) |
30 |
elif e.errno == errno.EACCES: |
31 |
-- |
32 |
2.4.6 |