[p4python] Odd behavior on save

Wright, Richard richardw at cobaltgroup.com
Thu Sep 8 13:19:13 PDT 2005


I have spent some time narrowing down this problem to the minimum that I can
come up with to recreate it, and I want to see if anyone else out there can
reproduce it.
 
Take the following code:
import p4

p4c = p4.P4()
p4c.parse_forms()
p4c.connect()
 
updateclient = {'Client' : 'richardw_client_test',
                'Description' : 'This is a test',
                'Host' : 'SEA-RICHARDW2',
                'Update' : '2005/09/09 11:25:35',
                'Access' : '2005/09/09 11:23:32',
                'Owner' : 'richardw',
                'LineEnd' : 'local',
                'Root' : r'c:\Documents and Settings\richardw',
                'Options' : 'noallwrite noclobber nocompress unlocked
nomodtime normdir',
                'View' : ['//Tools/... //richardw_client_test/Tools/...',
                          '//Specs/... //richardw_client_test/Specs/...']}
 
#p4c.fetch_client('richardw_client_test')
print p4c.save_client(updateclient)
p4c.disconnect()

The code as above gives me the following error:
P4Error: Error in client specification.
Missing required field 'Client'.

However, if I uncomment the "fetch" line, it works.  Note that I am not
saving the results of the fetch method to anything, simply running it.  I
still pass the "updateclient" dictionary to the "save" method.  Any thoughts
about what may change when the fetch method is run?
 
For the record, this is on Windows 2000, Python 2.4, and p4Python 0.6 (and
the API included in that package), connecting to a 2005.1 Perforce server.
Also note that the 'richardw_client_test' client is not new but was
originally created with P4V.

Rick Wright
CM/Build Engineer
The Cobalt Group, Inc.
2200 First Avenue South
Seattle, WA 98134
richardw at cobaltgroup.com <mailto:richardw at cobaltgroup.com> 
www.cobaltgroup.com 

p. 206.219.8382

 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://maillist.perforce.com/pipermail/p4python/attachments/20050908/e74d82fb/attachment-0001.html>


More information about the p4python mailing list