Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 16862

UnicodeDecodeError: ‘utf-8’ can’t decode byte 0x90 in position 4024984: invalid start byte

$
0
0

I’m running a subprocess in full trace mode and displaying it using logger.info()

> std = subprocess.run(subprocess_cmd, shell=True,> universal_newlines=True, stdout=subprocess.PIPE,> stderr=subprocess.PIPE)> > all_stdout = all_stdout + std.stdout +‘\n’ all_stderr = all_stderr +> std.stderr +‘\n’> > logger.info(‘\nstdout:\n’+ all_stdout +‘\nstderr:\n’+ all_stderr)

But I’m getting the below error when the subprocess is getting printed.

UnicodeDecodeError: ‘utf-8’ codec can’t decide byte 0x90 in position 4024984:invalid start byte

I have tried giving universal_lines as False but it throws TypeError: must be str, not bytes.

I have also tried this -std = subprocess.run(subprocess_cmd, shell=True, stdout=subprocess.PIPE,

> stderr=subprocess.PIPE, env=environ, encoding=‘utf-8’)

This gives me same UnicodeDecodeError.


Viewing all articles
Browse latest Browse all 16862


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>