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
IPython ProfileDirError if IPython was never run #15972
Comments
comment:1
This seems to fix it. Is the right approach? diff --git a/src/sage/misc/interpreter.py b/src/sage/misc/interpreter.py
index aff78f7..349e9dc 100644
--- a/src/sage/misc/interpreter.py
+++ b/src/sage/misc/interpreter.py
@@ -614,7 +614,7 @@ class SageTerminalApp(TerminalIPythonApp):
def load_config_file(self, *args, **kwds):
from IPython.config.loader import PyFileConfigLoader, ConfigFileNotFound
- from IPython.core.profiledir import ProfileDir
+ from IPython.core.profiledir import ProfileDir, ProfileDirError
from IPython.utils.path import get_ipython_dir
conf = Config()
@@ -622,8 +622,13 @@ class SageTerminalApp(TerminalIPythonApp):
conf._merge(self.command_line_config)
# Get user config.
- sage_profile_dir = ProfileDir.find_profile_dir_by_name(
- get_ipython_dir(), 'sage').location
+ try:
+ sage_profile_dir = ProfileDir.find_profile_dir_by_name(
+ get_ipython_dir(), 'sage').location
+ except ProfileDirError:
+ d = ProfileDir.create_profile_dir_by_name(
+ get_ipython_dir(), 'sage')
+ sage_profile_dir = d.location
try:
cl = PyFileConfigLoader('ipython_config.py', sage_profile_dir)
conf._merge(cl.load_config()) |
comment:2
looks good to me |
comment:3
Okay, here's a branch with the changes. New commits:
|
Author: John Palmieri |
Commit: |
Branch: u/jhpalmieri/ipython-profile-dir |
comment:4
Is there any reasonable way to add tests for this method? |
comment:5
Testing with |
comment:6
I more meant are there any reasonable doctests that could be added to this method? (Although what you mentioned is good as well) |
comment:7
I don't understand the description. Does running Tests that combinations of commandline parameters work belong into doctests, not in a special buildbot config. |
comment:8
If a user has never run Sage before, they will see this error when doing What Jeroen is saying is that all doctests should pass when you run with |
comment:9
So you are saying that it fails without You don't test the ipython profile creation any better by running the entire testsuite with |
comment:10
I didn't write the description, but I think that As far as reviewing goes, this should have been caught at #14713 (by the reviewer running tests with |
comment:11
How about this? |
Branch pushed to git repo; I updated commit sha1. New commits:
|
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
comment:14
Replying to @vbraun:
Fixed that.
Testing everything with
In which sense does it "not scale"? I did that and it worked for me perfectly, there are very few tickets which would fail this test. The release manager already is a second reviewer, given that something like 10% of all positively reviewed tickets simply fail when tested on the buildbots (maybe less now that docbuild errors are caught earlier). |
Reviewer: Volker Braun |
Changed branch from u/jhpalmieri/ipython-profile-dir to |
The following fails if IPython was never run before:
Running
./sage
once fixes this problem but the following always fails:CC: @vbraun @jasongrout @williamstein @roed314
Component: interfaces
Author: John Palmieri
Branch/Commit:
53a7d7f
Reviewer: Volker Braun
Issue created by migration from https://trac.sagemath.org/ticket/15972
The text was updated successfully, but these errors were encountered: