Skip to content
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

Update traitlets to 5.1.1 (for python 3.9.8, 3.10) #32852

Closed
EmmanuelCharpentier mannequin opened this issue Nov 10, 2021 · 11 comments
Closed

Update traitlets to 5.1.1 (for python 3.9.8, 3.10) #32852

EmmanuelCharpentier mannequin opened this issue Nov 10, 2021 · 11 comments

Comments

@EmmanuelCharpentier
Copy link
Mannequin

EmmanuelCharpentier mannequin commented Nov 10, 2021

Long story : see sage-support.

TL;DR : On Debian testing, upgrading system Python (to 3.9.8) makes command-line sage crash at startup :

charpent@p-202-021:~$ sage
┌────────────────────────────────────────────────────────────────────┐
│ SageMath version 9.5.beta2, Release Date: 2021-09-26               │
│ Using Python 3.9.8. Type "help()" for help.                        │
└────────────────────────────────────────────────────────────────────┘
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Warning: this is a prerelease version, and it may be unstable.     ┃
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
Traceback (most recent call last):
  File "/usr/local/sage-9/src/bin/sage-ipython", line 15, in <module>
    app.initialize()
  File "/usr/local/sage-9/local/lib/python3.9/site-packages/traitlets/config/application.py", line 88, in inner
    return method(app, *args, **kwargs)
  File "/usr/local/sage-9/local/lib/python3.9/site-packages/IPython/terminal/ipapp.py", line 308, in initialize
    super(TerminalIPythonApp, self).initialize(argv)
  File "/usr/local/sage-9/local/lib/python3.9/site-packages/traitlets/config/application.py", line 88, in inner
    return method(app, *args, **kwargs)
  File "/usr/local/sage-9/local/lib/python3.9/site-packages/IPython/core/application.py", line 450, in initialize
    self.parse_command_line(argv)
  File "/usr/local/sage-9/local/lib/python3.9/site-packages/IPython/terminal/ipapp.py", line 303, in parse_command_line
    return super(TerminalIPythonApp, self).parse_command_line(argv)
  File "/usr/local/sage-9/local/lib/python3.9/site-packages/traitlets/config/application.py", line 88, in inner
    return method(app, *args, **kwargs)
  File "/usr/local/sage-9/local/lib/python3.9/site-packages/traitlets/config/application.py", line 709, in parse_command_line
    self.cli_config = deepcopy(loader.load_config())
  File "/usr/local/sage-9/local/lib/python3.9/site-packages/traitlets/config/loader.py", line 851, in load_config
    self._parse_args(argv)
  File "/usr/local/sage-9/local/lib/python3.9/site-packages/traitlets/config/loader.py", line 908, in _parse_args
    self.parsed_data = self.parser.parse_args(to_parse)
  File "/usr/lib/python3.9/argparse.py", line 1834, in parse_args
    args, argv = self.parse_known_args(args, namespace)
  File "/usr/local/sage-9/local/lib/python3.9/site-packages/traitlets/config/loader.py", line 768, in parse_known_args
    return super().parse_known_args(args, namespace)
  File "/usr/lib/python3.9/argparse.py", line 1862, in parse_known_args
    namespace, args = self._parse_known_args(args, namespace)
  File "/usr/lib/python3.9/argparse.py", line 2076, in _parse_known_args
    start_index = consume_optional(start_index)
  File "/usr/lib/python3.9/argparse.py", line 2016, in consume_optional
    take_action(action, args, option_string)
  File "/usr/lib/python3.9/argparse.py", line 1944, in take_action
    action(self, namespace, argument_values, option_string)
  File "/usr/local/sage-9/local/lib/python3.9/site-packages/traitlets/config/loader.py", line 933, in __call__
    namespace._flags.append(self.flag)
AttributeError: 'Namespace' object has no attribute '_flags'

Neither recompiling IPython nor the whole thing is effective.

Obvious (but painful) workaround :

./configure --with-system-python3=no && make

Component: packages: standard

Author: Matthias Koeppe

Branch/Commit: bbe3f33

Reviewer: Emmanuel Charpentier

Issue created by migration from https://trac.sagemath.org/ticket/32852

@EmmanuelCharpentier EmmanuelCharpentier mannequin added this to the sage-9.5 milestone Nov 10, 2021
@mkoeppe
Copy link
Contributor

mkoeppe commented Nov 10, 2021

@mkoeppe
Copy link
Contributor

mkoeppe commented Nov 10, 2021

Commit: bbe3f33

@mkoeppe
Copy link
Contributor

mkoeppe commented Nov 10, 2021

comment:2

Please try if this update helps; it is advertised to have fixes for python 3.10, but maybe it helps for 3.9.8 too


New commits:

bbe3f33build/pkgs/traitlets: Update to 5.1.1

@dimpase
Copy link
Member

dimpase commented Nov 10, 2021

comment:3

SageMath version 9.5.beta2 is old. Can you test with the current beta5 instead?

@EmmanuelCharpentier
Copy link
Mannequin Author

EmmanuelCharpentier mannequin commented Nov 10, 2021

comment:4

Replying to @dimpase:

SageMath version 9.5.beta2 is old. Can you test with the current beta5 instead?

This patch allows Sage 9.5.beta5 to be configured wit system Python at 3.9.8 and run successfully from the command line.

Running ptestlong...

@mkoeppe
Copy link
Contributor

mkoeppe commented Nov 10, 2021

Author: Matthias Koeppe

@mkoeppe mkoeppe changed the title Upgrading system Python to 3.9.8 makes command-line sage crash at startup. Update traitlets to 5.1.1 (for python 3.9.8, 3.10) Nov 10, 2021
@EmmanuelCharpentier
Copy link
Mannequin Author

EmmanuelCharpentier mannequin commented Nov 11, 2021

Reviewer: Emmanuel Charpentier

@EmmanuelCharpentier
Copy link
Mannequin Author

EmmanuelCharpentier mannequin commented Nov 11, 2021

comment:6

Replying to @EmmanuelCharpentier:

Replying to @dimpase:

SageMath version 9.5.beta2 is old. Can you test with the current beta5 instead?

This patch allows Sage 9.5.beta5 to be configured wit system Python at 3.9.8 and run successfully from the command line.

Running ptestlong...

Passes ptestlong with no novel problem. ==> positive_review.

A crosscheck on other systems may be useful...

@mkoeppe
Copy link
Contributor

mkoeppe commented Nov 11, 2021

comment:7

Thanks for testing!

@jhpalmieri
Copy link
Member

comment:8

Seems necessary on various systems, so it should be a blocker.

@vbraun
Copy link
Member

vbraun commented Nov 14, 2021

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants