You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
endpoint = output.strip().decode("utf-8")
Affected Version: at least since 0.10.3
I use PyCharm on Windows 10 to debug my pytest test cases. Starting the conatiners the above line is executed to to resolve a port for a service.
output = self._docker_compose.execute("port %s %d" % (service, container_port)) results to b'0.0.0.0:12347\r\n\x1b[0m'. No control character is removed. Hence, output.strip().decode("utf-8") result to s string including the control characters.
Some lines later (L86) if len(endpoint.split("\n")) > 1: does not support windows line endings.
On Linux or Git Bash for Windows, there is no problem.
My fix for that. Please check this solution:
endpoint = endpoint.replace("\r",'') # add support for windows line ending
if len(endpoint.split("\n")) > 1:
endpoint = endpoint.split("\n")[-1] # index -1 is also wrong for me because it results to '\x1b[0m'. Maybe use 0 or -2
The text was updated successfully, but these errors were encountered:
I can confirm this issue. I faced a similar problem in setting up and almost gave up on it. Any suggestions for a fix? I can do the grunt work to make the merge request.
Affected Line
pytest-docker/src/pytest_docker/plugin.py
Line 79 in 567fa09
endpoint = output.strip().decode("utf-8")
Affected Version: at least since 0.10.3
I use PyCharm on Windows 10 to debug my pytest test cases. Starting the conatiners the above line is executed to to resolve a port for a service.
output = self._docker_compose.execute("port %s %d" % (service, container_port))
results to b'0.0.0.0:12347\r\n\x1b[0m'. No control character is removed. Hence,output.strip().decode("utf-8")
result to s string including the control characters.Some lines later (L86)
if len(endpoint.split("\n")) > 1:
does not support windows line endings.On Linux or Git Bash for Windows, there is no problem.
My fix for that. Please check this solution:
The text was updated successfully, but these errors were encountered: