You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
flexget history crashes when piping to less or redirecting to a file #1223
I've been constantly upgrading to newest versions and am now on 2.1.1 and still getting the same error. flexget history | less no longer gives a stack trace, it just stops producing output, so if you scroll to end you see the history output just cuts short. But if you redirect the output you can still see the problem exists:
$ flexget history > /tmp/flex.out
Could not start manager: 'ascii' codec can't encode character u'\u2013' in position 47: ordinal not in range(128)
This has something to do with system encoding, It was asked before.
Note that you can use the API for this as well: curl -X GET --header "Accept: application/json" "http://host:5050/api/history/?page=1&max=50" < /tmp/flex.out
and the encoding issue has been fixed in other commands in the past. the api only works if you run the daemon and many of us don't. i only run flexget via cron or the command line.
$ git diff flexget/logger.py
diff --git a/flexget/logger.py b/flexget/logger.py
index fc6524b..626c948 100644
--- a/flexget/logger.py
+++ b/flexget/logger.py
@@ -114,7 +114,8 @@ def console(text, *args, **kwargs):
Accepts arguments like the `print` function does.
"""
if not isinstance(text, str):
- text = str(text).encode(io_encoding, 'replace')
+ text = str(text)
+ text = text.encode(io_encoding, 'replace')
kwargs['file'] = getattr(local_context, 'output', sys.stdout)
print(text, *args, **kwargs)
kwargs['file'].flush() # flush to make sure the output is printed right away
why was this labeled "Pending information"? ok, i'll answer the question- no i don't wanna push a pr, cause i only have access via phone these days. i gave you a 2-line patch, how is that insufficient?
yes, mostly. it doesn't crash now, but the new ascii colorization causes visual artifacts when piping through less. it should do something like this instead: if sys.stdout.isatty(): colorize()
Activity
Mirgolth commentedon Jun 27, 2016
Maybe try to upgrade.
I test on my setup with version 2.1.1 and don't face this issue.
grr commentedon Jun 27, 2016
I've been constantly upgrading to newest versions and am now on 2.1.1 and still getting the same error.
flexget history | lessno longer gives a stack trace, it just stops producing output, so if you scroll to end you see the history output just cuts short. But if you redirect the output you can still see the problem exists:liiight commentedon Jun 27, 2016
This has something to do with system encoding, It was asked before.
Note that you can use the API for this as well:
curl -X GET --header "Accept: application/json" "http://host:5050/api/history/?page=1&max=50" < /tmp/flex.outgrr commentedon Jun 27, 2016
and the encoding issue has been fixed in other commands in the past. the api only works if you run the daemon and many of us don't. i only run flexget via cron or the command line.
grr commentedon Jun 29, 2016
This works for me:
liiight commentedon Jun 29, 2016
Cool, wanna push a pr?
grr commentedon Aug 15, 2016
why was this labeled "Pending information"? ok, i'll answer the question- no i don't wanna push a pr, cause i only have access via phone these days. i gave you a 2-line patch, how is that insufficient?
liiight commentedon Aug 16, 2016
This actually has been fixed on
nextbranch with dcce2b5Will mark this as resolved when we merge that branch.
liiight commentedon Aug 17, 2016
Fixed with dcce2b5
liiight commentedon Aug 18, 2016
@grr can you confirm it's fixed?
grr commentedon Aug 22, 2016
yes, mostly. it doesn't crash now, but the new ascii colorization causes visual artifacts when piping through less. it should do something like this instead:
if sys.stdout.isatty(): colorize()liiight commentedon Aug 22, 2016
That's a good idea, we'll see about adding it
grr commentedon Sep 23, 2016
This issue is happening again. Tried with
flexget history | lessandflexget series list all | less. #1407 is the same issue.[change] terminal - Force table type to be ASCII and remove all color…