Miserlou / Zappa

Serverless Python
https://blog.zappa.io/
MIT License
11.89k stars 1.2k forks source link

zappa init #1042

Open skaviani opened 7 years ago

skaviani commented 7 years ago

Context

i am trying to deply kodi-alexa skill and getting a bizarre error mesage. talked to guys in kodi-alexa skills and they said this might be an error in Zappa.

i am using python27 and ot sure what zappa version i am using as i am new in this enviroment. using zappa in virtual enviroment.

## Expected Behavior

Actual Behavior

Possible Fix

Steps to Reproduce

1.pip install awscli 2.aws configure 3.pip install virtualenv 4.git clone https://github.com/m0ngr31/kodi-alexa.git 5.cd kodi-alexa 6.virtualenv venv 7.venv\Scripts\activate.bat 8.pip install -r requirements.txt 9.pip install packaging 10.pip install zappa 11.created the file kodi.config an this point when i type zappa init

███████╗ █████╗ ██████╗ ██████╗ █████╗ ╚══███╔╝██╔══██╗██╔══██╗██╔══██╗██╔══██╗ ███╔╝ ███████║██████╔╝██████╔╝███████║ ███╔╝ ██╔══██║██╔═══╝ ██╔═══╝ ██╔══██║ ███████╗██║ ██║██║ ██║ ██║ ██║ ╚══════╝╚═╝ ╚═╝╚═╝ ╚═╝ ╚═╝ ╚═╝

Welcome to Zappa!

Zappa is a system for running server-less Python web applications on AWS Lambda and AWS API Gateway. This init command will help you create and configure your new Zappa deployment. Let's get started!

Your Zappa configuration can support multiple production stages, like 'dev', 'staging', and 'production'. What do you want to call this environment (default 'dev'):

AWS Lambda and API Gateway are only available in certain regions. Let's check to make sure you have a profile set up in one that will work. Okay, using profile default!

Your Zappa deployments will need to be uploaded to a private S3 bucket. If you don't have a bucket yet, we'll create one for you too. What do you want call your bucket? (default 'zappa-3fj5iaoad'):

It looks like this is a Flask application. Oh no! An error occurred! :(

==============

Traceback (most recent call last): File "c:\kodi\venv\lib\site-packages\zappa\cli.py", line 2489, in handle sys.exit(cli.handle()) File "c:\kodi\venv\lib\site-packages\zappa\cli.py", line 444, in handle self.init() File "c:\kodi\venv\lib\site-packages\zappa\cli.py", line 1506, in init matches = detect_flask_apps() File "c:\kodi\venv\lib\site-packages\zappa\utilities.py", line 143, in detect_flask_apps lines = f.readlines() File "c:\kodi\venv\lib\encodings\cp1252.py", line 23, in decode return codecs.charmap_decode(input,self.errors,decoding_table)[0] UnicodeDecodeError: 'charmap' codec can't decode byte 0x81 in position 301: character maps to

==============

Need help? Found a bug? Let us know! :D File bug reports on GitHub here: https://github.com/Miserlou/Zappa And join our Slack channel here: https://slack.zappa.io Love!, ~ Team Zappa!

Your Environment

mcrowson commented 7 years ago

Likely an encoding issue with some file in your project meeting python's open() function. My guess is when zappa was looking at the file it detected cp1252 encoding, and then encountered another character outside of that encoding. If you have a python file with at least two encodings it is gonna struggle. Similar thing happening here: https://stackoverflow.com/a/18654116/3046938