Skip to content

Fix TypeError in compare_s, test and document error behavior#271

Merged
encukou merged 2 commits into
python-ldap:masterfrom
tiran:issue270-compare-format
May 24, 2019
Merged

Fix TypeError in compare_s, test and document error behavior#271
encukou merged 2 commits into
python-ldap:masterfrom
tiran:issue270-compare-format

Conversation

@tiran
Copy link
Copy Markdown
Member

@tiran tiran commented Mar 21, 2019

Fix string formatting in compare_ext_s

Pass (ldap_res,) tuple to string formatting instead of ldap_res.
This changes fixes TypeError: not all arguments converted during string formatting.

Fixes: #270

Test and document compare_s error cases

compare_s() may fail with an exception in case the DN is not found or the user searches for an unspecified attribute.

tiran added 2 commits March 21, 2019 12:27
Pass ``(ldap_res,)`` tuple to string formatting instead of ``ldap_res``.
This changes fixes ``TypeError: not all arguments converted during string
formatting``.

Fixes: python-ldap#270
Signed-off-by: Christian Heimes <cheimes@redhat.com>
compare_s() may fail with an exception in case the DN is not found or
the user searches for an unspecified attribute.

Signed-off-by: Christian Heimes <cheimes@redhat.com>
@tiran tiran requested a review from encukou March 21, 2019 11:32
@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 21, 2019

Codecov Report

Merging #271 into master will not change coverage.
The diff coverage is n/a.

@@          Coverage Diff           @@
##           master    #271   +/-   ##
======================================
  Coverage    71.1%   71.1%           
======================================
  Files          49      49           
  Lines        4818    4818           
  Branches      812     812           
======================================
  Hits         3426    3426           
- Misses       1056    1057    +1     
+ Partials      336     335    -1
Impacted Files Coverage Δ
Lib/ldap/ldapobject.py 76.38% <ø> (ø) ⬆️
Lib/ldap/controls/deref.py 57.14% <0%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update adf4761...a9bb1dd. Read the comment docs.

@encukou encukou merged commit 1d373da into python-ldap:master May 24, 2019
@tiran tiran added this to the 3.3 milestone May 27, 2020
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

Successfully merging this pull request may close these issues.

Invalid string formatting in compare_ext_s

2 participants