[Bug 1320676] [NEW] Python syntax error in textobject.py

Jesse Manning jmaps-lp at fireburns.net
Sun May 18 17:27:12 UTC 2014


Public bug reported:

Traceback (most recent call last):
...
  File "/usr/lib/python2.7/dist-packages/reportlab/pdfgen/textobject.py", line 436, in textLines
    lines = '\n'.split(asUnicode(stuff).strip())
ValueError: empty separator

This is a split, not a join. The fix is to change the line to:

lines = asUnicode(stuff).strip().split('\n')

% lsb_release -rd
Description:	Ubuntu 14.04 LTS
Release:	14.04

% apt-cache policy python-reportlab
python-reportlab:
  Installed: 3.0-1build1
  Candidate: 3.0-1build1
  Version table:
 *** 3.0-1build1 0
        500 http://mirrors.us.kernel.org/ubuntu/ trusty/main amd64 Packages
        100 /var/lib/dpkg/status

This was discovered as part of an attempted PDF export in ocrfeeder.
The PDF was not exported until I manually went into this python module and fixed the syntax error. The fix produced the desired result.

ProblemType: Bug
DistroRelease: Ubuntu 14.04
Package: python-reportlab 3.0-1build1 [modified: usr/lib/python2.7/dist-packages/reportlab/pdfgen/textobject.py]
ProcVersionSignature: Ubuntu 3.13.0-24.46-generic 3.13.9
Uname: Linux 3.13.0-24-generic x86_64
ApportVersion: 2.14.1-0ubuntu3
Architecture: amd64
CurrentDesktop: XFCE
Date: Sun May 18 10:13:31 2014
InstallationDate: Installed on 2012-09-09 (615 days ago)
InstallationMedia: Ubuntu-Server 12.04.1 LTS "Precise Pangolin" - Release amd64 (20120817.3)
PackageArchitecture: all
ProcEnviron:
 TERM=xterm
 PATH=(custom, no user)
 XDG_RUNTIME_DIR=<set>
 LANG=en_US.UTF-8
 SHELL=/usr/bin/zsh
SourcePackage: python-reportlab
UpgradeStatus: Upgraded to trusty on 2014-04-26 (22 days ago)

** Affects: python-reportlab (Ubuntu)
     Importance: Undecided
         Status: New


** Tags: amd64 apport-bug trusty

** Attachment added: "Full python traceback from textobject.py"
   https://bugs.launchpad.net/bugs/1320676/+attachment/4115080/+files/traceback.txt

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to python-reportlab in Ubuntu.
https://bugs.launchpad.net/bugs/1320676

Title:
  Python syntax error in textobject.py

Status in “python-reportlab” package in Ubuntu:
  New

Bug description:
  Traceback (most recent call last):
  ...
    File "/usr/lib/python2.7/dist-packages/reportlab/pdfgen/textobject.py", line 436, in textLines
      lines = '\n'.split(asUnicode(stuff).strip())
  ValueError: empty separator

  This is a split, not a join. The fix is to change the line to:

  lines = asUnicode(stuff).strip().split('\n')

  % lsb_release -rd
  Description:	Ubuntu 14.04 LTS
  Release:	14.04

  % apt-cache policy python-reportlab
  python-reportlab:
    Installed: 3.0-1build1
    Candidate: 3.0-1build1
    Version table:
   *** 3.0-1build1 0
          500 http://mirrors.us.kernel.org/ubuntu/ trusty/main amd64 Packages
          100 /var/lib/dpkg/status

  This was discovered as part of an attempted PDF export in ocrfeeder.
  The PDF was not exported until I manually went into this python module and fixed the syntax error. The fix produced the desired result.

  ProblemType: Bug
  DistroRelease: Ubuntu 14.04
  Package: python-reportlab 3.0-1build1 [modified: usr/lib/python2.7/dist-packages/reportlab/pdfgen/textobject.py]
  ProcVersionSignature: Ubuntu 3.13.0-24.46-generic 3.13.9
  Uname: Linux 3.13.0-24-generic x86_64
  ApportVersion: 2.14.1-0ubuntu3
  Architecture: amd64
  CurrentDesktop: XFCE
  Date: Sun May 18 10:13:31 2014
  InstallationDate: Installed on 2012-09-09 (615 days ago)
  InstallationMedia: Ubuntu-Server 12.04.1 LTS "Precise Pangolin" - Release amd64 (20120817.3)
  PackageArchitecture: all
  ProcEnviron:
   TERM=xterm
   PATH=(custom, no user)
   XDG_RUNTIME_DIR=<set>
   LANG=en_US.UTF-8
   SHELL=/usr/bin/zsh
  SourcePackage: python-reportlab
  UpgradeStatus: Upgraded to trusty on 2014-04-26 (22 days ago)

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/python-reportlab/+bug/1320676/+subscriptions



More information about the foundations-bugs mailing list