Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ghost opened this issue Jun 27, 2019 · 4 comments
Open

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

ghost opened this issue Jun 27, 2019 · 4 comments
Assignees
Labels
bug py3 Or and related to Python 3 work
Milestone

Comments

@ghost
Copy link

ghost commented Jun 27, 2019

$ 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'
@idbrii
Copy link

idbrii commented Jul 15, 2019

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.

@portante portante added bug py3 Or and related to Python 3 work labels Oct 18, 2019
@portante portante added this to the Kili milestone Oct 18, 2019
@portante portante self-assigned this Oct 18, 2019
@meenx
Copy link

meenx commented Nov 4, 2020

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

@xin3liang
Copy link

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

@xin3liang
Copy link

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 d991da9.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug py3 Or and related to Python 3 work
Projects
None yet
Development

No branches or pull requests

4 participants