Skip to content
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

Workaround socket library import issue. #601

Merged
merged 4 commits into from
Jul 16, 2019

Conversation

winterfroststrom
Copy link
Contributor

@winterfroststrom winterfroststrom commented Jul 13, 2019

This change is Reviewable

try:
import encodings.idna
except ImportError:
# Supposedly, some verions of Python (e.g. IronPython) do not support the
Copy link
Collaborator

Choose a reason for hiding this comment

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

not really "versions"? more like implementations or flavors?

@@ -41,6 +41,17 @@

from builtins import str

# Apparently, the Python `socket` library's call to `import encodings.idna` via
# `socket.create_connection` via `socket.getaddrinfo` is not thread-safe in
# embeded Python environments. So, pre-emptively import and cache the encoder.
Copy link
Collaborator

Choose a reason for hiding this comment

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

"embedded"?

@@ -41,6 +41,17 @@

from builtins import str

# Apparently, the Python `socket` library's call to `import encodings.idna` via
# `socket.create_connection` via `socket.getaddrinfo` is not thread-safe in
Copy link
Collaborator

Choose a reason for hiding this comment

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

two "via" chained together?
rephrase a bit? or simply shorten?

Copy link
Contributor Author

@winterfroststrom winterfroststrom left a comment

Choose a reason for hiding this comment

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

Reviewable status: 0 of 1 files reviewed, 3 unresolved discussions (waiting on @winterfroststrom and @xpconanfan)


mobly/controllers/android_device_lib/jsonrpc_client_base.py, line 45 at r1 (raw file):

Previously, xpconanfan (Ang Li) wrote…

two "via" chained together?
rephrase a bit? or simply shorten?

changed


mobly/controllers/android_device_lib/jsonrpc_client_base.py, line 46 at r1 (raw file):

Previously, xpconanfan (Ang Li) wrote…

"embedded"?

Done.


mobly/controllers/android_device_lib/jsonrpc_client_base.py, line 51 at r1 (raw file):

Previously, xpconanfan (Ang Li) wrote…

not really "versions"? more like implementations or flavors?

Done.

Copy link
Collaborator

@xpconanfan xpconanfan left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewable status: 0 of 1 files reviewed, 1 unresolved discussion (waiting on @winterfroststrom)


mobly/controllers/android_device_lib/jsonrpc_client_base.py, line 52 at r2 (raw file):

    import encodings.idna
except ImportError:
    # Supposedly, some implementations of Python (e.g. IronPython) do not support

Why "supposedly"? remove?

Copy link
Contributor Author

@winterfroststrom winterfroststrom left a comment

Choose a reason for hiding this comment

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

Reviewable status: 0 of 1 files reviewed, 1 unresolved discussion (waiting on @winterfroststrom and @xpconanfan)


mobly/controllers/android_device_lib/jsonrpc_client_base.py, line 52 at r2 (raw file):

Previously, xpconanfan (Ang Li) wrote…

Why "supposedly"? remove?

Done.

@winterfroststrom winterfroststrom merged commit b265876 into google:master Jul 16, 2019
@winterfroststrom winterfroststrom deleted the idna_import branch September 13, 2019 02:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants