chmod(filename, 0o600)
# If it didn't work, but in a predictable way (some host is down),
- # then we report that error and keep going. At least one sort of
- # HTTPException (BadStatusLine) is not translated by urllib into
- # an HTTPError, so we catch HTTPExceptions too.
+ # then we report that error and keep going.
except URLError as e:
tpl = '{:s}: {:s} from {:s}'
msg = tpl.format(u.name, str(e.reason), u.host)
print(msg, file=stderr)
status = EXIT_BACKUPS_FAILED
except HTTPException as e:
+ # At least one sort of HTTPException (BadStatusLine) is not
+ # translated by urllib into an HTTPError, so we catch
+ # HTTPExceptions too.
tpl = '{:s}: HTTP exception {:s} from {:s}'
msg = tpl.format(u.name, repr(e), u.host)
print(msg, file=stderr)
msg += 'in section "' + s.name + '"'
raise configparser.ParsingError(msg)
- #
# Finally, create a URL opener to make HTTPS requests.
#
# First, create a cookie jar that we'll attach to our URL