home
·
contact
·
privacy
projects
/
plomlombot-irc.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add idna Unicode decoding error handler to URL follower.
[plomlombot-irc.git]
/
plomlombot.py
diff --git
a/plomlombot.py
b/plomlombot.py
index b95bb42499f2f99f3c701b869d4ac84670efcc8b..ed0279279076217fb192ce3f49a76c570d90c111 100755
(executable)
--- a/
plomlombot.py
+++ b/
plomlombot.py
@@
-246,7
+246,7
@@
def handle_command(command, argument, notice, target, session):
def twt():
def try_open(mode):
try:
def twt():
def try_open(mode):
try:
- twtfile = open(session.twtfile,
"w"
)
+ twtfile = open(session.twtfile,
mode
)
except (PermissionError, FileNotFoundError) as err:
notice("CAN'T ACCESS OR CREATE TWT FILE: " + str(err))
return None
except (PermissionError, FileNotFoundError) as err:
notice("CAN'T ACCESS OR CREATE TWT FILE: " + str(err))
return None
@@
-293,6
+293,7
@@
def handle_url(url, notice, show_url=False):
except (requests.exceptions.TooManyRedirects,
requests.exceptions.ConnectionError,
requests.exceptions.InvalidURL,
except (requests.exceptions.TooManyRedirects,
requests.exceptions.ConnectionError,
requests.exceptions.InvalidURL,
+ UnicodeError,
requests.exceptions.InvalidSchema) as error:
notice("TROUBLE FOLLOWING URL: " + str(error))
return
requests.exceptions.InvalidSchema) as error:
notice("TROUBLE FOLLOWING URL: " + str(error))
return