summaryrefslogtreecommitdiff
path: root/s2-extract-papers.py
diff options
context:
space:
mode:
authorjules@lens <julescarbon@gmail.com>2018-11-03 17:22:14 +0100
committerjules@lens <julescarbon@gmail.com>2018-11-03 17:22:14 +0100
commit84e781ff9b41f6ad04a5c66024fd47efa5b39bbc (patch)
tree3fefd5dfa99d9611a9e2fe759a8cb1279e333b29 /s2-extract-papers.py
parent8ec3acdb68f0107ae2520516817aeda66c6ed9a6 (diff)
edits
Diffstat (limited to 's2-extract-papers.py')
-rw-r--r--s2-extract-papers.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/s2-extract-papers.py b/s2-extract-papers.py
index 178b9009..e84ffd0f 100644
--- a/s2-extract-papers.py
+++ b/s2-extract-papers.py
@@ -41,7 +41,7 @@ def load_id_lookup(fn):
return lookup
def paper_path(paper_id):
- return '{}/{}/{}'.format(DATA_DIR, paper_id[0:3], paper_id)
+ return '{}/{}/{}'.format(DATA_DIR, paper_id[0:2], paper_id)
def write_paper(paper_id, data):
dir = paper_path(paper_id)
@@ -49,7 +49,7 @@ def write_paper(paper_id, data):
if os.path.exists(fn):
return
os.makedirs(dir, exist_ok=True)
- with open(fn, 'wb') as f:
+ with open(fn, 'w') as f:
f.write(data)
if __name__ == '__main__':