python - UnicodeDecodeError when trying to read file object returned by os.popen() -


i trying make ping sweeper in python 3.5.2, when try read file object os.popen() returns unicodedecodeerror:

  file "c:\python35\lib\encodings\cp1252.py", line 23, in decode     return codecs.charmap_decode(input,self.errors,decoding_table)[0] unicodedecodeerror: 'charmap' codec can't decode byte 0x81 in position 18: character maps <undefined> 

i using german version windows 10 x64 , in output of ping command various 'ΓΌ's, think problem. not able find way choose encoding use returned object.

interestingly works fine python 2.7.12, there must have changed in decoding.


Comments