<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>14370</bug_id>
          
          <creation_ts>2021-05-01 11:11:30 +0000</creation_ts>
          <short_desc>Toaster fails to start in CentOS 8 because it can&apos;t detect the timezone</short_desc>
          <delta_ts>2025-03-13 04:49:25 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>7</classification_id>
          <classification>Build System, Metadata &amp; Runtime</classification>
          <product>Toaster</product>
          <component>toaster</component>
          <version>3.2.3</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>WONTFIX</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>5.2 M3</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>spynet314</reporter>
          <assigned_to name="David Reyna">david.reyna</assigned_to>
          <cc>randy.macleod</cc>
          
          <qa_contact name="Toaster default assignee">toaster</qa_contact>
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>No (bug/feature does not impact docs)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>90205</commentid>
    <comment_count>0</comment_count>
    <who name="">spynet314</who>
    <bug_when>2021-05-01 11:11:30 +0000</bug_when>
    <thetext>Hello,

in my CentOS 8 setup, the script &apos;bitbake/lib/toaster/toastermain/settings.py&apos; generates the following exception on start:

  File &quot;/home/paolo/poky/bitbake/lib/toaster/toastermain/settings.py&quot;, line 86, in &lt;module&gt;
    if pytz.timezone(zonename) is not None:
  File &quot;/usr/lib/python3.6/site-packages/pytz/__init__.py&quot;, line 168, in timezone
    _tzinfo_cache[zone] = build_tzinfo(zone, fp)
  File &quot;/usr/lib/python3.6/site-packages/pytz/tzfile.py&quot;, line 33, in build_tzinfo
    assert magic == _byte_string(&apos;TZif&apos;), &apos;Got magic %s&apos; % repr(magic)
AssertionError: Got magic b&apos;# Al&apos;

After digging for a while, I found that the above assertion is generated because the folder /usr/share/zoneinfo, that is scanned by the script, contains files that are not timezone descriptors, like for example &apos;leapseconds&apos;, &apos;zone1970.tab&apos; and &apos;zone.tab&apos;.

It is possible to avoid this error by exporting the timezone with:
TZ=&apos;Europe/Rome&apos;; export TZ

It would be better to modify the script like this:

            try:
                import pytz
                from pytz.exceptions import UnknownTimeZoneError
                try:
                    if pytz.timezone(zonename) is not None:
                        zonefilelist[hashlib.md5(open(filepath, &apos;rb&apos;).rea$
                except UnknownTimeZoneError as ValueError:
                    # we expect timezone failures here, just move over
                    pass
  --&gt;           except AssertionError:
  --&gt;               # there may be files in the folder that generate assertion
  --&gt;               pass
            except ImportError:
                zonefilelist[hashlib.md5(open(filepath, &apos;rb&apos;).read()).hex

Regards,
Paolo</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>101358</commentid>
    <comment_count>1</comment_count>
    <who name="David Reyna">david.reyna</who>
    <bug_when>2025-03-13 04:49:25 +0000</bug_when>
    <thetext>CentOS 8 is EOL</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>