Skip to content

Commit

Permalink
Fix findstat._submit
Browse files Browse the repository at this point in the history
  • Loading branch information
user202729 committed Dec 23, 2024
1 parent c9dd1e8 commit 4a82a39
Showing 1 changed file with 4 additions and 2 deletions.
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 @@ def mapping(sigma):

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 @@ def _submit(args, url):
....: "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 @@ def _submit(args, url):
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

0 comments on commit 4a82a39

Please sign in to comment.