Skip to content

connection.py:397, write_binary_str, 'NoneType' object has no attribute 'encode' #48

@jovezhong

Description

@jovezhong

While I am testing the dbt plugin, I hit the issue in proton_driver/connection.py:397: in send_hello

/Users/jove/Dev/py310-dbt18-env/lib/python3.10/site-packages/proton_driver/connection.py:397: in send_hello
    write_binary_str(self.database, self.fout)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

text = None, buf = <proton_driver.bufferedwriter.BufferedSocketWriter object at 0x121f2dcb0>

    def write_binary_str(text, buf):
>       text = text.encode('utf-8')
E       AttributeError: 'NoneType' object has no attribute 'encode'

/Users/jove/Dev/py310-dbt18-env/lib/python3.10/site-packages/proton_driver/writer.py:15: AttributeError

I tried both Python 3.10 and 3.12, both 0.2.8 and 0.2.10. This can be reproduced with pytest --log-cli-level=DEBUG tests/functional/test_proton.py in the dbt-proton repo. But I will try to extract it and reproduce this without dbt.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions