Use django.utils.encode smart_text or smart_str for intelligent unicode handling
[htsworkflow.git] / htsworkflow / submission / condorfastq.py
index 8f9fccb7b897a677d02971fc45c791488b6237db..705d47e0412587b287010985c90b2469f325cca2 100644 (file)
@@ -22,6 +22,7 @@ from htsworkflow.util.conversion import parse_flowcell_id
 
 from django.conf import settings
 from django.template import Context, loader
+from django.utils.encoding import smart_str
 
 import RDF
 
@@ -257,7 +258,7 @@ WHERE {
         """Add link between target pathname and the 'lane' that produced it
         (note lane objects are now post demultiplexing.)
         """
-        target_uri = 'file://' + target.encode('utf-8')
+        target_uri = 'file://' + smart_str(target)
         target_node = RDF.Node(RDF.Uri(target_uri))
         source_stmt = RDF.Statement(target_node, dcNS['source'], seq.filenode)
         self.model.add_statement(source_stmt)