From: Alan W. I. <Ala...@gm...> - 2019-07-31 18:50:08
|
On 2019-07-31 12:44+0100 Phil Rosenberg wrote: > Thanks Alan > I've just tried again with the style_source script, but I'm hitting > another problem. I now get the error: > > File "scripts/convert_comment.py", line 72 > raise RuntimeError, "Cannot interpret trailing character(s) after > */ for this line" > ^ > SyntaxError: invalid syntax > ERROR: scripts/convert_comment.py failed for file plplot_config.h.in > > > Any suggestions? I have both python 2 and 3 installed. That error message comes from this logic in scripts/convert_comment.py which hasn't been changed (from git blame -w) since 2010. # Note trailing "\n" has not (yet) been removed from line so # that the next to last character is at position len(line) - 3. if end_comment >=0 and end_comment != len(line) - 3: if ifsingleline and start_comment >=0: # Skip most further processing for a line with embedded # comments outside of multiline blocks of comments. start_comment = -1 end_comment = -1 else: sys.stderr.write(line) raise RuntimeError, "Cannot interpret trailing character(s) after */ for this line" So that error message should have included the results from sys.stderr.write(line) from the line in plplot_config.h.in that is stored in the Python "line" variable that appears to be causing this python logic problem. The usual interpretation of this error message is you have commentary in plplot_config.h.in which is not in legitimate form. For example, you might have forgotten the trailing "*/" on a comment. So I would test that possibility by attempting to build the plplot target before styling, which would necessarily attempt to compile the configured plplot_config.h. However, if that "easy" answer is not the correct one, please send the complete error message including the output of the Python "line" variable that is causing the issue. Of course, the above Python logic only works if there are no line-ending issues in Python, i.e., the Python "line" variable contains a string that is terminated simply by \n rather than \r\n. And note that by git default plplot_config.h.in will have \r\n line endings on MSYS2. But the discussion in <https://stackoverflow.com/questions/10785131/line-endings-in-python> seems to imply that on Python automatically converts all \r and \r\n line endings for text files to \n. Also, my impression is you have exercised the above scripts/convert_comment.py logic from 2010 with no issues in the past on Cygwin (where again, the checked out plplot_config.h.in should have \r\n line endings.) So I would only look at this potential line ending issue (by dumping out each raw byte of the above line) only as a last resort (i.e., only if the line that is causing this error compiles with no issues). Alan __________________________ Alan W. Irwin Programming affiliations with the FreeEOS equation-of-state implementation for stellar interiors (freeeos.sf.net); the Time Ephemerides project (timeephem.sf.net); PLplot scientific plotting software package (plplot.org); the libLASi project (unifont.org/lasi); the Loads of Linux Links project (loll.sf.net); and the Linux Brochure Project (lbproject.sf.net). __________________________ Linux-powered Science __________________________ |