
hello, for a small server program, I wanted to know which ports were occuped. with the dos command 'netstat' so I tried this: *>>>a=os.popen('netstat')* *>>>bytes(a.read())* but this occured in the second step: *Traceback (most recent call last):* * File "<pyshell#20>", line 1, in <module>* * bytes(a.read())* * File "C:\Apps\Programmation\Python3.2\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 0x90 in position 79: character maps to <undefined>* *how can I avoid it and why does the windows cmd does return an undecodable character?* *thank you.*

Hello Liam, This is a mailing list for discussing possible future ideas for the next version of Python, not for general support. I recommend that you use the python-list@python.org mailing list, also available via Usenet on comp.lang.python. Good luck. On Tue, Jul 01, 2014 at 06:31:22PM +0200, Liam Marsh wrote:
hello, for a small server program, I wanted to know which ports were occuped. with the dos command 'netstat' so I tried this:
*>>>a=os.popen('netstat')* *>>>bytes(a.read())*
but this occured in the second step:
*Traceback (most recent call last):* * File "<pyshell#20>", line 1, in <module>* * bytes(a.read())* * File "C:\Apps\Programmation\Python3.2\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 0x90 in position 79: character maps to <undefined>*
*how can I avoid it and why does the windows cmd does return an undecodable character?*
*thank you.*
_______________________________________________ Python-ideas mailing list Python-ideas@python.org https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/
participants (2)
-
Liam Marsh
-
Steven D'Aprano