Skip to content

Fixed case where extra slash was printing when tab completing users on Windows #493

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

Merged
merged 2 commits into from
Aug 1, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
## 0.8.8 (TBD, 2018)
## 0.8.9 (August TBD, 2018)
* Bug Fixes
* Fixed extra slash that could print when tab completing users on Windows

## 0.8.8 (June 28, 2018)
* Bug Fixes
* Prevent crashes that could occur attempting to open a file in non-existent directory or with very long filename
* Enhancements
Expand Down
9 changes: 6 additions & 3 deletions cmd2.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ def pyreadline_remove_history_item(pos):
pass


__version__ = '0.8.8'
__version__ = '0.8.9'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me


# Pyparsing enablePackrat() can greatly speed up parsing, but problems have been seen in Python 3 in the past
pyparsing.ParserElement.enablePackrat()
Expand Down Expand Up @@ -1694,12 +1694,15 @@ def complete_users():
users = []

# Windows lacks the pwd module so we can't get a list of users.
# Instead we will add a slash once the user enters text that
# Instead we will return a result once the user enters text that
# resolves to an existing home directory.
if sys.platform.startswith('win'):
expanded_path = os.path.expanduser(text)
if os.path.isdir(expanded_path):
users.append(text + os.path.sep)
user = text
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks reasonable

if add_trailing_sep_if_dir:
user += os.path.sep
users.append(user)
else:
import pwd

Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
# The short X.Y version.
version = '0.8'
# The full version, including alpha/beta/rc tags.
release = '0.8.8'
release = '0.8.9'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import setuptools
from setuptools import setup

VERSION = '0.8.8'
VERSION = '0.8.9'
DESCRIPTION = "cmd2 - a tool for building interactive command line applications in Python"
LONG_DESCRIPTION = """cmd2 is a tool for building interactive command line applications in Python. Its goal is to make
it quick and easy for developers to build feature-rich and user-friendly interactive command line applications. It
Expand Down
2 changes: 1 addition & 1 deletion tests/test_cmd2.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@


def test_ver():
assert cmd2.__version__ == '0.8.8'
assert cmd2.__version__ == '0.8.9'


def test_empty_statement(base_app):
Expand Down