X-Git-Url: https://plomlompom.com/repos/?p=plomlombot-irc.git;a=blobdiff_plain;f=plomlombot.py;h=ed0279279076217fb192ce3f49a76c570d90c111;hp=b95bb42499f2f99f3c701b869d4ac84670efcc8b;hb=5ef37de70327806a7c95b8c64f974a17c450f2d7;hpb=031eeac526e6aad183d35a929680148afbb4a94e diff --git a/plomlombot.py b/plomlombot.py index b95bb42..ed02792 100755 --- 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: - 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 @@ -293,6 +293,7 @@ def handle_url(url, notice, show_url=False): except (requests.exceptions.TooManyRedirects, requests.exceptions.ConnectionError, requests.exceptions.InvalidURL, + UnicodeError, requests.exceptions.InvalidSchema) as error: notice("TROUBLE FOLLOWING URL: " + str(error)) return