Python error when executing :shell or :term

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Python error when executing :shell or :term

Chris Sutcliffe-2
Hi,

When I execute :shell or :term I get the following error:

Fatal Python error: config_get_locale_encoding: failed to get the locale encoding: nl_langinfo(CODESET) failed
Python runtime state: preinitialized

Any ideas how to correct this?

Thanks!

--
--
You received this message from the "vim_mac" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_mac" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_mac/db653481-3ccb-474f-b9ed-6c58d5f9956a%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: Python error when executing :shell or :term

Chris Sutcliffe-2
Some additional information - it's related to the locale settings when run directly as an application due to the encoding (the ".UTF-8") not being present.  If I execute:

open /Applications/MacVim.app

it works fine because the locale settings are correct in a terminal.

On Wednesday, 1 April 2020 13:14:56 UTC-4, Chris Sutcliffe wrote:
Hi,

When I execute :shell or :term I get the following error:

Fatal Python error: config_get_locale_encoding: failed to get the locale encoding: nl_langinfo(CODESET) failed
Python runtime state: preinitialized

Any ideas how to correct this?

Thanks!

--
--
You received this message from the "vim_mac" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_mac" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_mac/f36a2948-082a-4aa0-b2dd-6fb7952f6609%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: Python error when executing :shell or :term

Pinnacle Systems Group
In reply to this post by Chris Sutcliffe-2
Chris

First check this .....

PYTHONHOME=/usr/local/Cellar/python3/3.x.y/Frameworks/Python.framework/Versions/3.x
PYTHONPATH=$PYTHONHOME/bin


Then look at this URL




On Wednesday, April 1, 2020, Chris Sutcliffe <[hidden email]> wrote:
Hi,

When I execute :shell or :term I get the following error:

Fatal Python error: config_get_locale_encoding: failed to get the locale encoding: nl_langinfo(CODESET) failed
Python runtime state: preinitialized

Any ideas how to correct this?

Thanks!

--
--
You received this message from the "vim_mac" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_mac" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_mac/db653481-3ccb-474f-b9ed-6c58d5f9956a%40googlegroups.com.

--
--
You received this message from the "vim_mac" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_mac" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_mac/CABWxWzoLXyuL5QwGZ%3DEUvgcumvmL9wD6%2BQKF%2BLcpnYxt8VjROQ%40mail.gmail.com.
Reply | Threaded
Open this post in threaded view
|

Re: Python error when executing :shell or :term

Chris Sutcliffe-2
Hi,

First check this .....

PYTHONHOME=/usr/local/Cellar/python3/3.x.y/Frameworks/Python.framework/Versions/3.x
PYTHONPATH=$PYTHONHOME/bin


Then look at this URL


<a href="https://stackoverflow.com/questions/5694706/py-initialize-fails-unable-to-load-the-file-system-codec/45423949#45423949" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fstackoverflow.com%2Fquestions%2F5694706%2Fpy-initialize-fails-unable-to-load-the-file-system-codec%2F45423949%2345423949\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNF9UcdOROhI6q6JJb9Na7J3FqpMBw&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fstackoverflow.com%2Fquestions%2F5694706%2Fpy-initialize-fails-unable-to-load-the-file-system-codec%2F45423949%2345423949\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNF9UcdOROhI6q6JJb9Na7J3FqpMBw&#39;;return true;">https://stackoverflow.com/questions/5694706/py-initialize-fails-unable-to-load-the-file-system-codec/45423949#45423949

I'm not sure if this is related.  Checking PYTHONHOME and PYTHONPATH, both are unset in my environment.  Additionally, as per my follow-up, it seems to be related to the encoding being stripped from the LC_* variables when MacVim is launched directly (as opposed to being opened from a terminal where the LC_* variable are set correctly).  I see terminal apps have the option to set text encoding, not sure if it's possible to configure that in MacVim.

--
--
You received this message from the "vim_mac" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_mac" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_mac/696e3f00-5113-47a1-986a-89d1872c254b%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: Python error when executing :shell or :term

Chris Sutcliffe-2
To close on this issue, I've found a workaround and identified the issue to the MacVim team:

https://github.com/macvim-dev/macvim/issues/1033

Cheers!

--
--
You received this message from the "vim_mac" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_mac" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_mac/61229e75-6953-4658-a6e2-8c0dde3da953%40googlegroups.com.