erdewit / ib_insync

Python sync/async framework for Interactive Brokers API
BSD 2-Clause "Simplified" License
2.81k stars 753 forks source link

Check contract details has time zone ID #663

Open djkelleher opened 10 months ago

djkelleher commented 10 months ago

Contracts about to expire may not have tradingHours, liquidHours, and timeZoneId set. This was causing an error when _parseSessions is called:

Exception has occurred: ValueError
ZoneInfo keys must be normalized relative paths, got: 

A simple way to avoid the error would be to check if the argument string is empty.