pycscope icon indicating copy to clipboard operation
pycscope copied to clipboard

AttributeError: module 'string' has no attribute 'rstrip'

Open ghost opened this issue 5 years ago • 4 comments

$ pycscope -V
pycscope.py: Version 1.2.1
$ python -V
Python 3.7.3
pycscope -i ./cscope.files
Traceback (most recent call last):
  File "/usr/local/bin/pycscope", line 10, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.7/site-packages/pycscope/__init__.py", line 118, in main
    args.extend(list(map(string.rstrip, open(a, 'r').readlines())))
AttributeError: module 'string' has no attribute 'rstrip'

ghost avatar Jun 27 '19 22:06 ghost

string.lstrip doesn't exist in python 3.7. That line can be rewritten:

args.extend([line.rstrip() for line in open(a, 'r').readlines()])

~That gets pycscope to build my cscope database but cscope database for me. Vim complains:~

cs_read_prompt EOF: No such file or directory
E609: Cscope error: cscope: cannot read list size from file ~/talon/cscope.out

~The database is only 236 KB and looks like a valid plain text file. I'm not sure where the error comes from.~

There are more py3 issues, but #26 fixes them all. Until it's merged, you can grab mayfield's init.py to build a working database.

idbrii avatar Jul 15 '19 23:07 idbrii

Is this issue fixed? If yes, by when will this be merged ?

meenx avatar Nov 04 '20 12:11 meenx

Any update on this issue? Still hitting this issue now when installed by pip install.

xin3liang avatar Jan 07 '21 01:01 xin3liang

Any update on this issue? Still hitting this issue now when installed by pip install.

But when pip install ./pycscope source code, it doesn't encounter this issue. master already has the fixed d991da9d45c6d0a4c6617c267da238a5f1bd2bdf.

xin3liang avatar Jan 07 '21 02:01 xin3liang