Skip to content

Commit

Permalink
Support get_data with unicode path. DEVTOOLSUP-7958
Browse files Browse the repository at this point in the history
Needed for resource_string in plotly:
https://a.yandex-team.ru/arc/trunk/arcadia/contrib/python/plotly/plotly/offline/offline.py?rev=3840383#L41

ref:5a24071f161033d06598e5b2a2ff62dfaa28ea14
  • Loading branch information
orivej committed Feb 18, 2019
1 parent d273353 commit 6c813bd
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions library/python/runtime_py3/importer.pxi
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,8 @@ class ResourceImporter(object):

# PEP-302 extension 1 of 3: data loader.
def get_data(self, path):
if isinstance(path, str):
path = utf_8_encode(path)[0]
data = resfs_read(path)
if data is None:
raise IOError
Expand Down

0 comments on commit 6c813bd

Please sign in to comment.