From a744dc270b4bff3e498540c60f7716571e66dbc4 Mon Sep 17 00:00:00 2001 From: Yaron de Leeuw Date: Sun, 9 Dec 2018 17:32:48 -0500 Subject: [PATCH] Update pygtfs to upstream's 0.1.5 (#19151) This works by adding `?check_same_thread=False` to the sqlite connection string, as suggested by robbiet480@. It upgrades pygtfs from homeassitant's forked 0.1.3 version to 0.1.5. Fixes #15725 --- homeassistant/components/sensor/gtfs.py | 6 +++--- requirements_all.txt | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/homeassistant/components/sensor/gtfs.py b/homeassistant/components/sensor/gtfs.py index 633a50f15c1530..3ccc60457b6ab8 100644 --- a/homeassistant/components/sensor/gtfs.py +++ b/homeassistant/components/sensor/gtfs.py @@ -16,7 +16,7 @@ from homeassistant.helpers.entity import Entity import homeassistant.helpers.config_validation as cv -REQUIREMENTS = ['pygtfs-homeassistant==0.1.3.dev0'] +REQUIREMENTS = ['pygtfs==0.1.5'] _LOGGER = logging.getLogger(__name__) @@ -169,9 +169,9 @@ def setup_platform(hass, config, add_entities, discovery_info=None): import pygtfs - split_file_name = os.path.splitext(data) + (gtfs_root, _) = os.path.splitext(data) - sqlite_file = "{}.sqlite".format(split_file_name[0]) + sqlite_file = "{}.sqlite?check_same_thread=False".format(gtfs_root) joined_path = os.path.join(gtfs_dir, sqlite_file) gtfs = pygtfs.Schedule(joined_path) diff --git a/requirements_all.txt b/requirements_all.txt index ec22bccfa9af13..0606252b18d5a2 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -963,7 +963,7 @@ pygatt==3.2.0 pygogogate2==0.1.1 # homeassistant.components.sensor.gtfs -pygtfs-homeassistant==0.1.3.dev0 +pygtfs==0.1.5 # homeassistant.components.remote.harmony pyharmony==1.0.20