From 6e91ebc0dd9dbb2ce9142216a1aa0c4575f350eb Mon Sep 17 00:00:00 2001 From: dzhwinter Date: Wed, 24 May 2017 19:30:27 +0800 Subject: [PATCH] "remove extrafile" --- python/paddle/v2/dataset/mq2007.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/python/paddle/v2/dataset/mq2007.py b/python/paddle/v2/dataset/mq2007.py index d8c9918d140..fd71b341662 100644 --- a/python/paddle/v2/dataset/mq2007.py +++ b/python/paddle/v2/dataset/mq2007.py @@ -41,7 +41,9 @@ def __initialize_meta_info__(): """ fn = fetch() rar = rarfile.RarFile(fn) - return rar + dirpath = os.path.dirname(fn) + rar.extractall(path=dirpath) + return dirpath class Query(object): @@ -271,7 +273,7 @@ def load_from_text(filepath, shuffle=True, fill_missing=-1): querylists = [] querylist = None fn = __initialize_meta_info__() - with fn.open(os.path.join(fn, filepath)) as f: + with open(os.path.join(fn, filepath)) as f: for line in f: query = Query() query = query._parse_(line) -- GitLab