#6817 Import mime-type detection error

asf_release_1.1.0
closed
General
Cory Johns
2015-02-21
2013-10-30
Dave Brondsema
No

Suspect this happens on urls that don't have a file extension in the last URL component.

  File "/var/local/allura/ForgeImporters/forgeimporters/forge/tracker.py", line 148, in import_tool
    self.process_comments(ticket, ticket_json['discussion_thread']['posts'])
  File "/var/local/allura/ForgeImporters/forgeimporters/forge/tracker.py", line 192, in process_comments
    p.add_multiple_attachments([File(a['url']) for a in comment_json['attachments']])
  File "/var/local/allura/ForgeImporters/forgeimporters/base.py", line 521, in __init__
    self.type = guess_mime_type(filename)
  File "/var/local/allura/Allura/allura/lib/utils.py", line 63, in guess_mime_type
    content_type = mimetypes.guess_type(filename, strict=True)
  File "/usr/lib64/python2.7/mimetypes.py", line 295, in guess_type
    return _db.guess_type(url, strict)
  File "/usr/lib64/python2.7/mimetypes.py", line 114, in guess_type
    scheme, url = urllib.splittype(url)
  File "/usr/lib64/python2.7/urllib.py", line 1070, in splittype
    match = _typeprog.match(url)
TypeError: expected string or buffer

Discussion

  • Dave Brondsema
    Dave Brondsema
    2013-11-01

    • Size: --> 1
     
  • Dave Brondsema
    Dave Brondsema
    2013-11-01

    • status: open --> in-progress
    • QA: Dave Brondsema
     
  • Dave Brondsema
    Dave Brondsema
    2013-11-01

    • status: in-progress --> code-review
    • assigned_to: Dave Brondsema
    • QA: Dave Brondsema --> nobody
     
  • Cory Johns
    Cory Johns
    2013-11-04

    • QA: Cory Johns
     
  • Cory Johns
    Cory Johns
    2013-11-04

    • status: code-review --> closed