Skip to content

Conversation

@kwankyu
Copy link
Collaborator

@kwankyu kwankyu commented Nov 4, 2025

Fix a bug discussed in https://groups.google.com/g/sage-devel/c/rxfhmspCeuw

📝 Checklist

  • The title is concise and informative.
  • The description explains in detail what this PR is about.
  • I have linked a relevant issue or discussion.
  • I have created tests covering the changes.
  • I have updated the documentation and checked the documentation preview.

⌛ Dependencies

@kwankyu kwankyu marked this pull request as ready for review November 4, 2025 13:19
@github-actions
Copy link

github-actions bot commented Nov 4, 2025

Documentation preview for this PR (built with commit c157057; changes) is ready! 🎉
This preview will update shortly after each push to this PR.

@kwankyu
Copy link
Collaborator Author

kwankyu commented Nov 5, 2025

Thanks!

vbraun pushed a commit to vbraun/sage that referenced this pull request Nov 8, 2025
sagemathgh-41132: Check sagemath kernel integrity robustly
    
<!-- ^ Please provide a concise and informative title. -->
<!-- ^ Don't put issue numbers in the title, do this in the PR
description below. -->
<!-- ^ For example, instead of "Fixes sagemath#12345" use "Introduce new method
to calculate 1 + 2". -->
<!-- v Describe your changes below in detail. -->
<!-- v Why is this change required? What problem does it solve? -->
<!-- v If this PR resolves an open issue, please link to it here. For
example, "Fixes sagemath#12345". -->

Fix a bug discussed in https://groups.google.com/g/sage-
devel/c/rxfhmspCeuw

### 📝 Checklist

<!-- Put an `x` in all the boxes that apply. -->

- [x] The title is concise and informative.
- [x] The description explains in detail what this PR is about.
- [x] I have linked a relevant issue or discussion.
- [ ] I have created tests covering the changes.
- [ ] I have updated the documentation and checked the documentation
preview.

### ⌛ Dependencies

<!-- List all open PRs that this PR logically depends on. For example,
-->
<!-- - sagemath#12345: short description why this is a dependency -->
<!-- - sagemath#34567: ... -->
    
URL: sagemath#41132
Reported by: Kwankyu Lee
Reviewer(s):
vbraun pushed a commit to vbraun/sage that referenced this pull request Nov 8, 2025
sagemathgh-41132: Check sagemath kernel integrity robustly
    
<!-- ^ Please provide a concise and informative title. -->
<!-- ^ Don't put issue numbers in the title, do this in the PR
description below. -->
<!-- ^ For example, instead of "Fixes sagemath#12345" use "Introduce new method
to calculate 1 + 2". -->
<!-- v Describe your changes below in detail. -->
<!-- v Why is this change required? What problem does it solve? -->
<!-- v If this PR resolves an open issue, please link to it here. For
example, "Fixes sagemath#12345". -->

Fix a bug discussed in https://groups.google.com/g/sage-
devel/c/rxfhmspCeuw

### 📝 Checklist

<!-- Put an `x` in all the boxes that apply. -->

- [x] The title is concise and informative.
- [x] The description explains in detail what this PR is about.
- [x] I have linked a relevant issue or discussion.
- [ ] I have created tests covering the changes.
- [ ] I have updated the documentation and checked the documentation
preview.

### ⌛ Dependencies

<!-- List all open PRs that this PR logically depends on. For example,
-->
<!-- - sagemath#12345: short description why this is a dependency -->
<!-- - sagemath#34567: ... -->
    
URL: sagemath#41132
Reported by: Kwankyu Lee
Reviewer(s):
@vbraun
Copy link
Member

vbraun commented Nov 9, 2025

I'm getting

File "src/sage/repl/ipython_kernel/install.py", line 253, in sage.repl.ipython_kernel.install.SageKernelSpec.check
Failed example:
    SageKernelSpec.check()  # random
Exception raised:
    Traceback (most recent call last):
      File "/Users/buildbot-sage/worker/sage_git/build/src/sage/doctest/forker.py", line 734, in _run
        self.compile_and_execute(example, compiler, test.globs)
      File "/Users/buildbot-sage/worker/sage_git/build/src/sage/doctest/forker.py", line 1158, in compile_and_execute
        exec(compiled, globs)
      File "<doctest sage.repl.ipython_kernel.install.SageKernelSpec.check[1]>", line 1, in <module>
        SageKernelSpec.check()  # random
        ^^^^^^^^^^^^^^^^^^^^^^
      File "/Users/buildbot-sage/worker/sage_git/build/src/sage/repl/ipython_kernel/install.py", line 267, in check
        if Path(shutil.which(spec.argv[0])).resolve() != Path(sys.executable).resolve():
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/Users/buildbot-sage/worker/sage_git/build/local/var/lib/sage/venv-python3.12.5/lib/python3.12/pathlib.py", line 1162, in __init__
        super().__init__(*args)
      File "/Users/buildbot-sage/worker/sage_git/build/local/var/lib/sage/venv-python3.12.5/lib/python3.12/pathlib.py", line 373, in __init__
        raise TypeError(
    TypeError: argument should be a str or an os.PathLike object where __fspath__ returns a str, not 'NoneType'

on some platforms, e.g. http://build.sagemath.org/#/builders/68/builds/6

@kwankyu
Copy link
Collaborator Author

kwankyu commented Nov 9, 2025

The patch will deal with the NoneType case.

vbraun pushed a commit to vbraun/sage that referenced this pull request Nov 9, 2025
sagemathgh-41132: Check sagemath kernel integrity robustly
    
<!-- ^ Please provide a concise and informative title. -->
<!-- ^ Don't put issue numbers in the title, do this in the PR
description below. -->
<!-- ^ For example, instead of "Fixes sagemath#12345" use "Introduce new method
to calculate 1 + 2". -->
<!-- v Describe your changes below in detail. -->
<!-- v Why is this change required? What problem does it solve? -->
<!-- v If this PR resolves an open issue, please link to it here. For
example, "Fixes sagemath#12345". -->

Fix a bug discussed in https://groups.google.com/g/sage-
devel/c/rxfhmspCeuw

### 📝 Checklist

<!-- Put an `x` in all the boxes that apply. -->

- [x] The title is concise and informative.
- [x] The description explains in detail what this PR is about.
- [x] I have linked a relevant issue or discussion.
- [ ] I have created tests covering the changes.
- [ ] I have updated the documentation and checked the documentation
preview.

### ⌛ Dependencies

<!-- List all open PRs that this PR logically depends on. For example,
-->
<!-- - sagemath#12345: short description why this is a dependency -->
<!-- - sagemath#34567: ... -->
    
URL: sagemath#41132
Reported by: Kwankyu Lee
Reviewer(s):
@vbraun
Copy link
Member

vbraun commented Nov 9, 2025

Now getting

**********************************************************************
File "src/sage/repl/ipython_kernel/install.py", line 253, in sage.repl.ipython_kernel.install.SageKernelSpec.check
Failed example:
    SageKernelSpec.check()  # random
Exception raised:
    Traceback (most recent call last):
      File "/Users/buildbot-sage/worker/sage_git/build/src/sage/doctest/forker.py", line 734, in _run
        self.compile_and_execute(example, compiler, test.globs)
      File "/Users/buildbot-sage/worker/sage_git/build/src/sage/doctest/forker.py", line 1158, in compile_and_execute
        exec(compiled, globs)
      File "<doctest sage.repl.ipython_kernel.install.SageKernelSpec.check[1]>", line 1, in <module>
        SageKernelSpec.check()  # random
        ^^^^^^^^^^^^^^^^^^^^^^
      File "/Users/buildbot-sage/worker/sage_git/build/src/sage/repl/ipython_kernel/install.py", line 272, in check
        if Path(kernel_executable).resolve() != Path(sys.executable).resolve():
           ^^^^^^^^^^^^^^^^^^^^^^^
      File "/Users/buildbot-sage/worker/sage_git/build/local/var/lib/sage/venv-python3.12.5/lib/python3.12/pathlib.py", line 1162, in __init__
        super().__init__(*args)
      File "/Users/buildbot-sage/worker/sage_git/build/local/var/lib/sage/venv-python3.12.5/lib/python3.12/pathlib.py", line 373, in __init__
        raise TypeError(
    TypeError: argument should be a str or an os.PathLike object where __fspath__ returns a str, not 'NoneType'
**********************************************************************
1 item had failures:
   1 of   3 in sage.repl.ipython_kernel.install.SageKernelSpec.check
    [35 tests, 1 failure, 0.17s wall]
**********************************************************************

@kwankyu
Copy link
Collaborator Author

kwankyu commented Nov 10, 2025

Added "return" after "warning".

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants