moluwole / Bast

Simple but Elegant Web Framework
https://bast.readthedocs.io
MIT License
48 stars 10 forks source link

Panther --help throws error due to environment issue on Ubuntu #14

Open webong opened 6 years ago

webong commented 6 years ago
cabox@box-codeanywhere:~/workspace$  panther --help
Traceback (most recent call last):  File "/usr/local/bin/panther", line 11, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.6/dist-packages/click/core.py", line 722, in __call__    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.6/dist-packages/click/core.py", line 676, in main
    _verify_python3_env()  File "/usr/local/lib/python3.6/dist-packages/click/_unicodefun.py", line 118, in _verify_python3_env
    'for mitigation steps.' + extra)
RuntimeError: Click will abort further execution because Python 3 was configured to use ASCII as encoding for the environment.  Consult http://click.pocoo.org/python3/for mitigation steps.
This system supports the C.UTF-8 locale which is recommended.You might be able to resolve your issue by exporting thefollowing environment variables:
    export LC_ALL=C.UTF-8
    export LANG=C.UTF-8
cabox@box-codeanywhere:~/workspace$ locale
LANG=
LANGUAGE=
LC_CTYPE="POSIX"
LC_NUMERIC="POSIX"
LC_TIME="POSIX"
LC_COLLATE="POSIX"
LC_MONETARY="POSIX"
LC_MESSAGES="POSIX"
LC_PAPER="POSIX"
LC_NAME="POSIX"
LC_ADDRESS="POSIX"
LC_TELEPHONE="POSIX"
LC_MEASUREMENT="POSIX"
LC_IDENTIFICATION="POSIX"
LC_ALL=

Fix

cabox@box-codeanywhere:~/workspace$ export LC_ALL=C.UTF-8
cabox@box-codeanywhere:~/workspace$ export LANG=C.UTF-8
cabox@box-codeanywhere:~/workspace$ locale
LANG=C.UTF-8
LANGUAGE=
LC_CTYPE="C.UTF-8"
LC_NUMERIC="C.UTF-8"
LC_TIME="C.UTF-8"
LC_COLLATE="C.UTF-8"
LC_MONETARY="C.UTF-8"
LC_MESSAGES="C.UTF-8"
LC_PAPER="C.UTF-8"
LC_NAME="C.UTF-8"
LC_ADDRESS="C.UTF-8"
LC_TELEPHONE="C.UTF-8"
LC_MEASUREMENT="C.UTF-8"
LC_IDENTIFICATION="C.UTF-8"
LC_ALL=C.UTF-8

Now

cabox@box-codeanywhere:~/workspace$  panther --help
Usage: panther [OPTIONS] COMMAND [ARGS]...

Options:
  --version  Show the version and exit.
  --help     Show this message and exit.

Commands:
  create:controller   Creates a Controller File
  create:middleware   Creates a Middleware
  create:migration    Create a migration file
  create:model        Create Model File
  create:view         Create a View File
  generate:key        Generate the APP KEY
  migration:reset     Reset Migration
  migration:rollback  Roll Back last Migration
  migration:run       Run Migration
  new                 Create a new Bast Project
  run                 Run your Bast Server
moluwole commented 6 years ago

Thinking off the top of my head now 🤔... Seems this is from click library. Correct me if I'm wrong

On Fri, Aug 31, 2018, 1:12 AM Wisdom Anthony notifications@github.com wrote:

cabox@box-codeanywhere:~/workspace$ panther --help Traceback (most recent call last): File "/usr/local/bin/panther", line 11, in sys.exit(main()) File "/usr/local/lib/python3.6/dist-packages/click/core.py", line 722, in call return self.main(*args, **kwargs) File "/usr/local/lib/python3.6/dist-packages/click/core.py", line 676, in main _verify_python3_env() File "/usr/local/lib/python3.6/dist-packages/click/_unicodefun.py", line 118, in _verify_python3_env 'for mitigation steps.' + extra) RuntimeError: Click will abort further execution because Python 3 was configured to use ASCII as encoding for the environment. Consult http://click.pocoo.org/python3/for mitigation steps. This system supports the C.UTF-8 locale which is recommended.You might be able to resolve your issue by exporting thefollowing environment variables: export LC_ALL=C.UTF-8 export LANG=C.UTF-8

cabox@box-codeanywhere:~/workspace$ locale LANG= LANGUAGE= LC_CTYPE="POSIX" LC_NUMERIC="POSIX" LC_TIME="POSIX" LC_COLLATE="POSIX" LC_MONETARY="POSIX" LC_MESSAGES="POSIX" LC_PAPER="POSIX" LC_NAME="POSIX" LC_ADDRESS="POSIX" LC_TELEPHONE="POSIX" LC_MEASUREMENT="POSIX" LC_IDENTIFICATION="POSIX" LC_ALL=

Fix

cabox@box-codeanywhere:~/workspace$ export LC_ALL=C.UTF-8 cabox@box-codeanywhere:~/workspace$ export LANG=C.UTF-8

cabox@box-codeanywhere:~/workspace$ locale LANG=C.UTF-8 LANGUAGE= LC_CTYPE="C.UTF-8" LC_NUMERIC="C.UTF-8" LC_TIME="C.UTF-8" LC_COLLATE="C.UTF-8" LC_MONETARY="C.UTF-8" LC_MESSAGES="C.UTF-8" LC_PAPER="C.UTF-8" LC_NAME="C.UTF-8" LC_ADDRESS="C.UTF-8" LC_TELEPHONE="C.UTF-8" LC_MEASUREMENT="C.UTF-8" LC_IDENTIFICATION="C.UTF-8" LC_ALL=C.UTF-8

Now

cabox@box-codeanywhere:~/workspace$ panther --help Usage: panther [OPTIONS] COMMAND [ARGS]...

Options: --version Show the version and exit. --help Show this message and exit.

Commands: create:controller Creates a Controller File create:middleware Creates a Middleware create:migration Create a migration file create:model Create Model File create:view Create a View File generate:key Generate the APP KEY migration:reset Reset Migration migration:rollback Roll Back last Migration migration:run Run Migration new Create a new Bast Project run Run your Bast Server

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/moluwole/Bast/issues/14, or mute the thread https://github.com/notifications/unsubscribe-auth/AWWoZ2qgbwX15b20D6EyDEoiG498pRf1ks5uWH-FgaJpZM4WUaHm .

moluwole commented 6 years ago

I think there is a need for a more robust and better way to handle CLI commands