Update src/yunohost/log.py

This commit is contained in:
ljf (zamentur) 2021-09-02 14:08:18 +02:00 committed by GitHub
parent 5af70af47d
commit caef1e0577
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -373,7 +373,11 @@ def is_unit_operation(
if field in context:
context.pop(field, None)
# Manage file or stream
# Context is made from args given to main function by argparse
# This context will be added in extra parameters in yml file, so this context should
# be serializable and short enough (it will be displayed in webadmin)
# Argparse can provide some File or Stream, so here we display the filename or
# the IOBase, if we have no name.
for field, value in context.items():
if isinstance(value, IOBase):
try: