Skip to content

Some improvements to findstat._submit#39193

Merged
vbraun merged 1 commit intosagemath:developfrom
user202729:fix-findstat-submit
Jan 4, 2025
Merged

Some improvements to findstat._submit#39193
vbraun merged 1 commit intosagemath:developfrom
user202729:fix-findstat-submit

Conversation

@user202729
Copy link
Contributor

📝 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. (not needed)

⌛ Dependencies

@mantepse mantepse self-assigned this Dec 23, 2024
@github-actions
Copy link

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

@user202729 user202729 marked this pull request as ready for review December 23, 2024 14:29
@mantepse
Copy link
Contributor

I actually didn't realise that it was broken - I use it regularly. The main nuisance is that firefox doesn't access /tmp, so I also copy the created file manually...

@user202729
Copy link
Contributor Author

user202729 commented Dec 23, 2024

webbrowser.open(file path) is platform dependent, https://docs.python.org/3/library/webbrowser.html#webbrowser.open .

The issue with /tmp/ is probably operating system/distribution dependent, see e.g. https://askubuntu.com/questions/1370653/snap-apps-dont-find-files-in-tmp .

Another approach might be to use data:html URL, but it isn't very clear that would be more platform independent than the current one. [edit: I just tried, webbrowser.open("data:text/html;base64,...") doesn't work. At least you can probably set $BROWSER to some custom script that copies the file somewhere else first]

Copy link
Contributor

@mantepse mantepse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks OK - I cannot say much about it, though. There is no change visible to me on my system (Ubuntu 24.04).

vbraun pushed a commit to vbraun/sage that referenced this pull request Jan 1, 2025
sagemathgh-39193: Some improvements to findstat._submit
    
* for some reason the proper header is needed to open the HTML file on
my machine.
* It's reported that `webbrowser.open()` doesn't work when called on a
file path, rather an URI is needed
(sagemath#38946)


### 📝 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.
- [x] I have updated the documentation and checked the documentation
preview. (not needed)

### ⌛ 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#39193
Reported by: user202729
Reviewer(s): Martin Rubey
@vbraun vbraun merged commit a5c4b48 into sagemath:develop Jan 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants