-
Notifications
You must be signed in to change notification settings - Fork 314
Problem with open_buffer #177
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
Comments
I am getting the same thing. I switched to using Zip::InputStream.open(StringIO.new(data)) do |zis|
while entry = zis.get_next_entry
puts entry.name
end
end |
I'm running into this same error: NoMethodError: undefined method `bytesize' for nil:NilClass, but it looks like OS X's .DS_Store is the culprit. Zip::File.open works fine, but Zip::File.open_buffer raises the error. I can work around this, but hopefully this can be fixed? My code: contents = []
Zip::File.open_buffer(File.open("zip_test.zip", "rb").read) do |zip_file|
zip_file.each do |entry|
contents << entry.get_input_stream.read
end
end Sample attachment you can use: https://s3.amazonaws.com/github-rubyzip/zip_test.zip Thanks. |
It looks like this is not going to be fixed. Can a project maintainer just mark it as such and make the method private so people aren't led to believe they can open a buffer directly? |
I was getting this error while trying to use the Roo gem. It looks like it was an encoding issue. We had something like this: Roo::Excelx.new(StringIO.new(xlsx_report.file_data)) and getting
loading it like this: Roo::Excelx.new(StringIO.new(xlsx_report.file_data).set_encoding('ASCII-8BIT')) solves the issue. |
I received this error as well, but it only occurred when I ran the code on OS X. There was no problem opening the buffer on Linux (Gentoo or Ubuntu). Here's some example code that could reproduce the problem on OS X: Zip::File.open_buffer(File.read('/path/to/my_zip.zip')) I was able to resolve the issue on OS X by changing my code to: Zip::File.open_buffer(File.binread('/path/to/my_zip.zip')) |
Fixed, as far as I can tell. |
I'm getting
undefined method
bytesize' for nil:NilClass`using open_buffer.this code works:
but if I try to use open_buffer
I get this error:
Am I doing something wrong?
The text was updated successfully, but these errors were encountered: