forum.vmspython.org Forum Index forum.vmspython.org
Forum system
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Python 2.7.9 _ldap

 
Post new topic   Reply to topic    forum.vmspython.org Forum Index -> Python for OpenVMS
View previous topic :: View next topic  
Author Message
urs mantel



Joined: 02 Nov 2010
Posts: 16
Location: Switzerland

PostPosted: Wed Apr 20, 2016 9:31 pm    Post subject: Python 2.7.9 _ldap Reply with quote

Hello Jean-François,

an other problem emerged from LDAP

in ldap.controls were statements to import or return _ldap

LDA12:[python279.local.ldap.controls]__init__.py;1
import _ldap,ldap
******************************
LDA12:[python279.local.ldap.controls]libldap.py;1
import _ldap,ldap
return _ldap.encode_assertion_control(self.filterstr)
return _ldap.encode_valuesreturnfilter_control(self.filterstr)
return _ldap.encode_page_control(self.size,self.cookie)
self.size,self.cookie = _ldap.decode_page_control(encodedControlValue)

but _ldap can't be imported - it's not in the directory controls
I replaced every reference to _ldap with ldap._ldap

Now it works but I'm wondering if there is a better solution.

What's the logical python_module__ldap doing
from python_vms:logicals.com
$ define/nolog 'p1' python_module__ldap "python_root:[local.ldap]_ldap.exe"

Thanks

Urs
Back to top
View user's profile Send private message
jfp



Joined: 12 Jul 2004
Posts: 618

PostPosted: Thu Apr 21, 2016 6:12 am    Post subject: Reply with quote

Hello Urs,

A workaround is to edit python_root:[local.ldap.controls]libldap.py and python_root:[local.ldap.controls]__init__.py an replace

Code:
import _ldap,ldap


with

Code:
import ldap
from ldap import _ldap


I will release, probably next week, Python 2.7.11. So I will include the fix.

Thansk for reporting,

JF
Back to top
View user's profile Send private message Send e-mail Visit poster's website
jfp



Joined: 12 Jul 2004
Posts: 618

PostPosted: Thu Apr 21, 2016 6:23 am    Post subject: Re: Python 2.7.9 _ldap Reply with quote

urs mantel wrote:


What's the logical python_module__ldap doing
from python_vms:logicals.com
$ define/nolog 'p1' python_module__ldap "python_root:[local.ldap]_ldap.exe"


These logicals are use to import .exe module, format is PYTHON_MODULE_modulename

So if you do "import foo" you can have python_module_foo defined to provide the correct image.

This is useful when more than one module are packed together in one image.

JF
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    forum.vmspython.org Forum Index -> Python for OpenVMS All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group