Skip to content

Oracledb thin mode:: object of type 'bool' has no len()] #119

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

Closed
ivba7 opened this issue Jan 3, 2023 · 7 comments
Closed

Oracledb thin mode:: object of type 'bool' has no len()] #119

ivba7 opened this issue Jan 3, 2023 · 7 comments
Labels
bug Something isn't working patch available

Comments

@ivba7
Copy link

ivba7 commented Jan 3, 2023

Hi, when calling function:

some_out_var = cur.var(str)
result = cur.callfunc('some_test_func',
                                  bool,
                                  ['param1', False, some_out_var])

there is error:

Traceback (most recent call last):
File "/home/r432107/myenv38/lib64/python3.8/site-packages/oracledb/cursor.py", line 261, in callfunc
self._call(name, parameters, keyword_parameters, var)
File "/home/r432107/myenv38/lib64/python3.8/site-packages/oracledb/cursor.py", line 116, in _call
self.execute(statement, bind_values)
File "/home/r432107/myenv38/lib64/python3.8/site-packages/oracledb/cursor.py", line 378, in execute
impl.execute(self)
File "src/oracledb/impl/thin/cursor.pyx", line 133, in oracledb.thin_impl.ThinCursorImpl.execute
File "src/oracledb/impl/thin/protocol.pyx", line 383, in oracledb.thin_impl.Protocol._process_single_message
File "src/oracledb/impl/thin/protocol.pyx", line 384, in oracledb.thin_impl.Protocol._process_single_message
File "src/oracledb/impl/thin/protocol.pyx", line 344, in oracledb.thin_impl.Protocol._process_message
File "src/oracledb/impl/thin/protocol.pyx", line 323, in oracledb.thin_impl.Protocol._process_message
File "src/oracledb/impl/thin/messages.pyx", line 282, in oracledb.thin_impl.Message.process
File "src/oracledb/impl/thin/messages.pyx", line 818, in oracledb.thin_impl.MessageWithData._process_message
File "src/oracledb/impl/thin/messages.pyx", line 898, in oracledb.thin_impl.MessageWithData._process_row_data
File "src/oracledb/impl/thin/messages.pyx", line 622, in oracledb.thin_impl.MessageWithData._process_column_data
TypeError: object of type 'bool' has no len()

using oracledb 1.2.1

@ivba7 ivba7 added the bug Something isn't working label Jan 3, 2023
@anthony-tuininga
Copy link
Member

I am able to replicate your issue. It appears to happen when a null value is returned from the function instead of a True or False value. I'll look into it further and get back to you with a solution once I have it.

@anthony-tuininga
Copy link
Member

I have pushed a patch that should correct this issue and added a relevant test case. If you are able to build from source you can verify that it corrects your issue as well.

@ivba7
Copy link
Author

ivba7 commented Jan 18, 2023

Hi,
problem still persists:
oracledb.version: 1.3.0b1

File "src/oracledb/impl/thin/cursor.pyx", line 137, in oracledb.thin_impl.ThinCursorImpl.execute
File "src/oracledb/impl/thin/protocol.pyx", line 383, in oracledb.thin_impl.Protocol._process_single_message
File "src/oracledb/impl/thin/protocol.pyx", line 384, in oracledb.thin_impl.Protocol._process_single_message
File "src/oracledb/impl/thin/protocol.pyx", line 344, in oracledb.thin_impl.Protocol._process_message
File "src/oracledb/impl/thin/protocol.pyx", line 323, in oracledb.thin_impl.Protocol._process_message
File "src/oracledb/impl/thin/messages.pyx", line 282, in oracledb.thin_impl.Message.process
File "src/oracledb/impl/thin/messages.pyx", line 821, in oracledb.thin_impl.MessageWithData._process_message
File "src/oracledb/impl/thin/messages.pyx", line 901, in oracledb.thin_impl.MessageWithData._process_row_data
File "src/oracledb/impl/thin/messages.pyx", line 624, in oracledb.thin_impl.MessageWithData._process_column_data
TypeError: object of type 'bool' has no len()

@anthony-tuininga
Copy link
Member

That suggests you haven't built with the patch applied? Perhaps confirm that you have the right code and then adjust the value in src/oracledb/version.py to include a different value to ensure that indeed you have built with the patch applied. If that is indeed the case, please provide a complete test case (procedure you are using, complete Python code you are using). Thanks!

@anthony-tuininga
Copy link
Member

I've created a branch (v1.2.x) which contains what is going to be included in version 1.2.2 (including this bug). Can you try with that branch? The version number should say 1.2.2.

anthony-tuininga added a commit that referenced this issue Jan 18, 2023
@anthony-tuininga
Copy link
Member

A colleague of mine was able to replicate the problem after my patch so I was able to find another situation where it occurred. That has just been fixed, too. Hopefully that also resolves your issue! The patch is currently on the v1.2.x branch but it will go on main as well shortly.

anthony-tuininga added a commit that referenced this issue Jan 18, 2023
@anthony-tuininga
Copy link
Member

The patches are now in version 1.2.2 which was just released. Please re-open if you still have issues. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working patch available
Projects
None yet
Development

No branches or pull requests

2 participants