Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KeyError: 'APPDATA' in mRemoteNG.py", line 181, in get_configuration_files #631

Closed
muelli opened this issue Oct 3, 2023 · 2 comments
Closed

Comments

@muelli
Copy link

muelli commented Oct 3, 2023

PS C:\temp> .\LaZagne.exe all
[920] Failed to execute script laZagne
Traceback (most recent call last):
  File "laZagne.py", line 24, in <module>
  File "lazagne\config\run.py", line 32, in create_module_dic
  File "lazagne\config\manage_modules.py", line 102, in get_modules
  File "lazagne\config\manage_modules.py", line 102, in <listcomp>
  File "lazagne\softwares\sysadmin\mRemoteNG.py", line 35, in __init__
  File "lazagne\softwares\sysadmin\mRemoteNG.py", line 181, in get_configuration_files
  File "os.py", line 679, in __getitem__
KeyError: 'APPDATA'
PS C:\temp> 

https://github.com/AlessandroZ/LaZagne/blob/0cc15633bf05425303aafa8e194df42a8798d681/Windows/lazagne/softwares/sysadmin/mRemoteNG.py#L181C21-L181C21

it should probably fall back to a safe default when the environment variable does not exist.

@AlessandroZ
Copy link
Owner

Hello,

Thanks for reporting this problem. I didn't check it but the rest of the tools does it. Here is how these env variables are defined:

'APPDATA': u'{drive}:\\Users\\{user}\\AppData\\Roaming\\',

And here is how it is used ont other modules:

_path = os.path.join(constant.profile['APPDATA'], one_dir)

I will fix it when I have some time.

@rodrigozanatta
Copy link

Why not create a try catch in it? Or you could use it more. If something fail, it don't need to block all the program.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants