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

How to suppress "Invalid date/time in zip entry" warning? #112

Closed
bronson opened this issue Dec 5, 2013 · 6 comments
Closed

How to suppress "Invalid date/time in zip entry" warning? #112

bronson opened this issue Dec 5, 2013 · 6 comments

Comments

@bronson
Copy link

bronson commented Dec 5, 2013

rubyzip inserts this error in the logs every time I open a kmz file. I have no control over the input files and I'm not sure I'd worry about an invalid date even if I did.

Is there any way to suppress this message?

It looks like it's generated by a puts call:

puts "Invalid date/time in zip entry"

Thanks!

@jamesdwellable
Copy link

+1 Having this issue, too

simonoff added a commit that referenced this issue Dec 7, 2014
Fix for issue #112 - ability to not show warning about incorrect date
@dogweather
Copy link

👍 Same here.

@ShockwaveNN
Copy link
Contributor

@simonoff I think you can close this issue

@audionerd
Copy link

For anyone visiting who still experiences this issue, the fix by @ShockwaveNN is to upgrade to Rubyzip 1.1.7 and add:

Zip.warn_invalid_date = false

@zako42
Copy link

zako42 commented Dec 1, 2015

We experienced this issue because we were stubbing the to_binary_dos_date and returning 0. However 0 is not a valid value that parse_binary_dos_format expects. You can calculate a valid number by following the method to_binary_dos_date. For example, for Dec 1, 2015, you would use 18305. Return a valid value and you won't get the warning messages.

@amias-channer
Copy link

the Zip.warn_invalid_date = false solution also works for zip-zip

@hainesr hainesr closed this as completed May 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants