Repository: getappmap/appmap-python (language: python)

Issue:
failure on startup when config is missing
If the `appmap` package is installed, no `appmap.yml` is present, `APPMAP` is unset or "false", and the app tries to load `_appmap.configuration`, it fails:

```
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/usr/local/lib/python3.11/site-packages/appmap/command/appmap_agent_status.py", line 6, in <module>
    from _appmap.configuration import Config
  File "/usr/local/lib/python3.11/site-packages/_appmap/__init__.py", line 1, in <module>
    from . import configuration, event, importer, metadata, recorder, recording, web_framework
  File "/usr/local/lib/python3.11/site-packages/_appmap/configuration.py", line 485, in <module>
    logger.info("file: %s", c._file)
                            ^^^^^^^
AttributeError: 'Config' object has no attribute '_file'
```

There are at least two common situations where this can occur: trying to run the installer when `appmap` is already installed, and trying to run pytest tests without `appmap`.


Discussion / hints:

Fix patch:
diff --git a/_appmap/configuration.py b/_appmap/configuration.py
index 3d255ce6..e83fd0ca 100644
--- a/_appmap/configuration.py
+++ b/_appmap/configuration.py
@@ -482,8 +482,7 @@ def initialize():
 if _startup_messages_shown is None:
     # pylint: disable=protected-access
     c._load_config(show_warnings=True)
-    logger.info("file: %s", c._file)
-    logger.info("config: %s", c._config)
+    logger.info("file: %s", c._file if c.file_present else "[no appmap.yml]")
     logger.debug("package_functions: %s", c.package_functions)
     logger.info("env: %r", os.environ)
     os.environ["_APPMAP_MESSAGES_SHOWN"] = "true"


Test patch:
diff --git a/ci/smoketest.sh b/ci/smoketest.sh
index 66e3fc4f..ebd9f31c 100755
--- a/ci/smoketest.sh
+++ b/ci/smoketest.sh
@@ -6,6 +6,9 @@ pip -q install /dist/appmap-*-py3-none-any.whl
 
 cp -R /_appmap/test/data/unittest/simple ./.
 
+# Before we enable, run a command that tries to load the config
+python -m appmap.command.appmap_agent_status
+
 export APPMAP=true
 
 python -m appmap.command.appmap_agent_init |\