[Tutor] subprocess.getstatusoutput : UnicodeDecodeError

Evuraan evuraan at gmail.com
Thu Sep 21 20:04:24 EDT 2017


>
> But: do you really want to "tail" what's probably not really a plaintext
> file? Just guessing, but the .db as well as the error msgs are a hint.

although the filename ends with a ".db", it is just a text file. not
tailing a SQLite or a binary file, just happened to name it so.

I work around the same sort elsewhere thusly:

with open("/tmp/pmaster.db",encoding="utf-8",errors="ignore") as fobj:

or even with codecs

with codecs.open("/tmp/pmaster.db",encoding="utf-8",errors="ignore") as fobj:

I think I've to follow suit here, instead of tail,  apparently there's
no "errors=ignore" for subprocess.

I was hoping subprocess would be impervious to decoding errors, as the
text is coming from tail.


More information about the Tutor mailing list