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

Raised "The file '/usr/share/zoneinfo/timeconfig' does not start with the expected header." #64

Closed
snmgian opened this issue Jan 12, 2017 · 2 comments

Comments

@snmgian
Copy link

snmgian commented Jan 12, 2017

The Slackware Linux distribution includes a script named timeconfig inside the zoneinfo directory.

That file is not being excluded by #load_timezone_index: https://github.com/tzinfo/tzinfo/blob/master/lib/tzinfo/zoneinfo_data_source.rb#L344

So, when doing this:

TZInfo::Timezone.all.find_all {|tz| tz.current_period.abbreviation == :some_abbrev }

will raise this error:

TZInfo::InvalidTimezoneIdentifier: The file '/usr/share/zoneinfo/timeconfig' does not start with the expected header.
	from /home/gian/.rbenv/versions/2.3.0/gemsets/r/gems/tzinfo-1.2.2/lib/tzinfo/zoneinfo_data_source.rb:205:in `rescue in load_timezone_info'
	from /home/gian/.rbenv/versions/2.3.0/gemsets/r/gems/tzinfo-1.2.2/lib/tzinfo/zoneinfo_data_source.rb:202:in `load_timezone_info'
	from /home/gian/.rbenv/versions/2.3.0/gemsets/r/gems/tzinfo-1.2.2/lib/tzinfo/timezone.rb:92:in `get'
	from /home/gian/.rbenv/versions/2.3.0/gemsets/r/gems/tzinfo-1.2.2/lib/tzinfo/timezone_proxy.rb:67:in `real_timezone'
	from /home/gian/.rbenv/versions/2.3.0/gemsets/r/gems/tzinfo-1.2.2/lib/tzinfo/timezone_proxy.rb:30:in `period_for_utc'
	from /home/gian/.rbenv/versions/2.3.0/gemsets/r/gems/tzinfo-1.2.2/lib/tzinfo/timezone.rb:549:in `current_period'
	from (irb):12:in `block in irb_binding'
	from (irb):12:in `each'
	from (irb):12:in `find_all'
	from (irb):12
	from /home/gian/.rbenv/versions/2.3.0/bin/irb:11:in `<main>'

I can send a PR if you are ok to excluding that file. Thanks.

@philr philr closed this as completed in de9f4bc Jan 12, 2017
@philr
Copy link
Member

philr commented Jan 12, 2017

Thank you for the report.

I've committed a change to ignore the timeconfig symlink.

philr added a commit that referenced this issue Mar 19, 2017
@philr
Copy link
Member

philr commented Mar 25, 2017

The fix for this issue has now been released in version 1.2.3.

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

2 participants