[Reportbug-maint] Processed: Re: reportbug: marks mime type of attachments as inode/symlink

2018-01-01 Thread Debian Bug Tracking System
Processing control commands:

> tags -1 patch
Bug #885959 [reportbug] reportbug: marks mime type of attachments as 
inode/symlink
Added tag(s) patch.

-- 
885959: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=885959
Debian Bug Tracking System
Contact ow...@bugs.debian.org with problems

___
Reportbug-maint mailing list
Reportbug-maint@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/reportbug-maint


[Reportbug-maint] Bug#885959: reportbug: marks mime type of attachments as inode/symlink

2018-01-01 Thread Nis Martensen
control: tags -1 patch


Thanks for the report!
>From 77087cf7a1b16d0be199c301ece62f04f06d5b6f Mon Sep 17 00:00:00 2001
From: Nis Martensen 
Date: Mon, 1 Jan 2018 11:28:25 +0100
Subject: [PATCH] submit.py: dereference symbolic links when detecting file
 type

---
 reportbug/submit.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/reportbug/submit.py b/reportbug/submit.py
index 4b72ceb..30cfdef 100644
--- a/reportbug/submit.py
+++ b/reportbug/submit.py
@@ -144,7 +144,7 @@ def mime_attach(body, attachments, charset, body_charset=None):
 continue
 ctype = None
 cset = charset
-info = Popen(['file', '--mime', '--brief', attachment],
+info = Popen(['file', '--mime', '--brief', '--dereference', attachment],
  stdout=PIPE, stderr=STDOUT).communicate()[0].decode('ascii')
 if info:
 match = re.match(r'([^;, ]*)(,[^;]+)?(?:; )?(.*)', info)
-- 
2.11.0

___
Reportbug-maint mailing list
Reportbug-maint@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/reportbug-maint