-
-
Notifications
You must be signed in to change notification settings - Fork 200
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
Command line flag do not take precedence over config. #248
Comments
Yup, this is pretty bad... We need to add a test for this via a subprocess call to make sure it doesn't return. |
There were quite a few regression in traitlets since 4.0, especially because the 4.x serie will impact LTS, I would really like to slow down on traitlets new feature and pay attention on quality and stability. I think that things like #246, #242 , #230 are unnecessary and should be maybe reconsidered if we can't keep the core features stable. |
Pretty sure I know roughly what I did to cause this. Assigning self to investigate. |
It turns out the bug is in IPython (which does the CLI priority bit, not traitlets), but I think I can be defensive in traitlets and reintroduce the less-than-ideal behavior that IPython is implicitly relying upon. IPython is relying on an improvement / bugfix in traitlets not being present (#42). The removal of deepcopy means that update_config actually updates config (correct behavior post-4.1), rather than removing and replacing it (problematic behavior in 4.0 and earlier, causing duplicate events to fire). IPython does this: self.parse_command_line()
# save CLI config for later
cli_config = self.config
# implicitly assume that this replaces instead of modifying self.config
self.load_config_files()
# reapply cli_config to restore priority, assuming self.config is not the same object as self.config two lines ago
self.update_config(cli_config) IPython relies on
|
#249 is the 4.2.2 fix |
Awesome ! Thank for the in depth explanation ! On Fri, Jun 24, 2016 at 2:26 PM, Min RK notifications@github.com wrote:
|
ipython/ipython#9660 is the IPython fix |
And #250 is the traitlets (4.3) fix that should make it harder to reintroduce this bug in the future. |
Thanks so much @minrk for this and the multiple PRs! |
Sorry, I closed it thinking only of master/5.0, I guess it stays open as a backport. |
when saving CLI config to reload later for highest priority. traitlets 4.1-4.2.1 don't recreate self.config in update_config (rightly so), so when saving CLI config for later re-loading, make sure it's a copy so it doesn't get changed during config file loading, which defeats the purpose. To me, this is the real fix for ipython/traitlets#248
Copy self.config in update_config This protects IPython's CLI priority, which accidentally relies upon self.config being replaced during load_config_files. This will be backported to 4.2.2 Closes #248.
Reopening it so ipython/ipython#9660 can be the real closer of the backport. |
Hum, ipython/ipython#9660 has been merged (and backported), Did you mean #250 ? |
Ah, sorry! Then I'm confused: is this really targeting a 4.2.2 backport, or only 4.3? Because the main fixed was merged in master (hence for 5.0)... |
The fix is #250, ipython/ipython#9660 is a "workaround". |
More precisely, ipython/ipython#9660 use traitlets API in the way it's supposed to be used,. |
I created a 4.2.x branch from 4.2.1 with #249. I can release that now as 4.2.2, unless there's anything else we want in there. Closing this one, as the backports on both traitlets and IPython have been made. |
@Carreau, @takluyver, anything else you think is critical for 4.2.2? |
Not from the top of my head, but I'm not following traitlets too much these days. |
Ditto |
Green light then, @minrk! |
Thanks, released. |
Appreciate that ! Thanks Min ! On Fri, Jul 1, 2016 at 2:20 AM, Min RK notifications@github.com wrote:
|
Cf ipython/ipython#9655 (comment)
Marking as critical as this was release in 4.1.
The text was updated successfully, but these errors were encountered: