[Zope] Python script problem

Casey Duncan casey@zope.com
Sat, 10 Aug 2002 22:03:25 -0400


You'd probably have better luck asking the Python list. This doesn't have=
=20
anything to do with Zope.

One suggestion: I'm not sure os.chdir has any affect on spawnl. Try passi=
ng it=20
absolute paths instead.

-Casey

On Saturday 10 August 2002 05:57 am, list_subscriber@neurobs.com wrote:
> Hi,
> I am trying to call 'zip'(linux) from within my python external method.=
 The=20
is
> what I do:
>=20
> ### SRC ###
>=20
> import os
>=20
> src_dir =3D 'some_dir'
> cmd_apth =3D '/usr/bin/zip'
> zip_file_name =3D 'res.zip'
>=20
> os.chdir(src_dir)
> result =3D os.spawnl(os.P_WAIT,cmd_path,'-rv',zip_file_name,'.')
> print result
>=20
> ### END SRC ###
>=20
> the result is always 12 (zip error: Nothing to do). zip creates the
> directory structures in the zip file but does not put in the actual
> files.
>=20
> Now if I do an os.system instead of an os.spawnl it works, however I
> do not want to use it.
>=20
> What is going on here??=20
> Also I have been able to use 'unzip'(Linux) in the same manner without
> a hitch.
>=20
> So what am I doing wrong here?? Why shouldnt it work??
>=20
> TIA
> AM
>=20
> PS: I have played around with the Python ZipFile and zlib module.=20
> Didnt feel comfy so going with this as of now, will probably switch ove=
r=20
later.
>=20
> -----------------------------------------------------------------------=
-
>=20
>=20
> _______________________________________________
> Zope maillist  -  Zope@zope.org
> http://lists.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists -=20
>  http://lists.zope.org/mailman/listinfo/zope-announce
>  http://lists.zope.org/mailman/listinfo/zope-dev )
>=20