Python Forum
Cannot extract wranings/errors from ant script
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Cannot extract wranings/errors from ant script
#1
Hi,

I have been learning python for about 4 months now and i'm stuck trying to extract errors/warnings after running an ant script.
I am running python 2.7 on a windows machine.
code snippet:
cmd = (r'{6} -f build.xml "-DthisInput={4}" "-Dargs.filter={2}"'
            ' "-DthisDoc={5}" "-Ddita.temp.dir={0}"'
            ' "-Dout={1}" {3} "-Dgenerate.outer.copy=3"'.format(
                tempDir, outDir, userFilter, ','.join(targets), file, filename, ant))
        pro = subprocess.Popen(
            cmd, shell=True,
        stdout=subprocess.PIPE,
        stderr=subprocess.PIPE
        )
    pro.wait()
    o, e = pro.communicate()
    print (e)
    print (o)
An equivalent powershell script displays errors such as:
[gen-list] [DOTX008E][ERROR] File '..\topic\xyz\xyz.dita' does not exist or cannot be loaded.
[move-meta] File C:\Users\xyz\docs\temp\topic\xyz\xyz.xml does not exist

But my python script simply completes running the script without showing any warnings/errors.
Reply


Messages In This Thread
Cannot extract wranings/errors from ant script - by wikedkid - Aug-02-2017, 05:58 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
Question Need help for a python script to extract information from a list of files lephunghien 6 1,194 Jun-12-2023, 05:40 PM
Last Post: snippsat
  Need help with 3 errors when running script pythoncoder999 3 2,458 Dec-19-2020, 04:04 AM
Last Post: Larz60+

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020