MiniMax-AI/skills · warning · ValueError
Unsupported file format: {suffix}. Supported formats: .xlsx,
Error message
Unsupported file format: {suffix}. Supported formats: .xlsx, .xlsm, .csv, .tsv What it means
The suffix matches none of .xlsx/.xlsm/.csv/.tsv/.xls, so detect_and_load() rejects it with ValueError listing the supported formats. The suffix is lowercased before comparison, so .XLSX is accepted but .ods/.numbers/.txt/.parquet are not.
Source
Thrown at skills/minimax-xlsx/scripts/xlsx_reader.py:84
df = pd.read_csv(file_path, sep=sep, encoding=enc)
df._reader_encoding = enc # attach metadata (non-standard, for reporting)
return {path.stem: df}
except (UnicodeDecodeError, Exception) as e:
last_error = e
continue
raise ValueError(
f"Cannot decode {file_path}. Tried encodings: {encodings}. "
f"Last error: {last_error}"
)
elif suffix == ".xls":
raise ValueError(
".xls is a legacy binary format not supported by this tool. "
"Please open the file in Excel and save as .xlsx, then retry."
)
else:
raise ValueError(
f"Unsupported file format: {suffix}. "
"Supported formats: .xlsx, .xlsm, .csv, .tsv"
)
# ---------------------------------------------------------------------------
# Structure discovery
# ---------------------------------------------------------------------------
def explore_structure(sheets: dict) -> dict:
"""
Return a structured dict describing each sheet.
Keys: sheet_name -> {shape, columns, dtypes, null_counts, preview}
"""
result = {}
for sheet_name, df in sheets.items():
null_counts = df.isnull().sum()
null_info = {View on GitHub (pinned to 60aaae52bb)
Solutions
- Convert/save to a supported format (.xlsx, .xlsm, .csv, or .tsv).
- If the content is actually CSV, rename the extension to .csv.
- For .ods, export to .xlsx from LibreOffice/Google Sheets.
Example fix
# before python3 xlsx_reader.py data.ods # ValueError: Unsupported file format: .ods # after libreoffice --headless --convert-to xlsx data.ods python3 xlsx_reader.py data.xlsx
Defensive patterns
Strategy: validation
Validate before calling
from pathlib import Path
SUPPORTED = {'.xlsx', '.xlsm', '.csv', '.tsv'}
suf = Path(file_path).suffix.lower()
if suf not in SUPPORTED:
raise ValueError(f'Unsupported file format: {suf}. Supported: {sorted(SUPPORTED)}') Type guard
def is_supported_format(p) -> bool:
return Path(p).suffix.lower() in {'.xlsx', '.xlsm', '.csv', '.tsv'} Try / catch
try:
sheets = detect_and_load(file_path)
except ValueError as e:
if 'Unsupported file format' in str(e):
print(f'Convert {file_path} to .xlsx/.csv/.tsv first.', file=sys.stderr)
raise Prevention
- Validate the extension against the supported set before calling.
- Normalize exports to .xlsx or .csv at the source.
- Use Path.suffix.lower() so case variants are handled.
When it happens
Trigger: Passing .ods, .numbers, .txt, .parquet, .json, or any other unrecognized extension.
Common situations: Exporting from Google Sheets as .ods; passing a .txt assuming it reads as CSV; Mac Numbers export; a data file in a format the tool never claimed to support.
Related errors
- Image format '{ext}' is not supported by OpenXML.
- ERROR: -o/--output only works with a single input file
- File not found: {file_path}
- level
- Document has no comments part.
AI-assisted analysis of MiniMax-AI/skills@60aaae52bb (2026-08-13).
Data as JSON: /api/errors/bf26257743cca8e4.
Report an issue: GitHub.