mirror of
https://github.com/9001/copyparty.git
synced 2025-08-18 01:22:13 -06:00
xz-compress logs only if -lo ends with .xz
This commit is contained in:
parent
8829f56d4c
commit
97ff0ebd06
|
@ -346,10 +346,12 @@ class SvcHub(object):
|
||||||
fn = sel_fn
|
fn = sel_fn
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
if fn.lower().endswith(".xz"):
|
||||||
import lzma
|
import lzma
|
||||||
|
|
||||||
lh = lzma.open(fn, "wt", encoding="utf-8", errors="replace", preset=0)
|
lh = lzma.open(fn, "wt", encoding="utf-8", errors="replace", preset=0)
|
||||||
|
else:
|
||||||
|
lh = open(fn, "wt", encoding="utf-8", errors="replace")
|
||||||
except:
|
except:
|
||||||
import codecs
|
import codecs
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue