Skip to content

Commit

Permalink
Open xlsx workbooks in read-only mode
Browse files Browse the repository at this point in the history
  • Loading branch information
claudep committed Mar 9, 2019
1 parent 733d77a commit 193b840
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tablib/formats/_xlsx.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def import_set(dset, in_stream, headers=True):

dset.wipe()

xls_book = openpyxl.reader.excel.load_workbook(BytesIO(in_stream))
xls_book = openpyxl.reader.excel.load_workbook(BytesIO(in_stream), read_only=True)
sheet = xls_book.active

dset.title = sheet.title
Expand All @@ -88,7 +88,7 @@ def import_book(dbook, in_stream, headers=True):

dbook.wipe()

xls_book = openpyxl.reader.excel.load_workbook(BytesIO(in_stream))
xls_book = openpyxl.reader.excel.load_workbook(BytesIO(in_stream), read_only=True)

for sheet in xls_book.worksheets:
data = tablib.Dataset()
Expand Down

0 comments on commit 193b840

Please sign in to comment.