From a3be0db563c0795fcd436fcfaa6643122cf9255e Mon Sep 17 00:00:00 2001 From: chrisjbillington Date: Tue, 21 Sep 2021 13:45:13 +1000 Subject: [PATCH] Fix bug on Python3.6, where Path object not able to be treated as a string in ConfigParser. --- labscript_profile/__init__.py | 5 ++++- labscript_utils/labconfig.py | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/labscript_profile/__init__.py b/labscript_profile/__init__.py index a679ff5..55571f7 100644 --- a/labscript_profile/__init__.py +++ b/labscript_profile/__init__.py @@ -49,7 +49,10 @@ def add_userlib_and_pythonlib(): time the interpreter starts up""" labconfig = default_labconfig_path() if labconfig is not None and labconfig.exists(): - config = ConfigParser(defaults={'labscript_suite': LABSCRIPT_SUITE_PROFILE}) + # str() below is for py36 compat, where ConfigParser can't deal with Path objs + config = ConfigParser( + defaults={'labscript_suite': str(LABSCRIPT_SUITE_PROFILE)} + ) config.read(labconfig) for option in ['userlib', 'pythonlib']: try: diff --git a/labscript_utils/labconfig.py b/labscript_utils/labconfig.py index d9c2057..d110fe8 100644 --- a/labscript_utils/labconfig.py +++ b/labscript_utils/labconfig.py @@ -43,7 +43,8 @@ def __init__( required_params = {} if defaults is None: defaults = {} - defaults['labscript_suite'] = LABSCRIPT_SUITE_PROFILE + # str() below is for py36 compat, where ConfigParser can't deal with Path objs + defaults['labscript_suite'] = str(LABSCRIPT_SUITE_PROFILE) if isinstance(config_path, list): self.config_path = config_path[0] else: pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy