Skip to content
This repository has been archived by the owner on Dec 10, 2018. It is now read-only.

thriftpy.load() can't accept unicode filename #279

Open
wooparadog opened this issue Feb 21, 2017 · 0 comments
Open

thriftpy.load() can't accept unicode filename #279

wooparadog opened this issue Feb 21, 2017 · 0 comments

Comments

@wooparadog
Copy link
Member

wooparadog commented Feb 21, 2017

how to reproduce

Python: 2.7

In [1]: import thriftpy

In [2]: thriftpy.load(u"note/note.thrift")
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-2-331150e98ce2> in <module>()
----> 1 thriftpy.load(u"note/note.thrift")

/Users/WooParadog/.virtualenvs/zeus_core/lib/python2.7/site-packages/thriftpy/parser/__init__.pyc in load(path, module_name, include_dirs, include_dir)
     28     real_module = bool(module_name)
     29     thrift = parse(path, module_name, include_dirs=include_dirs,
---> 30                    include_dir=include_dir)
     31
     32     if real_module:

/Users/WooParadog/.virtualenvs/zeus_core/lib/python2.7/site-packages/thriftpy/parser/parser.pyc in parse(path, module_name, include_dirs, include_dir, lexer, parser, enable_cache)
    504         module_name = os.path.splitext(basename)[0]
    505
--> 506     thrift = types.ModuleType(module_name)
    507     setattr(thrift, '__thrift_file__', path)
    508     thrift_stack.append(thrift)

TypeError: module.__init__() argument 1 must be string, not unicode
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant