Skip to content

Commit

Permalink
Merge pull request jazzband#356 from claudep/xlsx_read_only
Browse files Browse the repository at this point in the history
Open xlsx workbooks in read-only mode
  • Loading branch information
timofurrer committed Mar 11, 2019
2 parents 6ab511f + 193b840 commit 25a66f9
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 25a66f9

Please sign in to comment.