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

Some improvements to findstat._submit #39193

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/sage/databases/findstat.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@

from ast import literal_eval
from copy import deepcopy
from pathlib import Path
import re
import webbrowser
import tempfile
Expand Down Expand Up @@ -491,8 +492,9 @@
....: "CurrentEmail": ""}
sage: _submit(args, url) # optional -- webbrowser
"""
f = tempfile.NamedTemporaryFile(mode='w', suffix='.html', delete=False)
f = tempfile.NamedTemporaryFile(mode='w', suffix='.html', encoding='utf-8', delete=False)

Check warning on line 495 in src/sage/databases/findstat.py

View check run for this annotation

Codecov / codecov/patch

src/sage/databases/findstat.py#L495

Added line #L495 was not covered by tests
verbose("Created temporary file %s" % f.name, caller_name='FindStat')
f.write('<!doctype html>\n<html lang="en">\n<meta charset="utf-8">\n')

Check warning on line 497 in src/sage/databases/findstat.py

View check run for this annotation

Codecov / codecov/patch

src/sage/databases/findstat.py#L497

Added line #L497 was not covered by tests
f.write(FINDSTAT_POST_HEADER)
f.write(url)
for key, value in args.items():
Expand All @@ -506,7 +508,7 @@
f.write(FINDSTAT_FORM_FOOTER)
f.close()
verbose("Opening file with webbrowser", caller_name='FindStat')
webbrowser.open(f.name)
webbrowser.open(Path(f.name).as_uri())

Check warning on line 511 in src/sage/databases/findstat.py

View check run for this annotation

Codecov / codecov/patch

src/sage/databases/findstat.py#L511

Added line #L511 was not covered by tests


def _data_to_str(data, domain, codomain=None):
Expand Down
Loading