Kaydet (Commit) 706d18d1 authored tarafından Barış Metin's avatar Barış Metin

size in files is made optional (with commit 3922)

so we must handle it carefully while creating nodes not to get errors like below:

System Error. Program Terminated.
exceptions.TypeError: node contents must be a string

Traceback:
  File "/usr/bin/pisi", line 65, in ?
    cli.run_command()
  File "/usr/lib/python2.3/site-packages/pisi/cli/pisicli.py", line 107, in run_command
    self.command.run()
  File "/usr/lib/python2.3/site-packages/pisi/cli/commands.py", line 1029, in run
    pisi.api.build_until(arg, "buildpackages", self.authInfo)
  File "/usr/lib/python2.3/site-packages/pisi/api.py", line 327, in build_until
    __buildState_buildpackages(pb, last)
  File "/usr/lib/python2.3/site-packages/pisi/api.py", line 300, in __buildState_buildpackages
    pb.build_packages()
  File "/usr/lib/python2.3/site-packages/pisi/build.py", line 531, in build_packages
    self.gen_files_xml(package)
  File "/usr/lib/python2.3/site-packages/pisi/build.py", line 384, in gen_files_xml
    files.write(files_xml_path)
  File "/usr/lib/python2.3/site-packages/pisi/files.py", line 100, in write
    document.appendChild(x.elt(self.dom))
  File "/usr/lib/python2.3/site-packages/pisi/files.py", line 62, in elt
    sizeElt.appendChild(dom.createTextNode(size))
  File "/usr/lib/python2.3/xml/dom/minidom.py", line 1612, in createTextNode
    raise TypeError, "node contents must be a string"
üst b74462a3
......@@ -55,7 +55,10 @@ class FileInfo:
typeElt.appendChild(dom.createTextNode(self.type))
elt.appendChild(typeElt)
sizeElt = dom.createElement("Size")
sizeElt.appendChild(dom.createTextNode(self.size))
size = "0"
if self.size:
size = self.size
sizeElt.appendChild(dom.createTextNode(size))
elt.appendChild(sizeElt)
if self.hash:
hashElt = dom.createElement("SHA1Sum")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment