Python error “Segmentation fault: 11 in OS X”

import webapp2
import jinja2
import os

template_env = jinja2.Environment(
	loader=jinja2.FileSystemLoader(os.getcwd()))

class InputPage(webapp2.RequestHandler):
	def get(self):
		#self.reponse.out.write('asdf')
		template = str(template_env.get_template('input.html'))
		context = {
			'abc':1,
		}
		self.response.out.write(template.render(context))

	def post(self):
		try:
			text_input = str(self.request.get('input_textarea')) ####
			template = template_env.get_template('input.html')
			context = {
				'input_text':text_input,
			}
			self.response.out.write(template.render(context))
		except ValueError:
			pass



application = webapp2.WSGIApplication([('/input',InputPage)],debug=True)

๊ธฐ๋ณธ์ž‘์—…์ค‘์— #### (19๋ฒˆ์งธ ์ค„)์—์„œ ์ง„ํ–‰์ด ์•ˆ๋˜๊ธธ๋ž˜, str() ํ•จ์ˆ˜๋Š” ๋ถ„๋ช… ๋ฌธ์ œ๊ฐ€ ์—†๋Š”๋ฐ ๋ง์ด๋‹ค.

ํ„ฐ๋ฏธ๋„๋กœ ๋“ค์–ด๊ฐ€์„œ ํ…Œ์ŠคํŠธ๋ฅผ ํ•˜๋‹ค๋ณด๋‹ˆ 2~3๋ฒˆ ์ปค๋งจ๋“œ๋ฅผ ์ž…๋ ฅํ•˜๋ฉด ๋ฐœ์ƒํ•˜๋Š” ์—๋Ÿฌ Segmentation fault: 11

๊ตฌ๊ธ€๋ง์„ ํ•˜๋‹ˆ, ๊ฝค ํ”ํ•œ ์—๋Ÿฌ๋”๋ผ.

 

ํ•ด๊ฒฐ๋ฐฉ๋ฒ•์€ ๋‹ค์Œ๊ณผ ๊ฐ™๋‹ค.

cd /Library/Frameworks/Python.framework/Versions/3.3
cd ./lib/python3.3/lib-dynload
sudo mv readline.so readline.so.disabled

2.7๋ฒ„์ „์„ ์“ฐ๋Š” ์‚ฌ๋žŒ์€ 3.3๋Œ€์‹  2.7๋กœ ๋ฐ”๊ฟ”์„œ ํ•˜๋ฉด ๋œ๋‹ค.

0 Shares:
Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.