-
Notifications
You must be signed in to change notification settings - Fork 163
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
On Windows thrift files don't get picked up properly, combined issue with ThriftPY #148
Comments
ErKatz
added a commit
to ErKatz/thriftpy
that referenced
this issue
Dec 6, 2016
Full explanation is here : Thriftpy#269 and here : python-happybase/happybase#148
ErKatz
added a commit
to ErKatz/happybase
that referenced
this issue
Dec 6, 2016
On non-Windows systems: things stay as they are On windows system: it would pass the path to the thrift file with "file://" scheme. If ThriftPY is fixed to handle the 'file' scheme - things would work on windows. Until then, things will stay broken, as they are now. This is further discussed here: python-happybase#148 and here: Thriftpy/thriftpy#269 NOTE: I created a corresponding fork and pull request on thrifypy as well: Thriftpy/thriftpy#270
Closed
this seems something specific to |
Modify the parser code in the windows side. Go to your python installation folder's site packages (...\Lib\site-packages\thriftpy\parser.py) and then make changes in line no. 488 where you get this line
and change this to: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is related to this issue in ThriftPY
On windows, I get the following error:
Traceback (most recent call last):
File "C:/Users/Erez.Katz/PycharmProjects/UserSeg/GetData.py", line 1, in
import happybase
File "C:\Users\Erez.Katz\UserSegmentation\lib\site-packages\happybase_init_.py", line 11, in
'Hbase_thrift')
File "C:\Users\Erez.Katz\UserSegmentation\lib\site-packages\thriftpy\parser_init_.py", line 30, in load
include_dir=include_dir)
File "C:\Users\Erez.Katz\UserSegmentation\lib\site-packages\thriftpy\parser\parser.py", line 499, in parse
url_scheme))
thriftpy.parser.exc.ThriftParserError: ThriftPy does not support generating module with path in protocol 'c'
'c' is recognized as the url scheme for the path
'C:\Users\JLPicard\UserSegmentation\lib\site-packages\happybase\Hbase.thrift'
This is also caused by this issue:
Thriftpy/thriftpy#269
My current workaround in the
happybase\\__init__.py
and it is combined with the workaround suggested in Thriftpy/thriftpy#269 :``
import platform
if platform.system()=="Windows":
_thriftpy.load(
'file://'+_pkg_resources.resource_filename('happybase', 'Hbase.thrift'),
'Hbase_thrift')
else:
_thriftpy.load(
_pkg_resources.resource_filename('happybase', 'Hbase.thrift'),
'Hbase_thrift')
``
The fix is localized to Windows only because ThriftPy currently does not handle the "file" scheme and just throws an exception when it encounters it.
The text was updated successfully, but these errors were encountered: