q icon indicating copy to clipboard operation
q copied to clipboard

Windows: Python warning string at the end of the csv output

Open vyskubov opened this issue 7 years ago • 3 comments

Hello.

When I run q on Windows (version from installer) it prints Python warning at the end of the generated csv. WARNING: file already exists but should not: C:\Users\836D~1\AppData\Local\Temp\1\_MEI26442\include\pyconfig.h

Commands like q "SELECT 1" > result.csv and q "SELECT 1" 1> result.csv 2> error.msg prints to file result.csv

1
WARNING: file already exists but should not: C:\Users\836D~1\AppData\Local\Temp\1\_MEI26442\include\pyconfig.h

and error messages (like "file not found") goes to error.msg. But not that warning. It appends to result.csv.

Expected behaviour: generated csv goes to STDOUT, all errors and warnings goes to STDERR.

Or as an option it would be great to add a feature to suppress all warnings.

Or add a key to specify an output file for csv result.

Windows version: 2012 R2

@harelba, Thanks for your great work!

vyskubov avatar Feb 28 '18 07:02 vyskubov

As a workaround I'm using Sed for Windows to remove the last line with the warning as follows:

q "SELECT 1" > result.tmp
sed "$d" result.tmp 1> result.csv

vyskubov avatar Feb 28 '18 08:02 vyskubov

Hi, sorry for the late reply, and thanks for the kind words.

This error is actually a bug in pyinstaller for windows, which requires a workaround and new build of q in order to solve. I've already heard of some people encountering this error, but the fact that the output of this line is in stdout and not in stderr makes it much more severe.

I'll try to arrange a windows machine for building q again without this error :)

harelba avatar Mar 03 '18 09:03 harelba

Hi, I've released a new version for windows 1.7.4 which solves this extra warning issue. Just download the new windows version from the site (remember to refresh the page properly, so the new link will be used) and install it. The setup version should be setup-1.7.4.exe.

harelba avatar Mar 24 '18 08:03 harelba