Sponsored Content
Operating Systems AIX Strange problem running python program from within ant Post 302880538 by dhs on Friday 20th of December 2013 10:00:02 AM
Old 12-20-2013
Strange problem running python program from within ant

Hello,

I'm currently trying to port an ant based build to AIX 6.1. The build queries the underlying version control system (Mercurial) for some data, which works fine on other platforms (Linux, Solaris). However, on AIX the hg command fails to load python's md5 module when used in the build, while it works fin in the shell. I could reproduce the problem with a simple test setup, consisting of test.py and ant_test.xml:

test.py:
Code:
#!/usr/bin/python
import hashlib


ant_test.xml:
Code:
<project name="ant_test" default="python">
        <target name="python" >
                <exec executable="./test.py" failifexecutionfails="true" failonerror="true"/>
        </target>
</project>

When I run test.py from the shell, it works fine, but when I run the ant build, it fails:
Code:
$ ls -l
total 16
-rw-r--r--    1 dhs      usr             170 Dec 20 15:46 ant_test.xml
-rwxr-xr-x    1 dhs      usr              35 Dec 20 09:54 test.py
$ ./test.py
$ echo $?
0
$ ant -f ant_test.xml
Buildfile: /home/RECOMMIND/dhs/tmp/ant_test.xml

python:
     [exec] Traceback (most recent call last):
     [exec]   File "./test.py", line 3, in <module>
     [exec]     import hashlib
     [exec]   File "/opt/freeware/lib/python2.6/hashlib.py", line 136, in <module>
     [exec]     md5 = __get_builtin_constructor('md5')
     [exec]   File "/opt/freeware/lib/python2.6/hashlib.py", line 63, in __get_builtin_constructor
     [exec]     import _md5
     [exec] ImportError: No module named _md5

BUILD FAILED
/home/RECOMMIND/dhs/tmp/ant_test.xml:3: exec returned: 1

Total time: 1 second

I currently have no idea how to resolve or even debug this, as AIX is somewhat new to me.

Versions:
AIX 6.1 TL08
Python 2.6.8 installed as RPM package obtained from perzl.org
Java is IBM JDK 7.1
Ant 1.8.4

Thanks in advance...

Dirk
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Strange Program behaviour

Had a strange thing going on with my code. It's ok I figured it out for myself.... (2 Replies)
Discussion started by: mrpugster
2 Replies

2. UNIX for Advanced & Expert Users

Functionality of ant build and ant deploy unix commands

I have made some code changes in the corresponding java file for date formatting purpose so that it supports upgraded sybase version from 12.6 to 12.7 and have build the code and deployed using the following UNIX commands. ant build ant deploy. "ant build" executes the build.xml which is... (1 Reply)
Discussion started by: vmpcit
1 Replies

3. Programming

Python program faster than C++ program.

I wrote a simple program that generates a random word 10,000,000 times. I wrote it in python, then in C++ and compared the two completion times. The python script was faster! Is that normal? Why would the python script be faster? I was under the impression that C++ was faster. What are some of... (2 Replies)
Discussion started by: cbreiny
2 Replies

4. Shell Programming and Scripting

Problem running a program/script in the background from a script

Hi all, I have a script that calls another program/script, xxx, to run in the background. Supposedly this program at most should finish within five (5) minutes so after five (5) minutes, I run some other steps to run the script into completion. My problem is sometimes the program takes... (5 Replies)
Discussion started by: newbie_01
5 Replies

5. Shell Programming and Scripting

Running C# program problem

Hi All, How to run c# program using shell script ? (1 Reply)
Discussion started by: srikar.ch
1 Replies

6. Shell Programming and Scripting

RSH connection problem while running MPI program

I'm trying to run MPI programs on 8 machines, but I get the error connect to address 127.0.0.1 port 544: Connection refused Trying krb4 rsh... connect to address 127.0.0.1 port 544: Connection refused trying normal rsh (/usr/bin/rsh) lagrid02: Connection refused When I run it with a... (8 Replies)
Discussion started by: vishwamitra
8 Replies

7. UNIX for Dummies Questions & Answers

Problem in running ant on unix

Hello, I am trying to run ant from a shell script a.sh. a.sh is placed in the /usr/myScripts folder a.sh looks like .......... ${ANT_HOME}/bin/ant -myBuild.xml While trying to run a.sh i am getting /usr/modules/apache.ant_1.7.1 /bin/ant: No such file or directory. Can anyone tel me... (5 Replies)
Discussion started by: naneee
5 Replies

8. Programming

Python program

Can someone help me please to write a Python program that support a processing of arithmetic expressions in postfix notation. Expressions in postfix notation contain the operands on which the operation is performed followed by an operator. For example, 3 4 + is equal to 3 + 4 in the infix... (2 Replies)
Discussion started by: Jim-266
2 Replies

9. Red Hat

Process not running: /opt/java15/jdk/bin/java -classpath /opt/apache/apache-ant-1.7.0-mod/lib/ant-la

Have no idea on what the below error message is: Process not running: /opt/java15/jdk/bin/java -classpath /opt/apache/apache-ant-1.7.0-mod/lib/ant-launcher.jar org.apache.tools.ant.launch.Launcher -buildfile build.xml dist. Any help? (3 Replies)
Discussion started by: gull05
3 Replies

10. Shell Programming and Scripting

Strange fork error while running script

more run.sh !/bin/bash input="data.txt" while IFS= read -r var do startdir="/web/logs" searchterm=$(echo $var | awk -F'=' '{print $1}') replaceterm=$(echo $var | awk -F'=' '{print $2}') find "$startdir" -type f -exec grep -l "$searchterm" {} + | while read file do if sed -e... (1 Reply)
Discussion started by: mohtashims
1 Replies
PDF::API2::Annotation(3pm)				User Contributed Perl Documentation				PDF::API2::Annotation(3pm)

NAME
PDF::API2::Annotation - annotation management METHODS
$ant = PDF::API2::Annotation->new Returns a annotation object (called from $page->annotation). $ant->link $page, %opts Defines the annotation as launch-page with page $page and options %opts (-rect, -border or 'dest-options'). $ant->url $url, %opts Defines the annotation as launch-url with url $url and options %opts (-rect and/or -border). $ant->file $file, %opts Defines the annotation as launch-file with filepath $file and options %opts (-rect and/or -border). $ant->pdfile $pdfile, $pagenum, %opts Defines the annotation as pdf-file with filepath $pdfile, $pagenum and options %opts (same as dest). $ant->text $text, %opts Defines the annotation as textnote with content $text and options %opts (-rect and/or -open). $ant->movie $file, $contentype, %opts Defines the annotation as a movie from $file with $contentype and options %opts (-rect). $ant->rect $llx, $lly, $urx, $ury Sets the rectangle of the annotation. $ant->border @b Sets the border-styles of the annotation, if applicable. $ant->content @lines Sets the text-content of the annotation, if applicable. $ant->open $bool Display the annotation either open or closed, if applicable. $ant->dest( $page, -fit => 1 ) Display the page designated by page, with its contents magnified just enough to fit the entire page within the window both horizontally and vertically. If the required horizontal and vertical magnification factors are different, use the smaller of the two, centering the page within the window in the other dimension. $ant->dest( $page, -fith => $top ) Display the page designated by page, with the vertical coordinate top positioned at the top edge of the window and the contents of the page magnified just enough to fit the entire width of the page within the window. $ant->dest( $page, -fitv => $left ) Display the page designated by page, with the horizontal coordinate left positioned at the left edge of the window and the contents of the page magnified just enough to fit the entire height of the page within the window. $ant->dest( $page, -fitr => [ $left, $bottom, $right, $top ] ) Display the page designated by page, with its contents magnified just enough to fit the rectangle specified by the coordinates left, bottom, right, and top entirely within the window both horizontally and vertically. If the required horizontal and vertical magnification factors are different, use the smaller of the two, centering the rectangle within the window in the other dimension. $ant->dest( $page, -fitb => 1 ) (PDF 1.1) Display the page designated by page, with its contents magnified just enough to fit its bounding box entirely within the window both horizontally and vertically. If the required horizontal and vertical magnification factors are different, use the smaller of the two, centering the bounding box within the window in the other dimension. $ant->dest( $page, -fitbh => $top ) (PDF 1.1) Display the page designated by page, with the vertical coordinate top positioned at the top edge of the window and the contents of the page magnified just enough to fit the entire width of its bounding box within the window. $ant->dest( $page, -fitbv => $left ) (PDF 1.1) Display the page designated by page, with the horizontal coordinate left positioned at the left edge of the window and the contents of the page magnified just enough to fit the entire height of its bounding box within the window. $ant->dest( $page, -xyz => [ $left, $top, $zoom ] ) Display the page designated by page, with the coordinates (left, top) positioned at the top-left corner of the window and the contents of the page magnified by the factor zoom. A zero(0) value for any of the parameters left, top, or zoom specifies that the current value of that parameter is to be retained unchanged. $ant->dest( $name ) (PDF 1.2) Connect the Annotation to a "Named Destination" defined elswere. AUTHOR
Alfred Reibenschuh perl v5.14.2 2014-03-09 PDF::API2::Annotation(3pm)
All times are GMT -4. The time now is 02:37 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy