Skip to content
New issue

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

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

Already on GitHub? # to your account

Bullet points in strings in buildPDF.py cause encoding error with older versions of python #20

Open
brcaughron opened this issue Nov 11, 2021 · 0 comments

Comments

@brcaughron
Copy link

brcaughron commented Nov 11, 2021

In one of the recent commits, there were a couple of print statements in buildPDF.py that added some bullet point characters.

At line 276:

      # Check the return status of the TeX version call
      if tex_which_out.returncode > 0:
         print_error("""No TeX distribution installation found, check PATH environment
Standard TeX installation locations can be found in:
  • Linux: /usr/local/texlive/2025/bin/x86_64-linux
  • macOS: /usr/local/texlive/2025/bin/x86_64-darwin
  • Windows: C:\\texlive\\2025\\bin\\win32"""
            )

and at line 435:

      # Print path to created template and exit
      if not self._quiet:
         print("""Template created in:
  • {0}
To build PDF run the following:
  • cd {0}
  • ./support/buildPDF.py {1}
""".format(tc.BLUE+structure_path+tc.ENDC,self.input_tex))

It seems that when buildPDF.py is used to build a report and your python version is recent enough, this doesn't cause an issue. However, when using a python version of 2.7.5, for example, I get this error when trying to generate a report using buildPDF.py:

 File "./support/buildPDF.py", line 280
SyntaxError: Non-ASCII character '\xe2' in file ./support/buildPDF.py on line 281, but no encoding declared; see http://www.python.org/peps/pep-0263.html for details

I confirmed replacing the bullet point characters with simple hyphens ('-') resolved the issue.

@brcaughron brcaughron changed the title Bullet points in strings in buildPDF.py cause encoding issues with older versions of python Bullet points in strings in buildPDF.py cause encoding error with older versions of python Nov 11, 2021
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant