Fixed JSON regression

master
J. Fernando Sánchez 6 years ago
parent 9c82dea298
commit 27bc3557b2

@ -38,7 +38,7 @@ test: $(addprefix test-,$(PYMAIN))
testall: $(addprefix test-,$(PYVERSIONS))
test-%: build-%
docker run --rm -w /usr/src/app/ -v $$PWD/tests/credentials.json:/usr/src/app/tests/credentials.json --entrypoint=/usr/local/bin/python -ti '$(REPO)/$(NAME):$(VERSION)-python$*' setup.py test --addopts "-vvv -s --pdb" ;
docker run --rm -w /usr/src/app/ --env-file $$PWD/.env -v $$PWD/tests/credentials.json:/usr/src/app/tests/credentials.json --entrypoint=/usr/local/bin/python -ti '$(REPO)/$(NAME):$(VERSION)-python$*' setup.py test --addopts "-vvv -s --pdb" ;
pip_test-%:
docker run --rm -v $$PWD/dist:/dist/ -ti python:$* pip install /dist/$(NAME)-$(VERSION).tar.gz ;

@ -1 +1 @@
0.7.5
0.7.6

@ -153,7 +153,7 @@ def read_file(filename, tail=False):
while True:
line = f.readline()
if line not in (None, '', '\n'):
tweet = json.load(line.strip())
tweet = json.loads(line.strip())
yield tweet
else:
if tail:
@ -440,7 +440,7 @@ def download_tweet(wq, tweetid, write=True, folder="downloaded_tweets", update=F
tweet = None
if update or not cached:
tweet = get_tweet(wq, tweetid)
js = json.dump(tweet, indent=2)
js = json.dumps(tweet, indent=2)
if write:
if tweet:
write_tweet_json(js, folder)

Loading…
Cancel
Save