Skip to content
This repository has been archived by the owner on May 6, 2024. It is now read-only.

Configuration path is relative to current working directory #7

Closed
hamishegg opened this issue Mar 15, 2021 · 3 comments
Closed

Configuration path is relative to current working directory #7

hamishegg opened this issue Mar 15, 2021 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@hamishegg
Copy link

hamishegg commented Mar 15, 2021

Traceback (most recent call last):
  File "C:\Himawari\himawari-rx.py", line 276, in <module>
    HimawariRX()
  File "C:\Himawari\himawari-rx.py", line 39, in __init__
    self.config = self.parse_config()
  File "C:\Himawari\himawari-rx.py", line 201, in parse_config
    "path": Path(cfgp.get('rx', 'path')),
  File "C:\Python3\lib\configparser.py", line 781, in get
    d = self._unify_values(section, vars)
  File "C:\Python3\lib\configparser.py", line 1149, in _unify_values
    raise NoSectionError(section) from None
configparser.NoSectionError: No section: 'rx'
@sam210723
Copy link
Owner

Hi, this is probably related to a known bug with the configuration file location (himawari-rx.ini) being relative to the current working directory. When a console application is run as Administrator in Windows the current directory defaults to C:WINDOWS\system32.

I have applied a fix for this in xrit-rx and will apply the same fix to himawari-rx soon. For the time being, you could modify himawari-rx.bat so it changes the current directory to the location of himawari-rx first, then runs the application.

@echo off
title himawari-rx

cd C:/path/to/himawari-rx
python himawari-rx.py --config himawari-rx.ini
pause

Out of interest, why does it need to be run as Administrator?

Sam.

@sam210723 sam210723 changed the title win 10 run as admin errors Configuration path is relative to current working directory Mar 15, 2021
@sam210723 sam210723 self-assigned this Mar 15, 2021
@sam210723 sam210723 added the bug Something isn't working label Mar 15, 2021
@hamishegg
Copy link
Author

hamishegg commented Mar 15, 2021 via email

@sam210723
Copy link
Owner

I have pushed himawari-rx v0.1.3 which fixes the relative path issue.

Local win 10 pc nothing just sits there.

This may be something to do with the network adaptor priority setting.
https://www.windowscentral.com/how-change-priority-order-network-adapters-windows-10

# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants