Re: [pylons-devel] pserve.exe syntax error on windows with --reload
> On Sep 25, 2016, at 00:59 , Marius Gedminas wrote: > > On Sat, Sep 24, 2016 at 04:49:45AM -0700, only...@gmail.com wrote: >> I have created a pyramid application using pcreate, now when I try to run it >> using pserve with --reload, I get following error >> >> SyntaxError: Non-ASCII character '\x90' in file \pserve.exe on line 1, >> but no encoding declared; see http://python.org/dev/peps/pep-0263/ for >> details >> Interestingly this error shows up only when I use --reload, if I remove >> reload >> it starts fine. > > I bet it's because of this bit of code: > https://github.com/Pylons/pyramid/blob/master/pyramid/scripts/pserve.py#L267-L270 > > pserve is trying to run > > /path/to/python.exe /path/to/pserve.exe other args It shouldn’t be running /path/to/python.exe /path/to/pserve.exe, it should be running /path/to/pserve.exe directly. That’s what that fix should have been doing. When you run /path/to/pserve.exe the script name in sys.argv[0] is set to ‘pserve’ without any extension on it at all. That fix added .exe to once again make it pserve.exe which can then be executed by popen. > > in a subprocess, and python doesn't like interpreting .exe files. But > then https://github.com/Pylons/pyramid/issues/2126 explicitly made it be > that way, with reports that everything works fine? I don't understand > Windows :( > > > File a new bug maybe? > > Regards, > Marius Gedminas > -- > Despite all appearances, your boss is a thinking, feeling, human being. > > -- > You received this message because you are subscribed to the Google Groups > "pylons-devel" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to pylons-devel+unsubscr...@googlegroups.com. > To post to this group, send email to pylons-devel@googlegroups.com. > Visit this group at https://groups.google.com/group/pylons-devel. > For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "pylons-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to pylons-devel+unsubscr...@googlegroups.com. To post to this group, send email to pylons-devel@googlegroups.com. Visit this group at https://groups.google.com/group/pylons-devel. For more options, visit https://groups.google.com/d/optout. smime.p7s Description: S/MIME cryptographic signature
Re: [pylons-devel] pserve.exe syntax error on windows with --reload
On Sat, Sep 24, 2016 at 04:49:45AM -0700, only...@gmail.com wrote: > I have created a pyramid application using pcreate, now when I try to run it > using pserve with --reload, I get following error > > SyntaxError: Non-ASCII character '\x90' in file \pserve.exe on line 1, > but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details > Interestingly this error shows up only when I use --reload, if I remove reload > it starts fine. I bet it's because of this bit of code: https://github.com/Pylons/pyramid/blob/master/pyramid/scripts/pserve.py#L267-L270 pserve is trying to run /path/to/python.exe /path/to/pserve.exe other args in a subprocess, and python doesn't like interpreting .exe files. But then https://github.com/Pylons/pyramid/issues/2126 explicitly made it be that way, with reports that everything works fine? I don't understand Windows :( File a new bug maybe? Regards, Marius Gedminas -- Despite all appearances, your boss is a thinking, feeling, human being. -- You received this message because you are subscribed to the Google Groups "pylons-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to pylons-devel+unsubscr...@googlegroups.com. To post to this group, send email to pylons-devel@googlegroups.com. Visit this group at https://groups.google.com/group/pylons-devel. For more options, visit https://groups.google.com/d/optout. signature.asc Description: PGP signature
Re: [pylons-devel] pserve.exe syntax error on windows with --reload
What is Does it have a non-ascii character in the folder path? Try moving your project to C:\Projects\myproject or something similar, and that should hopefully avoid the error. Bert > On Sep 24, 2016, at 05:49 , only...@gmail.com wrote: > > > I have created a pyramid application using pcreate, now when I try to run it > using pserve with --reload, I get following error > > SyntaxError: Non-ASCII character '\x90' in file \pserve.exe on line 1, > but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details > Interestingly this error shows up only when I use --reload, if I remove > reload it starts fine. > > After debugging, I see another file pserve-script.py at the same location of > pserve.exe and this python script is internally called by pserve.exe ( I > don't understand why? when pserve itself is executable) > > The above pserve-script.py has following content and I assume the above error > is because of following shebang. > > #!c:\\Scripts\python.exe > # EASY-INSTALL-ENTRY-SCRIPT: 'pyramid','console_scripts','pserve' > __requires__ = 'pyramid' > import re > import sys > from pkg_resources import load_entry_point > > if __name__ == '__main__': > sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0]) > sys.exit( > load_entry_point('pyramid', 'console_scripts', 'pserve')() > ) > > -- > You received this message because you are subscribed to the Google Groups > "pylons-devel" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to pylons-devel+unsubscr...@googlegroups.com. > To post to this group, send email to pylons-devel@googlegroups.com. > Visit this group at https://groups.google.com/group/pylons-devel. > For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "pylons-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to pylons-devel+unsubscr...@googlegroups.com. To post to this group, send email to pylons-devel@googlegroups.com. Visit this group at https://groups.google.com/group/pylons-devel. For more options, visit https://groups.google.com/d/optout. smime.p7s Description: S/MIME cryptographic signature
[pylons-devel] pserve.exe syntax error on windows with --reload
I have created a pyramid application using pcreate, now when I try to run it using pserve with --reload, I get following error * SyntaxError: Non-ASCII character '\x90' in file \pserve.exe on line 1, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details* *Interestingly this error shows up only when I use --reload, if I remove reload it starts fine.* After debugging, I see another file pserve-script.py at the same location of pserve.exe and this python script is internally called by pserve.exe ( I don't understand why? when pserve itself is executable) The above pserve-script.py has following content and I assume the above error is because of following shebang. #!c:\\Scripts\python.exe # EASY-INSTALL-ENTRY-SCRIPT: 'pyramid','console_scripts','pserve' __requires__ = 'pyramid' import re import sys from pkg_resources import load_entry_point if __name__ == '__main__': sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0]) sys.exit( load_entry_point('pyramid', 'console_scripts', 'pserve')() ) -- You received this message because you are subscribed to the Google Groups "pylons-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to pylons-devel+unsubscr...@googlegroups.com. To post to this group, send email to pylons-devel@googlegroups.com. Visit this group at https://groups.google.com/group/pylons-devel. For more options, visit https://groups.google.com/d/optout.