mirror of
https://github.com/9001/copyparty.git
synced 2026-03-17 05:33:34 +10:00
xz-compress logs only if -lo ends with .xz
This commit is contained in:
@@ -346,10 +346,12 @@ class SvcHub(object):
|
||||
fn = sel_fn
|
||||
|
||||
try:
|
||||
import lzma
|
||||
|
||||
lh = lzma.open(fn, "wt", encoding="utf-8", errors="replace", preset=0)
|
||||
if fn.lower().endswith(".xz"):
|
||||
import lzma
|
||||
|
||||
lh = lzma.open(fn, "wt", encoding="utf-8", errors="replace", preset=0)
|
||||
else:
|
||||
lh = open(fn, "wt", encoding="utf-8", errors="replace")
|
||||
except:
|
||||
import codecs
|
||||
|
||||
|
||||
Reference in New Issue
Block a user