<?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>9670</bug_id>
          
          <creation_ts>2016-05-24 11:38:43 +0000</creation_ts>
          <short_desc>Toaster does not set a correct MIME type for tasks&apos; logs files</short_desc>
          <delta_ts>2023-12-14 04:19:10 +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>unspecified</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard>   </status_whiteboard>
          <keywords></keywords>
          <priority>Low</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>Future</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Leif Middelschulte">Leif.Middelschulte</reporter>
          <assigned_to name="Toaster default assignee">toaster</assigned_to>
          <cc>belen.barros.pena</cc>
    
    <cc>brian.avery</cc>
    
    <cc>david.reyna</cc>
    
    <cc>jessica.zhang</cc>
    
    <cc>jose.perez.carranza</cc>
    
    <cc>joshuagloe</cc>
    
    <cc>stanciux.mihail</cc>
          
          
          <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>62418</commentid>
    <comment_count>0</comment_count>
    <who name="Leif Middelschulte">Leif.Middelschulte</who>
    <bug_when>2016-05-24 11:38:43 +0000</bug_when>
    <thetext>Toaster (i.e. &quot;source toaster start) does not set the correct header for tasks&apos; log files. This leads to browsers not offering to open the files in place, resulting in an annoying work flow.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>62446</commentid>
    <comment_count>1</comment_count>
    <who name="Elliot Smith">elliot.smith</who>
    <bug_when>2016-05-25 15:38:17 +0000</bug_when>
    <thetext>Would be better to use python-magic rather than the Python mimetypes module, as the mimetypes module relies on file extensions and log files use the PID for the file extension.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>62448</commentid>
    <comment_count>2</comment_count>
    <who name="brian avery">brian.avery</who>
    <bug_when>2016-05-25 16:34:34 +0000</bug_when>
    <thetext>we could try something like:
--- a/bitbake/lib/toaster/toastergui/views.py
+++ b/bitbake/lib/toaster/toastergui/views.py
@@ -67,7 +67,10 @@ class MimeTypeFinder(object):
         guess = mimetypes.guess_type(path, self._strict)
         guessed_type = guess[0]
         if guessed_type == None:
-            guessed_type = &apos;application/octet-stream&apos;
+            if &quot;log.do_&quot; in os.path.basename(path):
+                guessed_type = &apos;text/plain&apos;
+            else:
+                guessed_type = &apos;application/octet-stream&apos;
         return guessed_type


since we are already providing a base guess at least it would keep any special cases in one place.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>