Skip to content Skip to sidebar Skip to footer

Non-ascii Character '\x90' Executing Pserve On Windows Inside Virtualenv

Question: How can i solve no-ascii character error executing pserve on virtualenv in windows? Description: I'm trying to execute pserve (pyllons/pyramid development web server) ins

Solution 1:

I don't really have an answer here as I don't use either Pyramid or Windows. However, this has been seen before by a few people and may be due to python.exe being used to execute pserve.exe, which won't work as that's an executable not a Python program.

Here are some links that might move this forward - recommend you join the Google Group as it has more concentrated Pyramid expertise:

One specific idea is to ensure you have a pserve.py file not pserve.exe and that you use python pserve.py to run it. If the calling script has limitations, create a run-pserve.bat batch file to call Python and test it outside the calling script.

Alternatively, you might want to use a pre-configured Linux VM on Windows. Or on Windows 10 there is a good 'Bash for Windows' aka Windows Subsystem for Linux that's really a full Ubuntu Linux. Either of these would make it much easy for development than Windows, I would think.

Solution 2:

Assuming your virtualenv sits in venv directory

Use this:

python venv/Lib/site-packages/pyramid/scripts/pserve.py some-ini-config.ini --reload

Solution 3:

This error message comes with a suggestion and it reads

SyntaxError: Non-ASCII character '\x90' in file /path/to/file on line #lineno, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details

The bold part is where the suggestion is. This PEP is very straight forward and the solution is just to define an encoding for your source file. You will most likely to have

#!/usr/bin/env python# coding=utf-8

The interpreter line is optional, but the coding can be defined second if you have interpreter line or first if you dont

Set the encoding depending on your character sets. utf-8 should work for most cases, or you may need other encodings.

Post a Comment for "Non-ascii Character '\x90' Executing Pserve On Windows Inside Virtualenv"