Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

calling OpenFile with option "xlsx.UseDiskVCellStore" panics on Windows #685

Closed
zhyang-liu opened this issue Mar 10, 2021 · 2 comments
Closed

Comments

@zhyang-liu
Copy link

zhyang-liu commented Mar 10, 2021

Hi Teale,
Thank you for your xlsx library which helped me a lot.
Recently I was opening a (might be very huge) xlsx file with UseDiskVCellStore flag. When it ran on
Windows, the program panic. The codes are listed below:

file, _ = xlsx.OpenFile(arg.device, xlsx.UseDiskVCellStore)

panic were said:

unable to open file: "..\TEST.xlsx": OpenFile: ReadZip: ReadZipReader: readSheetsFromZipFile: create key file: open file: open C:\Users\MASKED\AppData\Local\Temp\cellstore693c54fb-73f7-4299-b8b0-1e51a317fc59052753353\DeviceConfig:000000:000000: The filename, directory name, or volume label syntax is incorrect.
goroutine 15 [running]:
runtime/debug.Stack(0xc0002a56d0, 0x5a6120, 0xc00029f470)
        /usr/local/Cellar/go/1.15.6/libexec/src/runtime/debug/stack.go:24 +0xa5
github.com/tealeg/xlsx/v3.readSheetFromFile.func1(0xc0002a5f38)
        /Users/masked/go/pkg/mod/github.com/tealeg/xlsx/v3@v3.2.3/lib.go:691 +0x65
panic(0x5a6120, 0xc00029f470)
        /usr/local/Cellar/go/1.15.6/libexec/src/runtime/panic.go:969 +0x1c7
github.com/tealeg/xlsx/v3.(*DiskVRow).setCurrentCell(0xc0000a67d0, 0xc000444480)
        /Users/masked/go/pkg/mod/github.com/tealeg/xlsx/v3@v3.2.3/diskv.go:233 +0xe5
github.com/tealeg/xlsx/v3.(*DiskVRow).PushCell(0xc0000a67d0, 0xc000444480)
        /Users/masked/go/pkg/mod/github.com/tealeg/xlsx/v3@v3.2.3/diskv.go:245 +0x45
github.com/tealeg/xlsx/v3.(*Row).PushCell(0xc0004685c0, 0xc000444480)
        /Users/masked/go/pkg/mod/github.com/tealeg/xlsx/v3@v3.2.3/row.go:74 +0x62
github.com/tealeg/xlsx/v3.readRowsFromSheet(0xc00012ac60, 0xc0000e8480, 0xc00045dec0, 0xffffffffffffffff, 0xc0003067e0, 0x0, 0x0)
        /Users/masked/go/pkg/mod/github.com/tealeg/xlsx/v3@v3.2.3/lib.go:549 +0x64c
github.com/tealeg/xlsx/v3.readSheetFromFile(0xc0000bd650, 0xc, 0x7a2da8, 0x1, 0xc0000bd670, 0x4, 0x0, 0x0, 0xc0000e8480, 0xc000069fb0, ...)
        /Users/masked/go/pkg/mod/github.com/tealeg/xlsx/v3@v3.2.3/lib.go:715 +0x3f6
github.com/tealeg/xlsx/v3.readSheetsFromZipFile.func2(0xc0000bd650, 0xc, 0x7a2da8, 0x1, 0xc0000bd670, 0x4, 0x0, 0x0, 0xc0000e8480, 0xc000069fb0, ...)
        /Users/masked/go/pkg/mod/github.com/tealeg/xlsx/v3@v3.2.3/lib.go:787 +0x95
created by github.com/tealeg/xlsx/v3.readSheetsFromZipFile
        /Users/masked/go/pkg/mod/github.com/tealeg/xlsx/v3@v3.2.3/lib.go:786 +0x6dc

IMHO, it seems that the filename DeviceConfig:000000:000000 combined the sheet name and two groups of six zeros with colon (":"), which is a reserved charactor in Windows for the usage of "Named data stream" in NTFS file system. (NTFS doc)

@tealeg
Copy link
Owner

tealeg commented Mar 10, 2021

@zhyang-liu I concur with your view. I don't do anything on Windows (for some 24 years now) so these things sometimes escape me. We could easily choose to use some other character here (say a "_").

@github-actions
Copy link

Stale issue message

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants