Skip to content

Commit

Permalink
Fix bug that prevented relative paths to config file from working
Browse files Browse the repository at this point in the history
  • Loading branch information
tkeffer committed Sep 1, 2024
1 parent 976e92a commit 145bd92
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
4 changes: 3 additions & 1 deletion docs_src/changes.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
WeeWX change history
--------------------

### 5.2.0 MM/DD/YYYY
### 5.1.X MM/DD/YYYY

Fix typo that causes phantom values of `soilMoist3` to appear with VantageVue
stations.

Fix bug that prevented relative paths to the config file from working.


### 5.1.0 07/04/2024

Expand Down
7 changes: 4 additions & 3 deletions src/weecfg/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,9 +173,10 @@ def read_config(option_path, args=None, locations=DEFAULT_LOCATIONS,

# If the result of all that is not an absolute path, join it with the location of the config
# file, which will make it into an absolute path.
if not os.path.abspath(config_dict['WEEWX_ROOT']):
config_dict['WEEWX_ROOT'] = os.path.normpath(os.path.join(os.path.dirname(config_path),
config_dict['WEEWX_ROOT']))
if not os.path.isabs(config_dict['WEEWX_ROOT']):
config_dict['WEEWX_ROOT'] = os.path.normpath(
os.path.join(os.path.dirname(config_dict['config_path']), config_dict['WEEWX_ROOT'])
)

return config_path, config_dict

Expand Down

0 comments on commit 145bd92

Please sign in to comment.