On the commandline you have to extend the PATH variable with the directory bin2:
$ PATH=$PATH:/home/bernd/bin2
$ ./execvp.py
/home/bernd/bin2/test.sh, abc
XYZ:
PATH: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/bin:/home/bernd/bin:/home/bernd/bin2
current directory: /home/bernd/python