Mon, Nov 25, 6:45 PM CST

Renderosity Forums / Poser Python Scripting



Welcome to the Poser Python Scripting Forum

Forum Moderators: Staff

Poser Python Scripting F.A.Q (Last Updated: 2024 Sep 18 2:50 am)

We now have a ProPack Section in the Poser FreeStuff.
Check out the new Poser Python Wish List thread. If you have an idea for a script, jot it down and maybe someone can write it. If you're looking to write a script, check out this thread for useful suggestions.

Also, check out the official Python site for interpreters, sample code, applications, cool links and debuggers. This is THE central site for Python.

You can now attach text files to your posts to pass around scripts. Just attach the script as a txt file like you would a jpg or gif. Since the forum will use a random name for the file in the link, you should give instructions on what the file name should be and where to install it. Its a good idea to usually put that info right in the script file as well.

Checkout the Renderosity MarketPlace - Your source for digital art content!



Subject: shutil Advisory


PoseWorks ( ) posted Sun, 15 January 2006 at 12:37 AM · edited Sat, 02 November 2024 at 3:32 AM

Avoid the shutil module when scripting for Poser 6. This module appears to be broken on a large number of installations.


nruddock ( ) posted Sun, 15 January 2006 at 8:12 AM

Broken in some other way than the docs mention (lost resources, file types and creator codes on MacOS)?


PoseWorks ( ) posted Sun, 15 January 2006 at 11:51 PM

A large number of P6 users receive this error with any usage of shutil: File "C:Program FilesCurious LabsPoser 6RuntimePythonlibshutil.py", line 29, in copyfile fdst = open(dst, 'wb') IOError: Invalid argument: wb


nruddock ( ) posted Mon, 16 January 2006 at 5:18 AM

The most likely cause is that the destination file name contains an invalid character.
At least this is the only way I can get this error.

E.g.

import shutil<br></br><br></br>shutil.copyfile("I:/Temp/ro/test.txt", "I:/Temp/ro/test*1.txt")

On a Mac (or any *nix system) you'd get away with this, but not on Windows.


nruddock ( ) posted Mon, 16 January 2006 at 1:46 PM

Further investigation reveals that the real problem is in the error checking of open_the_file in fileobject.c
The interpretation of the error number returned by Windows was corrected on April 8th 2002, in release 2.2.1
See -> Diff for change


PoseWorks ( ) posted Mon, 16 January 2006 at 5:54 PM

I know the file name is valid--Poser would have barfed and died long before if it hadn't been. Thanks for the investigation, nruddock. I'm still not certain why some users have problems with this while others don't, or why this does not appear to be an issue for Poser 5 users (who also use Py 2.2). In any event, avoid shutil for P6 projects.


Privacy Notice

This site uses cookies to deliver the best experience. Our own cookies make user accounts and other features possible. Third-party cookies are used to display relevant ads and to analyze how Renderosity is used. By using our site, you acknowledge that you have read and understood our Terms of Service, including our Cookie Policy and our Privacy Policy.