Project

Profile

Help

Issue #2346 ยป repoview-unicode.diff

quick patch for /usr/bin/repoview - cretep, 07/26/2017 04:04 PM

View differences:

repoview-bytes 2017-07-17 09:21:57.168504000 +0100
256 256
            self.opts.force = True
257 257
        
258 258
        self.sconn = sqlite.connect(statedb)
259
        self.sconn.text_factory = bytes
259 260
        scursor = self.sconn.cursor()
260 261

  
261 262
        query = """CREATE TABLE IF NOT EXISTS state (
......
323 324
        self.say('Opening primary database...')
324 325
        primary = self.z_handler(primary)
325 326
        self.pconn = sqlite.connect(primary)
327
        self.pconn.text_factory = bytes
326 328
        self.say('done\n')
327 329
        
328 330
        self.say('Opening changelogs database...')
329 331
        other = self.z_handler(other)
330 332
        self.oconn = sqlite.connect(other)
333
        self.oconn.text_factory = bytes
331 334
        self.say('done\n')
332 335
        
333 336
        if self.opts.comps:
......
482 485
            (pkg_key, epoch, version, release, arch, summary,
483 486
             description, url, time_build, rpm_license, rpm_sourcerpm,
484 487
             size_package, location_href, vendor) = row
488

  
489
            summary = unicode(summary or '', errors='ignore')
490
            description = unicode(description or '', errors='ignore')
491
            url = unicode(url or '', errors='ignore')
492
            location_href = unicode(location_href or '', errors='ignore')
493
            vendor = unicode(vendor or '', errors='ignore')
494

  
485 495
            if pkg_data['summary'] is None:
486 496
                pkg_data['summary'] = summary
487 497
                pkg_data['description'] = description