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

tagMap, typeMap no longer exist in pyasn1 #981

Open
AaronAmex opened this issue Aug 23, 2021 · 4 comments
Open

tagMap, typeMap no longer exist in pyasn1 #981

AaronAmex opened this issue Aug 23, 2021 · 4 comments

Comments

@AaronAmex
Copy link

These have been gone for about 4 years from that library. Unfortunately, this means ldap3 cannot be used with python3, since this was also when pyasn1 became python3 friendly as well. (modified stack trace below to take out the full path for privacy reasons)

File "ldap3/init.py", line 141, in
from .core.connection import Connection
File "ldap3/core/connection.py", line 38, in
from ..extend import ExtendedOperationsRoot
File "ldap3/extend/init.py", line 29, in
from .microsoft.dirSync import DirSync
File "ldap3/extend/microsoft/dirSync.py", line 27, in
from ...protocol.microsoft import dir_sync_control, extended_dn_control, show_deleted_control
File "ldap3/protocol/microsoft.py", line 32, in
from .controls import build_control
File "ldap3/protocol/controls.py", line 27, in
from ..utils.asn1 import encode
File "ldap3/utils/asn1.py", line 50, in
from pyasn1.codec.ber.encoder import tagMap, typeMap, AbstractItemEncoder

@zorn96
Copy link
Collaborator

zorn96 commented Aug 30, 2021

hi @AaronAmex ! could you clarify what you mean?
when the latest version of pyasn1 is downloaded from pypi, those seem to still exist
https://pypi.org/project/pyasn1/

Collecting pyasn1
  Using cached pyasn1-0.4.8-py2.py3-none-any.whl (77 kB)
Installing collected packages: pyasn1
Successfully installed pyasn1-0.4.8
(venv) azariazornberg@Azarias-MacBook-Pro scratch % python
Python 3.8.7 (default, Feb 26 2021, 17:39:13) 
[Clang 12.0.0 (clang-1200.0.32.29)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from pyasn1.codec.ber.encoder import tagMap, typeMap
>>> quit()

could you please clarify what version of python you're using? and what version of pyasn1? you can get the latter using
pip freeze | grep pyasn1

@AaronAmex
Copy link
Author

AaronAmex commented Aug 30, 2021

Sorry, I should have said 2 years! Don't know how I got the date wrong, but the breaking change is here (version 0.5.0):
etingof/pyasn1@93e11a2#diff-44ba4d6c194902a9eab1816c099062f83c043c4aee9f9fb1117a0fd2737d69eb

@zorn96
Copy link
Collaborator

zorn96 commented Aug 30, 2021

it looks like 0.5.0 does contain a breaking change. but it also looks like 0.5.0 hasn't actually been released yet.

so even though the breaking change was 2 years ago, it wasn't released and nothing should be actively broken. for you to be encountering an error, it means that you're installing pyasn1 from source and using the unreleased head of the master branch (or something close to it) - is that correct?

@AaronAmex
Copy link
Author

correct. I don't have access to pip in our production environments. So the generic approach is to install from source. Sounds like I should be using version 0.4.8 instead, which I can. At the least, you now know about breaking changes in "upcoming" releases (although I think a simple ping to pyasn author to release to pip would be a good idea, in which case these changes become more important). On another note, I'll submit another "issue" which has come up with a python3 compatibility scan on this library. There are certain changes which seem to not be python3 (although I looked into them and they still "work", but they are not the "proper" ports, so it's worth considering changing them).

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

2 participants