Skip to content

Commit

Permalink
Handle UnicodeError, add Makefile to aid packaging
Browse files Browse the repository at this point in the history
  • Loading branch information
dlazesz committed Aug 7, 2020
1 parent 492c60e commit 15f48bc
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
11 changes: 11 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
all:
@echo "See Makefile for possible targets!"

build:
python3 setup.py sdist bdist_wheel

upload:
python3 -m twine upload dist/*

clean:
rm -rf dist/ build/ webarticlecurator.egg-info/
2 changes: 1 addition & 1 deletion webarticlecurator/enhanced_downloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ def _download_url(self, url):

try: # The actual request
resp = self._requests_get(url, headers=self._req_headers, stream=True, verify=self._verify_request)
except RequestException as err:
except (UnicodeError, RequestException) as err: # UnicodeError is originated from idna codec error
self._handle_request_exception(url, 'RequestException happened during downloading: {0} \n\n'
' The program ignores it and jumps to the next one.'.format(err))
return None
Expand Down
2 changes: 1 addition & 1 deletion webarticlecurator/version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env pyhton3
# -*- coding: utf-8, vim: expandtab:ts=4 -*-

__version__ = '1.0.1'
__version__ = '1.0.2'

0 comments on commit 15f48bc

Please sign in to comment.