You are not logged in.
Update and TLDR: For some reason, the youcompleteme vim plugin caused vim to crash in directories when any file named codecs.py or codecs.pyc was present.
In certain directories, vim does not work. It crashes immediately with a corruptly printed and not fully visible error message. In most directories there is no problem. Same problem for both bash and zsh, as well as in the virtual console. Tested with empty vimrc.
Steps to reproduce (on my system, but probably not yours?):
(1) Download and unpack Python source: https://www.python.org/ftp/python/3.4.2 … -3.4.2.tgz
(2)
cd /path-to-python-source/Lib/
(3)
vim
Update:
touch codecs.py
vim
Screenshot of error: http://i.imgur.com/qSUvUe6.png
Video of error: https://vid.me/3wfS
% pacman -Qi vim
Name : vim
Version : 7.4.537-1
Description : Vi Improved, a highly configurable, improved version of the vi text editor (with support for additional scripting languages)
Architecture : x86_64
URL : http://www.vim.org
Licenses : custom:vim
Groups : None
Provides : None
Depends On : vim-runtime=7.4.537-1 gpm ruby lua python2 acl
Optional Deps : None
Required By : vim-youcompleteme-git
Optional For : pacmatic
Conflicts With : vim-minimal vim-python3 gvim gvim-python3
Replaces : None
Installed Size : 2.42 MiB
Packager : Anatol Pomozov <anatol.pomozov@gmail.com>
Build Date : Sat 29 Nov 2014 06:49:46 PM CET
Install Date : Thu 08 Jan 2015 10:59:36 PM CET
Install Reason : Explicitly installed
Install Script : No
Validated By : Signature
% vim --version
VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Nov 29 2014 09:47:39)
Included patches: 1-537
Compiled by Arch Linux
Huge version without GUI. Features included (+) or not (-):
+acl +farsi +mouse_netterm +syntax
+arabic +file_in_path +mouse_sgr +tag_binary
+autocmd +find_in_path -mouse_sysmouse +tag_old_static
-balloon_eval +float +mouse_urxvt -tag_any_white
-browse +folding +mouse_xterm -tcl
++builtin_terms -footer +multi_byte +terminfo
+byte_offset +fork() +multi_lang +termresponse
+cindent +gettext -mzscheme +textobjects
-clientserver -hangul_input +netbeans_intg +title
-clipboard +iconv +path_extra -toolbar
+cmdline_compl +insert_expand +perl +user_commands
+cmdline_hist +jumplist +persistent_undo +vertsplit
+cmdline_info +keymap +postscript +virtualedit
+comments +langmap +printer +visual
+conceal +libcall +profile +visualextra
+cryptv +linebreak +python +viminfo
+cscope +lispindent -python3 +vreplace
+cursorbind +listcmds +quickfix +wildignore
+cursorshape +localmap +reltime +wildmenu
+dialog_con +lua +rightleft +windows
+diff +menu +ruby +writebackup
+digraphs +mksession +scrollbind -X11
-dnd +modify_fname +signs -xfontset
-ebcdic +mouse +smartindent -xim
+emacs_tags -mouseshape -sniff -xsmp
+eval +mouse_dec +startuptime -xterm_clipboard
+ex_extra +mouse_gpm +statusline -xterm_save
+extra_search -mouse_jsbterm -sun_workshop -xpm
system vimrc file: "/etc/vimrc"
user vimrc file: "$HOME/.vimrc"
2nd user vimrc file: "~/.vim/vimrc"
user exrc file: "$HOME/.exrc"
fall-back for $VIM: "/usr/share/vim"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -D_FORTIFY_SOURCE=2 -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong --param=ssp-buffer-size=4 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linking: gcc -L. -Wl,-O1,--sort-common,--as-needed,-z,relro -fstack-protector -rdynamic -Wl,-export-dynamic -Wl,-E -Wl,-rpath,/usr/lib/perl5/core_perl/CORE -Wl,-O1,--sort-common,--as-needed,-z,relro -L/usr/local/lib -Wl,--as-needed -o vim -lm -lncurses -lelf -lnsl -lacl -lattr -lgpm -ldl -L/usr/lib -llua -Wl,-E -Wl,-rpath,/usr/lib/perl5/core_perl/CORE -Wl,-O1,--sort-common,--as-needed,-z,relro -fstack-protector -L/usr/local/lib -L/usr/lib/perl5/core_perl/CORE -lperl -lnsl -ldl -lm -lcrypt -lutil -lpthread -lc -L/usr/lib/python2.7/config -lpython2.7 -lpthread -ldl -lutil -lm -Xlinker -export-dynamic -lruby -lpthread -lgmp -ldl -lcrypt -lm -L/usr/lib
Last edited by anderslundstedt (2015-01-08 23:59:36)
Offline
I can't reproduce that bug here, but you are using an outdated version of vim. Try running a pacman -Syu to update your system, then see if the bug persists.
Welcome to the forums.
Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD
Making lemonade from lemons since 2015.
Offline
... you are using an outdated version of vim. Try running a pacman -Syu to update your system, then see if the bug persists.
According to pacman my vim is up to date. pacman -Syu does nothing. Strange ...
Offline
Perhaps your mirror is out of date. Try switching to another and forcing a refresh of the pacman databases.
Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD
Making lemonade from lemons since 2015.
Offline
I have now narrowed down the problem considerably.
Steps to reproduce (for me):
cd $(mktemp -d)
wget https://raw.githubusercontent.com/python/cpython/master/Lib/codecs.py
vim
What is up with that codecs.py file?
Last edited by anderslundstedt (2015-01-08 23:11:46)
Offline
What is up with that codecs.py file?
Nothing. I also can't reproduce the error. So the problem is not with that file.
Can you try with another user (and/or root)?
"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" - Richard Stallman
Offline
anderslundstedt wrote:What is up with that codecs.py file?
Nothing. I also can't reproduce the error. So the problem is not with that file.
Well, obviously there is something in with that file causing vim to fail on my system. (Which is not to say that there is something wrong with the file.)
Can you try with another user (and/or root)?
The problem is not present when running as root.
Last edited by anderslundstedt (2015-01-08 23:51:17)
Offline
Narrowed down. Steps to reproduce:
touch codecs.py
vim
Why could the filename codecs.py be problematic?
Offline
Solved:
sudo pacman -Rs vim-youcompleteme-git
For some reason, youcompleteme caused this error. Will look further into that and perhaps provide an update.
Offline
All these files have "import codecs" in their code:
argparse/test/test_argparse.py
requests/requests/utils.py
requests/requests/packages/urllib3/filepost.py
requests/requests/packages/chardet/universaldetector.py
YouCompleteMe/third_party/ycmd/third_party/requests/requests/utils.py
YouCompleteMe/third_party/ycmd/third_party/requests/requests/packages/urllib3/filepost.py
YouCompleteMe/third_party/ycmd/third_party/requests/requests/packages/chardet/universaldetector.py
YouCompleteMe/third_party/ycmd/third_party/argparse/test/test_argparse.py
YouCompleteMe/third_party/requests/requests/utils.py
YouCompleteMe/third_party/requests/requests/packages/urllib3/filepost.py
YouCompleteMe/third_party/requests/requests/packages/chardet/universaldetector.py
At least one of them seems to be trying to import the file from the current working directory rather than the proper path.
"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" - Richard Stallman
Offline
All these files have "import codecs" in their code:
...
At least one of them seems to be trying to import the file from the current working directory rather than the proper path.
Thanks. Will file a bug report.
Offline
As I've only tinkered a bit with python, I don't know the right way to do it - it seems this type of error can be found all over the web, and in postings from ~2008 this was discussed quite a bit. I can't imagine this problem hasn't been solved, and there is a "proper" way to import modules that will not be this fragile.
"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" - Richard Stallman
Offline
There is a proper way (absolute imports).
Offline
Ah, thanks - I learned something too
(I just looked up absolute imports and found a S.O. thread. This might be old news to pythoners - but as one who's written probably less that 100 lines of python this is new)
"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" - Richard Stallman
Offline