1 |
On Thu, 1 Oct 2015 13:55:42 -0700 |
2 |
Zac Medico <zmedico@g.o> wrote: |
3 |
|
4 |
> Fix the following warning message: |
5 |
> |
6 |
> pym/portage/checksum.py:25: BytesWarning: str() on a bytes instance |
7 |
> func_call = "open('%s')" % filename |
8 |
> --- |
9 |
> pym/portage/checksum.py | 4 ++-- |
10 |
> 1 file changed, 2 insertions(+), 2 deletions(-) |
11 |
> |
12 |
> diff --git a/pym/portage/checksum.py b/pym/portage/checksum.py |
13 |
> index 642602e..cdf4670 100644 |
14 |
> --- a/pym/portage/checksum.py |
15 |
> +++ b/pym/portage/checksum.py |
16 |
> @@ -7,7 +7,7 @@ from portage.const import PRELINK_BINARY, |
17 |
> HASHING_BLOCKSIZE from portage.localization import _ |
18 |
> from portage import os |
19 |
> from portage import _encodings |
20 |
> -from portage import _unicode_encode |
21 |
> +from portage import _unicode_decode, _unicode_encode |
22 |
> import errno |
23 |
> import stat |
24 |
> import subprocess |
25 |
> @@ -22,7 +22,7 @@ def _open_file(filename): |
26 |
> return open(_unicode_encode(filename, |
27 |
> encoding=_encodings['fs'], errors='strict'), |
28 |
> 'rb') except IOError as e: |
29 |
> - func_call = "open('%s')" % filename |
30 |
> + func_call = "open('%s')" % _unicode_decode(filename) |
31 |
> if e.errno == errno.EPERM: |
32 |
> raise |
33 |
> portage.exception.OperationNotPermitted(func_call) elif e.errno == |
34 |
> errno.EACCES: |
35 |
|
36 |
|
37 |
yeah,looks good. |
38 |
|
39 |
Also for trivial patches like this, there is no need for review. |
40 |
-- |
41 |
Brian Dolbec <dolsen> |