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

0.4.1: AttributeError: 'tuple' object has no attribute 'tagClass' #106

Closed
reox opened this issue Nov 23, 2017 · 4 comments
Closed

0.4.1: AttributeError: 'tuple' object has no attribute 'tagClass' #106

reox opened this issue Nov 23, 2017 · 4 comments
Labels

Comments

@reox
Copy link

reox commented Nov 23, 2017

Again some issues with my certificate parsing. You can use the same code from #67

Traceback (most recent call last):
  File "certtest.py", line 10, in <module>
    cert = encode(message[1][3])
  File "/home/vagrant/.local/lib/python3.5/site-packages/pyasn1/codec/ber/encoder.py", line 636, in __call__
    substrate = concreteEncoder.encode(value, asn1Spec, self, **options)
  File "/home/vagrant/.local/lib/python3.5/site-packages/pyasn1/codec/ber/encoder.py", line 85, in encode
    value, asn1Spec, encodeFun, **options
  File "/home/vagrant/.local/lib/python3.5/site-packages/pyasn1/codec/ber/encoder.py", line 423, in encodeValue
    chunk = encodeFun(component, asn1Spec, **options)
  File "/home/vagrant/.local/lib/python3.5/site-packages/pyasn1/codec/ber/encoder.py", line 636, in __call__
    substrate = concreteEncoder.encode(value, asn1Spec, self, **options)
  File "/home/vagrant/.local/lib/python3.5/site-packages/pyasn1/codec/ber/encoder.py", line 85, in encode
    value, asn1Spec, encodeFun, **options
  File "/home/vagrant/.local/lib/python3.5/site-packages/pyasn1/codec/ber/encoder.py", line 423, in encodeValue
    chunk = encodeFun(component, asn1Spec, **options)
  File "/home/vagrant/.local/lib/python3.5/site-packages/pyasn1/codec/ber/encoder.py", line 636, in __call__
    substrate = concreteEncoder.encode(value, asn1Spec, self, **options)
  File "/home/vagrant/.local/lib/python3.5/site-packages/pyasn1/codec/ber/encoder.py", line 85, in encode
    value, asn1Spec, encodeFun, **options
  File "/home/vagrant/.local/lib/python3.5/site-packages/pyasn1/codec/cer/encoder.py", line 215, in encodeValue
    substrate += encodeFun(value[idx], asn1Spec, **options)
  File "/home/vagrant/.local/lib/python3.5/site-packages/pyasn1/codec/ber/encoder.py", line 636, in __call__
    substrate = concreteEncoder.encode(value, asn1Spec, self, **options)
  File "/home/vagrant/.local/lib/python3.5/site-packages/pyasn1/codec/ber/encoder.py", line 85, in encode
    value, asn1Spec, encodeFun, **options
  File "/home/vagrant/.local/lib/python3.5/site-packages/pyasn1/codec/cer/encoder.py", line 179, in encodeValue
    for x in value]
  File "/home/vagrant/.local/lib/python3.5/site-packages/pyasn1/codec/cer/encoder.py", line 179, in <listcomp>
    for x in value]
  File "/home/vagrant/.local/lib/python3.5/site-packages/pyasn1/codec/ber/encoder.py", line 636, in __call__
    substrate = concreteEncoder.encode(value, asn1Spec, self, **options)
  File "/home/vagrant/.local/lib/python3.5/site-packages/pyasn1/codec/ber/encoder.py", line 85, in encode
    value, asn1Spec, encodeFun, **options
  File "/home/vagrant/.local/lib/python3.5/site-packages/pyasn1/codec/ber/encoder.py", line 423, in encodeValue
    chunk = encodeFun(component, asn1Spec, **options)
  File "/home/vagrant/.local/lib/python3.5/site-packages/pyasn1/codec/ber/encoder.py", line 636, in __call__
    substrate = concreteEncoder.encode(value, asn1Spec, self, **options)
  File "/home/vagrant/.local/lib/python3.5/site-packages/pyasn1/codec/ber/encoder.py", line 85, in encode
    value, asn1Spec, encodeFun, **options
  File "/home/vagrant/.local/lib/python3.5/site-packages/pyasn1/codec/ber/encoder.py", line 182, in encodeValue
    asn1Spec = value.clone(tagSet=tag.TagSet(tagSet.baseTag, tagSet.baseTag))
  File "/home/vagrant/.local/lib/python3.5/site-packages/pyasn1/type/tag.py", line 189, in __init__
    [(superTag.tagClass, superTag.tagId) for superTag in superTags]
  File "/home/vagrant/.local/lib/python3.5/site-packages/pyasn1/type/tag.py", line 189, in <listcomp>
    [(superTag.tagClass, superTag.tagId) for superTag in superTags]
AttributeError: 'tuple' object has no attribute 'tagClass'

This error happens since 10 minutes ago as 0.4.1 was published to pypi. In 0.3.7 everything was working,

@etingof
Copy link
Owner

etingof commented Nov 23, 2017

Thank you for the heads up!

Could you please try this fix?

@reox
Copy link
Author

reox commented Nov 23, 2017

Works for me!

@etingof
Copy link
Owner

etingof commented Nov 23, 2017

I've refactored the fix published it as 0.4.2. I am not quite satisfied with it so I will probably rework it later.

But it should hopefully fix your immediate problem. Does it?

@reox
Copy link
Author

reox commented Nov 24, 2017

I upgraded to 0.4.2 and it works fine! thanks a lot!

@etingof etingof closed this as completed Nov 24, 2017
@etingof etingof added the bug label Nov 24, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants