Skip to content

Fix "strip()" bug when internal IP is None#1434

Merged
tvst merged 2 commits intostreamlit:developfrom
tvst:fix-strip
May 12, 2020
Merged

Fix "strip()" bug when internal IP is None#1434
tvst merged 2 commits intostreamlit:developfrom
tvst:fix-strip

Conversation

@tvst
Copy link
Copy Markdown
Contributor

@tvst tvst commented May 11, 2020

Fixes #554

@tvst tvst requested a review from jrhone May 11, 2020 08:37
@tvst tvst requested a review from a team as a code owner May 11, 2020 08:37
@jrhone
Copy link
Copy Markdown
Contributor

jrhone commented May 11, 2020

Based on this comment, it's possible for net_util.get_external_ip() to return a str that is not an ip address.

Looks like it should be handled in your PR as well.

@tvst
Copy link
Copy Markdown
Contributor Author

tvst commented May 12, 2020

Fine, fine! Fixed it now 😄

)
else:
_external_ip = response.strip()
_external_ip = None
Copy link
Copy Markdown
Contributor

@jrhone jrhone May 12, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if we need this line since _external_ip is initialized to None above the function and if it ever has a value we won't get here.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know. I just thought this was more readable. It makes it absolutely clear what the value _external_ip will be. You don't have to read the whole function to understand it.

@jrhone
Copy link
Copy Markdown
Contributor

jrhone commented May 12, 2020

Fine, fine! Fixed it now 😄

Nice!

@tvst tvst merged commit d9061b4 into streamlit:develop May 12, 2020
@tvst tvst deleted the fix-strip branch May 12, 2020 19:51
tconkling added a commit that referenced this pull request May 18, 2020
* develop:
  Keras model hash func (#1450)
  Add support for st.echo("below") to print echoed text below the Streamlit output (#1452)
  Update 3.5 references to 3.6 (#1444)
  PyTorch model hash func (#1445)
  Fix link for pipenv in Getting Started (#1455)
  TextArea and TextInput max_chars (#1423)
  Fix multiselect docstring example (#1442)
  Configuring ReadtheDocs (#1435)
  Fix "strip()" bug when internal IP is None (#1434)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

EXCEPTION! 'NoneType' object has no attribute 'strip'

3 participants