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

msp.py 'unicode' object has no attribute Error #8

Open
xrivendell7 opened this issue Oct 17, 2018 · 3 comments
Open

msp.py 'unicode' object has no attribute Error #8

xrivendell7 opened this issue Oct 17, 2018 · 3 comments

Comments

@xrivendell7
Copy link

$ python main.py
Traceback (most recent call last):
  File "main.py", line 44, in <module>
    main()
  File "main.py", line 31, in main
    ctxt = cpabe.encrypt(pk, msg, policy_str)
  File "/Users/apple/Competion/Cryptology2018/ABE/ac17.py", line 152, in encrypt
    policy = self.util.createPolicy(policy_str)
  File "/Users/apple/Competion/Cryptology2018/ABE/msp.py", line 32, in createPolicy
    policy_obj = parser.parse(policy_string)
  File "/Library/Python/2.7/site-packages/charm/toolbox/policytree.py", line 83, in parse
    self.finalPol.parseString(string)
  File "/Library/Python/2.7/site-packages/pyparsing.py", line 1622, in parseString
    loc, tokens = self._parse( instring, 0 )
  File "/Library/Python/2.7/site-packages/pyparsing.py", line 1379, in _parseNoCache
    loc,tokens = self.parseImpl( instring, preloc, doActions )
  File "/Library/Python/2.7/site-packages/pyparsing.py", line 3717, in parseImpl
    return self.expr._parse( instring, loc, doActions, callPreParse=False )
  File "/Library/Python/2.7/site-packages/pyparsing.py", line 1379, in _parseNoCache
    loc,tokens = self.parseImpl( instring, preloc, doActions )
  File "/Library/Python/2.7/site-packages/pyparsing.py", line 3378, in parseImpl
    loc, resultlist = self.exprs[0]._parse( instring, loc, doActions, callPreParse=False )
  File "/Library/Python/2.7/site-packages/pyparsing.py", line 1379, in _parseNoCache
    loc,tokens = self.parseImpl( instring, preloc, doActions )
  File "/Library/Python/2.7/site-packages/pyparsing.py", line 3530, in parseImpl
    ret = e._parse( instring, loc, doActions )
  File "/Library/Python/2.7/site-packages/pyparsing.py", line 1379, in _parseNoCache
    loc,tokens = self.parseImpl( instring, preloc, doActions )
  File "/Library/Python/2.7/site-packages/pyparsing.py", line 3395, in parseImpl
    loc, exprtokens = e._parse( instring, loc, doActions )
  File "/Library/Python/2.7/site-packages/pyparsing.py", line 1379, in _parseNoCache
    loc,tokens = self.parseImpl( instring, preloc, doActions )
  File "/Library/Python/2.7/site-packages/pyparsing.py", line 3717, in parseImpl
    return self.expr._parse( instring, loc, doActions, callPreParse=False )
  File "/Library/Python/2.7/site-packages/pyparsing.py", line 1379, in _parseNoCache
    loc,tokens = self.parseImpl( instring, preloc, doActions )
  File "/Library/Python/2.7/site-packages/pyparsing.py", line 3378, in parseImpl
    loc, resultlist = self.exprs[0]._parse( instring, loc, doActions, callPreParse=False )
  File "/Library/Python/2.7/site-packages/pyparsing.py", line 1379, in _parseNoCache
    loc,tokens = self.parseImpl( instring, preloc, doActions )
  File "/Library/Python/2.7/site-packages/pyparsing.py", line 3530, in parseImpl
    ret = e._parse( instring, loc, doActions )
  File "/Library/Python/2.7/site-packages/pyparsing.py", line 1379, in _parseNoCache
    loc,tokens = self.parseImpl( instring, preloc, doActions )
  File "/Library/Python/2.7/site-packages/pyparsing.py", line 3395, in parseImpl
    loc, exprtokens = e._parse( instring, loc, doActions )
  File "/Library/Python/2.7/site-packages/pyparsing.py", line 1379, in _parseNoCache
    loc,tokens = self.parseImpl( instring, preloc, doActions )
  File "/Library/Python/2.7/site-packages/pyparsing.py", line 3717, in parseImpl
    return self.expr._parse( instring, loc, doActions, callPreParse=False )
  File "/Library/Python/2.7/site-packages/pyparsing.py", line 1379, in _parseNoCache
    loc,tokens = self.parseImpl( instring, preloc, doActions )
  File "/Library/Python/2.7/site-packages/pyparsing.py", line 3378, in parseImpl
    loc, resultlist = self.exprs[0]._parse( instring, loc, doActions, callPreParse=False )
  File "/Library/Python/2.7/site-packages/pyparsing.py", line 1379, in _parseNoCache
    loc,tokens = self.parseImpl( instring, preloc, doActions )
  File "/Library/Python/2.7/site-packages/pyparsing.py", line 3530, in parseImpl
    ret = e._parse( instring, loc, doActions )
  File "/Library/Python/2.7/site-packages/pyparsing.py", line 1379, in _parseNoCache
    loc,tokens = self.parseImpl( instring, preloc, doActions )
  File "/Library/Python/2.7/site-packages/pyparsing.py", line 3530, in parseImpl
    ret = e._parse( instring, loc, doActions )
  File "/Library/Python/2.7/site-packages/pyparsing.py", line 1405, in _parseNoCache
    tokens = fn( instring, tokensStart, retTokens )
  File "/Library/Python/2.7/site-packages/pyparsing.py", line 1049, in wrapper
    ret = func(*args[limit[0]:])
  File "/Library/Python/2.7/site-packages/charm/toolbox/policytree.py", line 15, in createAttribute
    return BinNode(toks[0]) # create
  File "/Library/Python/2.7/site-packages/charm/toolbox/node.py", line 26, in __init__
    elif(value >= OpType.OR and value < OpType.NONE):
  File "/Library/Python/2.7/site-packages/charm/toolbox/enum.py", line 29, in __le__
    return (self.__value <= other.__value)
AttributeError: 'unicode' object has no attribute '_EnumValue__value'

I follow your advice to install Charm in my MacOs, python is the system's default python 2.7.10 ,But meet this Error,Please Help......

@xrivendell7
Copy link
Author

@sagrawal87

@sagrawal87
Copy link
Owner

Hi @TacXingXing, Were you able to resolve this issue?

@scmanjarrez
Copy link

Did you resolve the issue @0xTac? I just commented those lines (unicode is equivalent to str in python3)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants