Skip to content

django-extensions shell_plus command breaks with ptpython v3.0 #338

@blackrobot

Description

@blackrobot

The django-extensions package's shell_plus command doesn't work with v3.0 of ptpython.

I've also opened an issue on django-extensions detailing the problem:
django-extensions/django-extensions#1473

It seems like this may be a problem with the changes in the run_config function. The breaking changes from v2.0.5 to v3.0.0 can be seen here:

- def run_config(repl, config_file='~/.ptpython/config.py'):
+ def run_config(repl: PythonInput, config_file: str) -> None:

What was the reason for removing the default config_file argument? Would it be ok to add the updated default path back?

default_config_file = os.path.join(
    appdirs.user_config_dir("ptpython", "prompt_toolkit"),
    "config.py",
)

def run_config(repl: PythonInput, config_file: str = None) -> None:
    if not config_file:
        # try the default
		if os.path.exists(default_config_file):
			config_file = default_config_file
	elif not os.path.exists(config_file):
		...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions