Skip to content

E48: Not allowed in sandbox: scriptencoding utf-8 #5451

@chenzhiwei

Description

@chenzhiwei

Result from CocInfo

## versions

vim version: VIM - Vi IMproved 9.1 9011841
node version: v24.1.0
coc.nvim version: 0.0.82-54079c0 2025-10-13 20:16:26 +0800
coc.nvim directory: /home/xxx/.config/vim/bundle/coc.nvim
term: ghostty
platform: linux

## Log of coc.nvim

2025-10-20T15:23:07.861 INFO (pid:5163) [extension:coc-tabnine] - Using tabnine from /home/xxx/.local/share/coc/extensions/coc-tabnine-data/binaries/4.304.0/x86_64-unknown-linux-musl/TabNine
2025-10-20T15:23:07.988 INFO (pid:5163) [plugin] - coc.nvim initialized with node: v24.1.0 after 249
2025-10-20T15:23:07.990 INFO (pid:5163) [services] - LanguageClient Pyright Server state change: stopped => starting
2025-10-20T15:23:07.998 INFO (pid:5163) [language-client-index] - Language server "pyright" started with 5178
2025-10-20T15:23:08.181 INFO (pid:5163) [services] - LanguageClient Pyright Server state change: starting => running
2025-10-20T15:23:08.186 INFO (pid:5163) [services] - service pyright started
2025-10-20T15:23:11.940 INFO (pid:5163) [attach] - Request action: getTagList []
2025-10-20T15:23:12.028 ERROR (pid:5163) [node-client] - Error event from nvim: 0 Vim(call):E12: Command not allowed from exrc/vimrc in current dir or tag search - on notification "buf_set_var"
/home/xxx/.config/vim/bundle/coc.nvim/autoload/coc/cursor.vim[1]..function coc#api#Notify[6]..coc#api#Buf_set_var, line 2
2025-10-20T15:24:28.893 INFO (pid:5163) [attach] - receive notification: showInfo []

Describe the bug

In a Python project, using ctrl - ] to navigate code, will throw following error.

I tried several commits and found this commit is the reason.

Error detected while processing /home/xxx/.config/vim/bundle/coc.nvim/autoload/coc/cursor.vim:
line    1:
E48: Not allowed in sandbox: scriptencoding utf-8
Press ENTER or type command to continue

Error detected while processing function coc#cursor#move_to[2]..script /home/xxx/.config/vim/bundle/coc.nvim/autoload/coc/string.vim:
line    1:
E48: Not allowed in sandbox: scriptencoding utf-8

Reproduce the bug

We will close your issue when you don't provide minimal vimrc and we can't
reproduce it

  • Create file mini.vim with:
"viminfo file
set viminfofile=~/.config/vim/.viminfo

"swapfile dir
set directory=/tmp//

"vim-plug setting
fun! VimPlug()
    call plug#begin('~/.config/vim/bundle')
        Plug 'neoclide/coc.nvim', {'branch': 'release'}
    call plug#end()
endfun
silent! call VimPlug()

set tagfunc=CocTagFunc
let g:coc_data_home = '~/.local/share/coc'
let g:coc_global_extensions = [
    \'coc-json',
    \'coc-yaml',
    \'coc-pyright',
    \'coc-snippets',
    \'coc-tabnine',
    \'coc-tsserver'
    \]
  • Start vim with command: vim -u mini.vim

  • Operate vim by opening a py file and ctrl - ] navigate code

Screenshots (optional)

If applicable, add screenshots to help explain your problem.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions