julien-duponchelle / julien-duponchelle/python-mysql-replication
Graceful exit when connect to mysql whose bin-log is not enable
- Dominant language
- Python
- Stars
- 2.4k
- Forks
- 690
- PR merge metrics
- No merged PRs in 30d
Description
When connect to a mysql whose bin-log is not enable, an error raise without any useful hint:
```
$ python dump_events.py
Traceback (most recent call last):
File "dump_events.py", line 33, in
main()
File "dump_events.py", line 26, in main
for binlogevent in stream:
File "/pymysqlreplication/binlogstream.py", line 371, in fetchone
self.__connect_to_stream()
File "/pymysqlreplication/binlogstream.py", line 279, in __connect_to_stream
self.log_file, self.log_pos = cur.fetchone()[:2]
TypeError: 'NoneType' object is not subscriptable
```
From the source, we know this is because ``show master status`` return ``Empty set``.
So, a graceful exit message or a custom exception here would be much nice.
Contributor guide
Assessment
This issue has not been assessed yet.