Skip to content

Commit e845ad1

Browse files
committed
protected string conversion line
1 parent ce8d48b commit e845ad1

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

openxc/sources/base.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,10 @@ def run(self):
209209
payloadsave = ""
210210
try:
211211
payload = self.read()
212-
payloadsave = str(payload, "cp437", "ignore")
212+
try:
213+
payloadsave = str(payload, "cp437", "ignore")
214+
except:
215+
payloadsave = ""
213216
except DataSourceError as e:
214217
if self.running:
215218
LOG.warn("Can't read from data source -- stopping: %s", e)

0 commit comments

Comments
 (0)