Problem / Example
Project: django-extensions's ./manage.py shell_plus - runs into this if no config is set:
./manage.py shell_plus
<loading django imports>
Impossible to read '/Users/<username>/.config/ptpython/config.py'
This creates friction when launching ptpython:
- Users are accustomed to default behavior when launching apps, absent explicit action on their part.
- Cloud environments and ephemeral systems can't easily control that file - I propose it's more common than just I - are interrupted by an error.
Other cases
Comments desiring to suppress "Impossible to read": #329 (comment)
I would propose there are others hitting this issue but it hasn't been articulated correctly yet.
Proposal
"Impossible to read" shouldn't print / interrupt loading when the no config file is found
PRs
2 ideas / approaches:
Relevant code
ptpython.repl.run_config()
ptpython.repl.embed()
Analysis
ptpython.repl.run_config() has a default argument of config_file: str = "~/.config/ptpython/config.py"
However, in most command line applications, no configuration file exists - there's sensible defaults. e.g. python can load without the user having a pythonrc, tmux can load without a ~/.tmux.conf, etc.
The existing behavior means users simply wanting to enter are given an error that's not their fault: config_file was entered by ptpython and downstream users that don't have it in place are interrupted.
Problem / Example
Project: django-extensions's
./manage.py shell_plus- runs into this if no config is set:This creates friction when launching ptpython:
Other cases
Comments desiring to suppress "Impossible to read": #329 (comment)
I would propose there are others hitting this issue but it hasn't been articulated correctly yet.
Proposal
"Impossible to read" shouldn't print / interrupt loading when the no config file is found
PRs
2 ideas / approaches:
run_config(): skip interrupt ifconfig_filenot found #550run_config(): skip interrupt unless explicitly passedconfig_file#551Relevant code
ptpython.repl.run_config()ptpython.repl.embed()Analysis
ptpython.repl.run_config()has a default argument ofconfig_file: str = "~/.config/ptpython/config.py"However, in most command line applications, no configuration file exists - there's sensible defaults. e.g.
pythoncan load without the user having apythonrc,tmuxcan load without a~/.tmux.conf, etc.The existing behavior means users simply wanting to enter are given an error that's not their fault:
config_filewas entered byptpythonand downstream users that don't have it in place are interrupted.