From: "Paul Varner" <fuzzyray@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/gentoolkit:master commit in: pym/gentoolkit/revdep_rebuild/
Date: Mon, 15 Aug 2016 21:06:13 +0000 (UTC) [thread overview]
Message-ID: <1471294923.c8783ccb225cddb43052463c092e8edc091c371a.fuzzyray@gentoo> (raw)
commit: c8783ccb225cddb43052463c092e8edc091c371a
Author: Paul Varner <fuzzyray <AT> gentoo <DOT> org>
AuthorDate: Mon Aug 15 21:02:03 2016 +0000
Commit: Paul Varner <fuzzyray <AT> gentoo <DOT> org>
CommitDate: Mon Aug 15 21:02:03 2016 +0000
URL: https://gitweb.gentoo.org/proj/gentoolkit.git/commit/?id=c8783ccb
revdep-ebuild: Fix unicode argument expected error
Use the os module from portage to fix inconsistent returning of unicode
and str objects from listdir and explictly write the timestamp as
unicode.
X-Gentoo-bug: 589130
X-Gentoo-bug-url: https://bugs.gentoo.org/show_bug.cgi?id=589130
pym/gentoolkit/revdep_rebuild/cache.py | 8 +++++---
pym/gentoolkit/revdep_rebuild/collect.py | 2 +-
2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/pym/gentoolkit/revdep_rebuild/cache.py b/pym/gentoolkit/revdep_rebuild/cache.py
index 7359d05..e92e7cd 100644
--- a/pym/gentoolkit/revdep_rebuild/cache.py
+++ b/pym/gentoolkit/revdep_rebuild/cache.py
@@ -5,17 +5,19 @@ Functions for reading, saving and verifying the data caches
from __future__ import print_function
-import os
+from portage import os
import time
import sys
if sys.hexversion < 0x3000000:
from io import open
+ _unicode = unicode
+else:
+ _unicode = str
from portage import _encodings, _unicode_decode, _unicode_encode
from portage.output import red
from .settings import DEFAULTS
-
def read_cache(temp_path=DEFAULTS['DEFAULT_TMP_DIR']):
''' Reads cache information needed by analyse function.
This function does not checks if files exists nor timestamps,
@@ -59,7 +61,7 @@ def save_cache(logger, to_save={}, temp_path=DEFAULTS['DEFAULT_TMP_DIR']):
try:
_file = open(_unicode_encode(os.path.join(temp_path, 'timestamp'),
encoding=_encodings['fs']), mode='w', encoding=_encodings['content'])
- _file.write(str(int(time.time())))
+ _file.write(_unicode(int(time.time())))
_file.close()
for key,val in to_save.items():
diff --git a/pym/gentoolkit/revdep_rebuild/collect.py b/pym/gentoolkit/revdep_rebuild/collect.py
index ab3ef97..82cec7b 100644
--- a/pym/gentoolkit/revdep_rebuild/collect.py
+++ b/pym/gentoolkit/revdep_rebuild/collect.py
@@ -5,7 +5,7 @@
from __future__ import print_function
import re
-import os
+from portage import os
import glob
import stat
import sys
next reply other threads:[~2016-08-15 21:06 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-15 21:06 Paul Varner [this message]
-- strict thread matches above, loose matches on Subject: below --
2022-07-09 1:49 [gentoo-commits] proj/gentoolkit:master commit in: pym/gentoolkit/revdep_rebuild/ Mike Gilbert
2020-02-14 18:13 Zac Medico
2019-08-19 3:41 Zac Medico
2019-08-19 3:41 Zac Medico
2017-05-05 19:38 Paul Varner
2017-03-10 17:31 Zac Medico
2016-12-29 21:36 Jason Donenfeld
2016-09-15 15:05 Brian Dolbec
2016-09-15 15:05 Brian Dolbec
2016-06-09 19:38 Slawek Lis
2016-05-18 15:41 Brian Dolbec
2016-05-18 15:41 Brian Dolbec
2016-05-18 15:14 Brian Dolbec
2016-05-18 6:10 Brian Dolbec
2016-02-25 21:26 Brian Dolbec
2016-01-18 0:00 Jason Donenfeld
2015-12-20 2:05 Brian Dolbec
2015-12-16 17:53 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=1471294923.c8783ccb225cddb43052463c092e8edc091c371a.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