question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

django-extensions shell_plus command breaks with ptpython v3.0

See original GitHub issue

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: https://github.com/django-extensions/django-extensions/issues/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):
		...

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:4
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
jonathanslenderscommented, Feb 24, 2020

I just pushed a new release: 3.0.1 Can you see whether everything is fine now?

1reaction
mikaeilorfaniancommented, Feb 24, 2020

hi! any news about this? thank you.

Should’ve been fixed already: https://github.com/prompt-toolkit/ptpython/pull/344 Pip install from GitHub or wait for next release on pypi.

Read more comments on GitHub >

github_iconTop Results From Across the Web

django-extensions/shell_plus.py at main - GitHub
This is a repository for collecting global custom management extensions for the Django Framework. - django-extensions/shell_plus.py at main ...
Read more >
django-extensions Documentation - Read the Docs
synopsis Django shell with autoloading of the apps database models and subclasses of user-defined classes. The default resolution order is:  ...
Read more >
shell_plus — django-extensions 3.2.1 documentation
It is possible to directly add command line arguments to the underlying Python ... The default resolution order is: ptpython, bpython, ipython, python....
Read more >
django-extensions Changelog - pyup.io
Improvement: sqldsn, Added more styles to the sqldsn management command ... Fix: shell_plus, fix postgresql debug wrapper on django 3.0 or higher
Read more >
Unknown command: shell_plus and --settings - Stack Overflow
Make sure you have installed django-extensions . pip install django-extensions. Add django_extensions (note the underscore between) to the ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found