WebFaction
Community site: login faq

Hi,

I have migrated an app over to webfaction, but I am having trouble getting even basic python hello world scripts to run. I have the permissions set up as 755, but I just keep getting 500 internal server error.

I am thinking that my shebang might be wrong. I have it currently set to #!/usr/local/bin/python2.6, which seems right, but if I run this via ssh I get -bash: ./test2.py: /usr/local/bin/python2.6^M: bad interpreter: No such file or directory,

Not sure where the ^M is coming from there since that is certainly not in the script.

Thanks, Russ

asked 22 Feb '11, 11:16

srussking
111
accept rate: 0%


The ^M is there because your file is saved with DOS line endings, and that's what's causing the script to fail.

You can fix it by running dos2unix test2.py.

If your text editor doesn't support saving files with UNIX line endings, then switch to one that does :)

permanent link

answered 22 Feb '11, 11:56

seanf
12.2k41836
accept rate: 37%

This explains a lot. Thanks seanf!

(22 Feb '11, 13:23) srussking
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×337
×1

question asked: 22 Feb '11, 11:16

question was seen: 3,949 times

last updated: 22 Feb '11, 13:23

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2019 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM