-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Endpoint empty error #78
Comments
Looks like probably an escape character followed by a "reset color" shell sequence. AFAIU the underlying subprocess shouldn't be using any decorations you have in your shell. Does your docker setup have some kind of colored output plugin? |
I have run into the same issue. However, the problem is not with strip() but with following statement |
My proposal with proper exception handling would be something like this. ips = re.findall(r'[0-9]{1,3}(?:\.[0-9]{1,3}){3}:[0-9]{1,5}', endpoint)
if len(ips) == 0:
raise ValueError(f'Could not found any IP in endpoint {endpoint} for "{service}:{container_port}"')
if len(ips) > 1:
raise ValueError(f'Found more IPs ({",".join(ips)}) in endpoint {endpoint} for "{service}:{container_port}". '
f'Could not decided which port to use. ')
endpoint = ips[0] However, there could be a problem if this endpoint will be in format: |
I have the same problem on win10, getting some weird output on line 78 (b'\r\n\x1b[0m') |
I have created a pull request for this issue: |
On a windows system, the endpoint command returns a weird string:
0.0.0.0:9997\r\n�[0m
That's why the
strip
here does not change the string, and this line takes the garbage part. I have solved it by using a regexp:Do you think this is a possible solution that could be merged in?
The text was updated successfully, but these errors were encountered: