mirror of
https://github.com/Hopiu/linkchecker.git
synced 2026-04-04 15:10:23 +00:00
error message if output file could not be opened
git-svn-id: https://linkchecker.svn.sourceforge.net/svnroot/linkchecker/trunk/linkchecker@1878 e7d03fd6-7b0d-0410-9947-9c21f3af8025
This commit is contained in:
parent
97b8972bd8
commit
ef26bd83db
1 changed files with 10 additions and 3 deletions
13
linkchecker
13
linkchecker
|
|
@ -427,7 +427,8 @@ if options.output:
|
|||
(options.output, "'-o, --output'"))
|
||||
if options.fileoutput:
|
||||
ns = {'fileoutput': 1}
|
||||
for ftype in options.fileoutput:
|
||||
for arg in options.fileoutput:
|
||||
ftype = arg
|
||||
# look for (optional) filename and encoding
|
||||
if '/' in ftype:
|
||||
ftype, suffix = ftype.split('/', 1)
|
||||
|
|
@ -446,11 +447,17 @@ if options.fileoutput:
|
|||
else:
|
||||
ns['filename'] = suffix
|
||||
if linkcheck.Loggers.has_key(ftype):
|
||||
logger = config.logger_new(ftype, **ns)
|
||||
# generating loggers with fileoutput can throw
|
||||
# an exception when opening the file
|
||||
try:
|
||||
logger = config.logger_new(ftype, **ns)
|
||||
except OSError, msg:
|
||||
printUsage(_("Illegal argument %r for option %s: %s") % \
|
||||
(arg, "'-F, --file-output'", str(msg)))
|
||||
config['fileoutput'].append(logger)
|
||||
else:
|
||||
printUsage(_("Illegal argument %r for option %s") % \
|
||||
(ftype, "'-F, --file-output'"))
|
||||
(arg, "'-F, --file-output'"))
|
||||
if options.interactive is not None:
|
||||
config['interactive'] = options.interactive
|
||||
if options.intern:
|
||||
|
|
|
|||
Loading…
Reference in a new issue