Ugh. Fix a bug in the new refactor of the env var config stuff.
authorScott Gasch <[email protected]>
Thu, 18 Aug 2022 02:53:17 +0000 (19:53 -0700)
committerScott Gasch <[email protected]>
Thu, 18 Aug 2022 02:53:17 +0000 (19:53 -0700)
config.py
text_utils.py

index 0c4016675d7124c3f48e1a9def75794f9b86409d..a83433c68733178b634dad288cc4c14428a6b81b 100644 (file)
--- a/config.py
+++ b/config.py
@@ -303,7 +303,6 @@ class Config:
     @staticmethod
     def _parse_arg_into_env(arg: str) -> Optional[Tuple[str, str, List[str]]]:
         """Internal helper to parse commandling args into environment vars."""
-
         arg = arg.strip()
         if not arg.startswith('['):
             return None
@@ -314,7 +313,7 @@ class Config:
 
         chunks = arg.split()
         if len(chunks) > 1:
-            var = arg.split()[0]
+            var = chunks[0]
         else:
             var = arg
 
@@ -323,7 +322,7 @@ class Config:
         env = var.upper()
         while env[0] == '-':
             env = env[1:]
-        return arg, env, chunks
+        return var, env, chunks
 
     def _augment_sys_argv_from_environment_variables(self):
         """Internal.  Look at the system environment for variables that match
@@ -364,9 +363,9 @@ class Config:
                                 from string_utils import to_bool
 
                                 if len(chunks) == 1 and to_bool(value):
-                                    sys.argv.append(arg)
+                                    sys.argv.append(var)
                                 elif len(chunks) > 1:
-                                    sys.argv.append(arg)
+                                    sys.argv.append(var)
                                     sys.argv.append(value)
                     arg = ''
 
index 6437e62930d754bc7303e0550f262eee0b6746f1..890bc630f870c23ad3fabb2b31248ac359c98b26 100644 (file)
@@ -44,31 +44,37 @@ def get_console_rows_columns() -> RowsColumns:
     rows: Optional[str] = os.environ.get('LINES', None)
     cols: Optional[str] = os.environ.get('COLUMNS', None)
     if not rows or not cols:
+        logger.debug('Rows: %s, cols: %s, trying stty.', rows, cols)
         try:
             rows, cols = cmd(
                 "stty size",
                 timeout_seconds=1.0,
             ).split()
-        except Exception:
+        except Exception as e:
+            logger.exception(e)
             rows = None
             cols = None
 
     if rows is None:
+        logger.debug('Rows: %s, cols: %s, tput rows.', rows, cols)
         try:
             rows = cmd(
                 "tput rows",
                 timeout_seconds=1.0,
             )
-        except Exception:
+        except Exception as e:
+            logger.exception(e)
             rows = None
 
     if cols is None:
+        logger.debug('Rows: %s, cols: %s, tput cols.', rows, cols)
         try:
             cols = cmd(
                 "tput cols",
                 timeout_seconds=1.0,
             )
-        except Exception:
+        except Exception as e:
+            logger.exception(e)
             cols = None
 
     if not rows or not cols: