Skip to content

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xed in position 9: invalid continuation byte #501

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

Open
wanx4910 opened this issue Jun 2, 2025 · 1 comment
Labels
bug Something isn't working

Comments

@wanx4910
Copy link

wanx4910 commented Jun 2, 2025

Thank you for using python-oracledb.

See https://www.oracle.com/corporate/security-practices/assurance/vulnerability/reporting.html for how to report security issues

Please answer these questions so we can help you.

Use Markdown syntax, see https://docs.github.com/github/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax

-->

  1. What versions are you using?

Oracledb 3.1.1

Give your database version.

Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.25.0.0.0

Also run Python and show the output of:

import sys
import platform

print("platform.platform:", platform.platform())
print("sys.maxsize > 2**32:", sys.maxsize > 2**32)
print("platform.python_version:", platform.python_version())

And:

import oracledb
print("oracledb.__version__:", oracledb.__version__)

platform.platform: Windows-10-10.0.19045-SP0
sys.maxsize > 2**32: True
platform.python_version: 3.12.9
oracledb.version: 3.1.1

  1. Is it an error or a hang or a crash? No

  2. What error(s) or behavior you are seeing?

I get this error when I use SQLAlchemy and pandas to read data from an orcale sql db and the same result when I use oracledb to read data directly.

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xed in position 9: invalid continuation byte

Cut and paste text showing the command you ran. No screenshots.

Use a gist for long screen output and logs: see https://gist.github.com/

with connection.cursor() as cursor:
print(sql_cmd)
st = time.time()
cursor.execute(sql_cmd)
rows = cursor.fetchall()
print(f' Read from DB takes: {time.time() - st:.1f} secs, of len={len(rows)}')

df= pd.read_sql(sql_cmd, engine)

  1. Does your application call init_oracle_client()?

No

This tells us whether you are using the python-oracledb Thin or Thick mode.

Thin mode.

  1. Include a runnable Python script that shows the problem.
@wanx4910 wanx4910 added the bug Something isn't working label Jun 2, 2025
@cjbj
Copy link
Member

cjbj commented Jun 2, 2025

Thanks for the report. Can you:

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

No branches or pull requests

2 participants