Skip to content

Commit cecc47a

Browse files
committed
Not all file-like objects implement the name attribute.
1 parent 18c6a2a commit cecc47a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sc2reader/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -688,7 +688,7 @@ def read_header(replay_file):
688688
# Sanity check that the input is in fact an MPQ file
689689
if buffer.empty or buffer.read_hex(4).upper() != "4D50511B":
690690
msg = "File '{}' is not an MPQ file";
691-
raise exceptions.FileError(msg.format(replay_file.name))
691+
raise exceptions.FileError(msg.format(getattr(replay_file, 'name', '<NOT AVAILABLE>')))
692692

693693
max_data_size = buffer.read_int(LITTLE_ENDIAN)
694694
header_offset = buffer.read_int(LITTLE_ENDIAN)

0 commit comments

Comments
 (0)