tlocke / pg8000

A Pure-Python PostgreSQL Driver
BSD 3-Clause "New" or "Revised" License
515 stars 46 forks source link

TypeError: 'NoneType' object is not iterable #83

Closed carlkidcrypto closed 3 years ago

carlkidcrypto commented 3 years ago

Hello There,

I am having an issue using the latest version of pg8000. I am on version 1.21.2. This is the error I am encountering: image

I tried downgrading to 1.20.0 and ran the same python 3 script. On 1.20.0 my script runs fine. I then tried 1.21.0 and 1.21.1. It also fails with the same error as 1.21.2. Has anything major changed since 1.20.0 ?

Let me know if more information is needed.

thanks!

tlocke commented 3 years ago

Hi @carlkid1499, thanks for reporting the bug. What would be really helpful is if you could provide a minimum reproducible example.

carlkidcrypto commented 3 years ago

With version 1.20.0 image

With version 1.21.2 image

This is the test script: test_pg8000.zip

System Information [My PC]: arch: x86_64 OS Name: Ubuntu 20.04.3 LTS OS Type: 64-bit

PSQL Server: PostgreSQL 12.8 (Ubuntu 12.8-0ubuntu0.20.04.1) on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0, 64-bit

tlocke commented 3 years ago

Thanks, I managed to reduce it even further to:

import pg8000

con = pg8000.connect(user="postgres", password="pw")

ps = con.prepare("ROLLBACK")
ps.run()

and it's now fixed in https://github.com/tlocke/pg8000/commit/b6afc494afdfb38ee13ac2468ee07045454eb83c