thriftpy
thriftpy copied to clipboard
Local .thrift file don't get picked up on Windows.
On windows when the path start with the "file://" scheme, I get the following error: (path is 'file://C:\Users\MrT\UserSegmentation\lib\site-packages\happybase\Hbase.thrift')
Traceback (most recent call last):
File "
workaround that I added in my environment in thriftpy\parser\parser.py", around starting at line 540
url_scheme = urlparse(path).scheme
if url_scheme == 'file':
with open(urlparse(path).netloc) as fh:
data = fh.read()
elif url_scheme == '':
with open(path) as fh:
data = fh.read()
elif url_scheme in ('http', 'https'):
data = urlopen(path).read()
else:
raise ThriftParserError('ThriftPy does not support generating module '
'with path in protocol \'{}\''.format(
url_scheme))
this also impacts https://github.com/wbolster/happybase/issues/148