#50639 Issue 50638 - RecursionError: maximum recursion depth exceeded while calling a Python object
Closed by spichugi. Opened by vashirov.
vashirov/389-ds-base ds50638  into  master

Download 50639.patch

Bug Description:

DSLdapObject has an overridden __getattr__ method. In case the requested
attribute doesn't exist, getattr() goes into an infitite recursive loop,
only to be interrupted by a RecursionError exception.

rename() method has one such lookup for a non-existent attribute,
and it's not used at all.

Fix Description:

  • Restore the default behaviour of getattr() when attribute doesn't exist.
  • Remove unneeded attribute lookup in rename().

Fixes: https://pagure.io/389-ds-base/issue/50638

Reviewed by: ???

rebased onto 9baede80e19f62c65efc860b358a3c39ac6bc0da

rebased onto d0914df7c6ca0c5bdbcb2a83a0b3e1f3384a5928

rebased onto 39670bb258aceb1986e37793d514d0f2c77156bb

I think this isn't part of the fix, this is still needed.

What’s the purpose of it? AFAICT, it’s not used anywhere.

Previously it would be set to None, with latest master it goes into recursion to look it up and fails. With the other part of this change it would return AttributeError.

IIRC there are some types that do set the _basedn, but I need to check this.

The recursion really is coming from the getattr() call, so that's all you need to remove here IMO.

Please check, because I can’t find any other references to search_base variable. It’s only set in rename(), but not used/read.

Okay, was confused, I can't see it either, so get rid of it. Ack

rebased onto 1ac740761588600939d4fba31740227780022bb9

Thanks!

Pull-Request has been merged by vashirov

389-ds-base is moving from Pagure to Github. This means that new issues and pull requests
will be accepted only in 389-ds-base's github repository.

This pull request has been cloned to Github as issue and is available here:
- https://github.com/389ds/389-ds-base/issues/3694

If you want to continue to work on the PR, please navigate to the github issue,
download the patch from the attachments and file a new pull request.

Thank you for understanding. We apologize for all inconvenience.

Pull-Request has been closed by spichugi

Metadata