-
Notifications
You must be signed in to change notification settings - Fork 262
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
v4.8.0 ncgen not handling path names correctly on Windows #1988
Comments
I am curious; how does python come in to play here. Are you calling ncgen using python? |
I wouldn't think it affects anything, that's just my exposure to this library, from a python background. It should be reproducible from the CLI only. |
I found the problem. There was an issue with certain shell programs (bash notably).
|
re: Unidata#1988 There was an issue with certain shell programs (bash notably). For certain platforms and when given a url that had an escaped '#' character (e.g. \\#) bash would not remove the backslash. So I had to add a hack for this. Unfortunately I overdid it and it removed all '' characters. This is ok for non-windows platforms, but obviously fails for windows. The fix is this. 1. In a utility program (ncgen, ncdump, nccopy, etc) there is probably a call (or calls) to NC_backslashUnescape(xxx) where xxx is a path argument from the command line. 2. Replace each such call with NC_shellUnescape(xxx). The NC_shellUnescape function was added and searched only for occurrences of "\#" and replaces them with "#".
Fixed (I hope) by PR #1989 |
I'll keep this short since the symptom is pretty simple. Basically ncgen -o output option is taking an absolute path argument and converting it into one long file name. This is a regression from version 4.7. This unexpected behavior only happens on Windows, on Linux it still generates the file in the correct location.
On windows:
Using version 4.7:
$ ncgen -o C:\Users\you\Desktop\temp\fourpointseven.nc C:\Users\you\Desktop\temp\test_cdl.cdl
<generates the .nc to the path C:\Users\you\Desktop\temp\fourpointseven.nc>
Using version 4.8.0:
$ ncgen -o C:\Users\you\Desktop\temp\fourpointeight.nc C:\Users\you\Desktop\temp\test_cdl.cdl
<generates the .nc to a file named UsersyouDesktoptempfourpointeight.nc in wherever CD is>
Any .cdl will work for the test, I'm using this one:
I am using libnetcdf with python, I've tested this with python 3.7,3.8,3.9.
The text was updated successfully, but these errors were encountered: