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

pathlib Path.home() causing error #280

Closed
cquest opened this issue Mar 4, 2017 · 3 comments
Closed

pathlib Path.home() causing error #280

cquest opened this issue Mar 4, 2017 · 3 comments
Milestone

Comments

@cquest
Copy link
Member

cquest commented Mar 4, 2017

Traceback (most recent call last):
  File "/home/addok/.virtualenvs/addok2/bin/addok", line 9, in <module>
    load_entry_point('addok==1.0.0.rc.1', 'console_scripts', 'addok')()
  File "/home/addok/.virtualenvs/addok2/lib/python3.4/site-packages/addok/bin/__init__.py", line 27, in main
    args.func(args)
  File "/home/addok/.virtualenvs/addok2/lib/python3.4/site-packages/addok/shell.py", line 477, in invoke
    cmd = Cmd()
  File "/home/addok/.virtualenvs/addok2/lib/python3.4/site-packages/addok/shell.py", line 38, in __init__
    self._init_history_file()
  File "/home/addok/.virtualenvs/addok2/lib/python3.4/site-packages/addok/shell.py", line 45, in _init_history_file
    readline.read_history_file(self.history_file)
  File "/home/addok/.virtualenvs/addok2/lib/python3.4/site-packages/addok/shell.py", line 59, in history_file
    return str(Path.home() / self.HISTORY_FILE)
AttributeError: type object 'Path' has no attribute 'home'

Following code is fine:
return str(os.path.expanduser('~')+'/'+self.HISTORY_FILE)

@cquest cquest added this to the 1.0.0 milestone Mar 4, 2017
cquest added a commit that referenced this issue Mar 4, 2017
@davidbgk
Copy link
Contributor

davidbgk commented Mar 4, 2017

@cquest which version of Python are you using?

@davidbgk
Copy link
Contributor

davidbgk commented Mar 4, 2017

Path.home() has been introduced in Python 3.5

@cquest
Copy link
Member Author

cquest commented Mar 4, 2017

3.4... the alternative code is fine with 3.4 ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants