We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bbf2812 commit 8a8999eCopy full SHA for 8a8999e
benchmarks/votable.py
@@ -34,15 +34,10 @@
34
35
def create_votable_bytes(table_data, format_type='binary2'):
36
"""Helper to create VOTables with a specific serialization."""
37
- with tempfile.NamedTemporaryFile(delete=False, suffix='.xml') as tmp:
38
- try:
39
- votable = from_table(table_data)
40
- votable.get_first_table().format = format_type
41
- votable.to_xml(tmp.name)
42
- with open(tmp.name, 'rb') as f:
43
- return f.read()
44
- finally:
45
- os.unlink(tmp.name)
+ votable = from_table(table_data)
+ output = io.BytesIO()
+ votable.to_xml(output, tabledata_format=format_type)
+ return output.getvalue()
46
47
48
class TimeVOTableNumeric:
0 commit comments