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

When run from subprocess call gives an 'UnboundLocalError' #54

Open
leccyrob opened this issue Nov 20, 2023 · 0 comments
Open

When run from subprocess call gives an 'UnboundLocalError' #54

leccyrob opened this issue Nov 20, 2023 · 0 comments

Comments

@leccyrob
Copy link

Hi.
I've been using version 0.1.25 script by calling it from within a python script as a 'subprocess.check_output("export_csv_to_influx....")' which parses through and collates a bunch of .dat files and then pushing those datapoints onto an InfluxDB1.8 server for several years now. All works really well! Thanks.
My issue now is that we've upgraded to InfluxDB2 and so have had to upgrade your script to the 0.2.2 version. If I run your script by itself then it works OK but when running from within my script it gives the 'UnboundLocalError: local variable 'headers' referenced before assignment' error, I renamed a variable I was using (also called 'headers') to 'heads' which I thought might be the problem but it still throws the same error.
My script IS a bit clunky, I'm wondering if there's a better way for me to call your module from within my script?
You mention your module can be run 'Programmatically' but I'm sorry I really don't understand the example you gave...
Can you please give me some direction on how to use your module from within a script so I don't have to call it with a subprocess.check_output, I believe it will work well for me then as it has done for many years on the old version.
Thank you for your script!

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

1 participant