Skip to content

Commit

Permalink
* fix "Keys and values must be strings" error
Browse files Browse the repository at this point in the history
* delete the temporary file if we get a printing error
* add better error logging in case of printing error

git-svn-id: https://xpra.org/svn/Xpra/trunk@14202 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Oct 19, 2016
1 parent 2e16cc4 commit 9877d93
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
9 changes: 8 additions & 1 deletion src/xpra/net/file_transfer.py
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,14 @@ def delfile():
printlog.error(" printers available: %s", csv(printers.keys()) or "none")
delfile()
return
job = print_files(printer, [filename], title, options)
try:
job = print_files(printer, [filename], title, options)
except Exception as e:
printlog("print_files%s", (printer, [filename], title, options), exc_info=True)
printlog.error("Error: cannot print file '%s'", os.path.basename(filename))
printlog.error(" %s", e)
delfile()
return
printlog("printing %s, job=%s", filename, job)
if job<=0:
printlog("printing failed and returned %i", job)
Expand Down
2 changes: 1 addition & 1 deletion src/xpra/platform/pycups_printing.py
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ def print_files(printer, filenames, title, options):
raise Exception("invalid printer: '%s'" % printer)
log("pycups.print_files%s", (printer, filenames, title, options))
actual_options = DEFAULT_CUPS_OPTIONS.copy()
actual_options.update(options)
actual_options.update(dict(str(k),str(v) for k,v in options.items()))
if SIMULATE_PRINT_FAILURE:
log.warn("Warning: simulating print failure")
conn = None
Expand Down

0 comments on commit 9877d93

Please sign in to comment.