python3: Exception if there is any output on std_err
See original GitHub issueTestscript:
#!/usr/bin/env python3
import winrm
s = winrm.Session('127.0.0.1:55985', auth=('vagrant', 'vagrant'))
s.run_ps('asfasf')
Result:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/alvaro/.local/lib/python3.5/site-packages/winrm/__init__.py", line 54, in run_ps
rs.std_err = self._clean_error_msg(rs.std_err)
File "/home/alvaro/.local/lib/python3.5/site-packages/winrm/__init__.py", line 62, in _clean_error_msg
if msg.startswith("#< CLIXML\r\n"):
TypeError: startswith first arg must be bytes or a tuple of bytes, not str
Issue Analytics
- State:
- Created 7 years ago
- Reactions:5
- Comments:5
Top Results From Across the Web
Does Python traceback.print_exc() prints to stdout or stderr?
According to the python documentation states "If file is omitted or None, the output goes to sys.stderr; otherwise it should be an open...
Read more >8. Errors and Exceptions — Python 3.11.1 documentation
If an exception occurs which does not match the exception named in the except clause, it is passed on to outer try statements;...
Read more >How to print to stderr and stdout in Python? - GeeksforGeeks
In Python, whenever we use print() the text is written to Python's sys.stdout, whenever input() is used, it comes from sys.stdin, ...
Read more >Capturing stderr and exceptions from python in org-mode
I defined a function that temporarily redirects the output to stdout and stderr, so they can be captured. I execute the code wrapped...
Read more >Understanding the Python Traceback
Python prints a traceback when an exception is raised in your code. The traceback output can be a bit overwhelming if you're seeing...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@nitzmahone: I think this is a pretty serious issue as it prevents any error handling when run under Python 3. Any chance a fix for this will get done in a timely manner?
duplicate of #111