-
Notifications
You must be signed in to change notification settings - Fork 41
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
KeyError EXTERNAL #66
Comments
Is that all you see, or do you also get a python traceback? |
I get the traceback, I'll provide it:
Found more official definition file at ftp://ftp.loc.gov/pub/z3950/official/asn1.txt, no copy and paste. |
This section of RFC 3641 shows that EXTERNAL is a built-in ASN1 type. I wish they'd repeated the definition rather than referring to X.690. I think I can lift the definition of EXTERNAL from there, and compile it along with the rest of the definitions. |
So, https://www.obj-sys.com/asn1tutorial/node16.html very usefully provides this schema for external:
As a work-around, I will directly add this to my ASN file and try to compile to pyasn1 again. However, EXTERNAL is clearly a basic type supported by the spec and should be supported by asn1ate. |
Most of asn1ate is based on X.680 and this is actually mentioned in clause 37. I hadn't seen that before, and we don't yet have any handling of such "well-known" types in asn1ate. I think it would need to be introduced as a builtin type with a special sema node so code generators could produce the structure you showed above (or the X.680 equivalent). I'm not sure if/when I'll find time to do so, so any contributions are welcome here. |
X.860 is interesting reading. I last dealt with binary encoding rules with XDR and a version of rpcgen that compiled ONC RPC's idl into json encoding. I'm surprised to see that ASN.1 is actually a much more recent and modern standard, relatively. That makes it more complicated, but I ought to be capable of learning it given time. That said, I spend much of my time encouraging web developers to follow basic software engineering precepts such as to use the build system to do builds, and to check in only the stuff needed to build (i.e. an ASN1 file, rather than its pyasn1 equivalent python) - not in my current role. This is a project on my own anyway; I just find it a bit of an afront that there isn't a good Python 3 z39.50 implementation. |
I'm trying to process the z3950 1995 asn spec using asn1ate, because I'm trying to revive the module PyZ3950 which implemented its own asn1 encoder/decoder, and I need to get good data before I choose to replace with pyasn1 and asn1ate.
The file https://github.com/danizen/PyZ3950/blob/master/z3950_asn/z3950_1995.asn holds the asn I am trying to parse, and I worked through problems where copy and paste from https://www.loc.gov/z3950/agency/asn1.html to that file failed, e.g. comments broken onto multiple lines.
Now that I've done that, I think it gets through parsing the file, but when it goes to export the pyasn1 schemas, it outputs this:
KeyError: 'EXTERNAL'
I understand its looking for that in a dict, but how can I address this?
The text was updated successfully, but these errors were encountered: