0

I am trying to delete a client but I get the following error : "Identifiers too long. Must not be longer than 1024 bytes of UTF-8." My code goes smth like this:

  try: 
  client=p4.fetch_client("-S", stream_root, client_name)
  client._root = client_root
  client._client = client_name
  p4.save_client(client)
  p4.client = client_name
  p4.run_sync("-f", root_path) 
  ......
  p4.run("client", "-d", client)
  logging.info("Workspace" + client + "deleted") 

Any idea if my lines are correct or what could be missing?

1 Answers1

1

client in your script is the entire client spec. The argument to p4 client -d is just the client name:

p4.run("client", "-d", client_name)
Samwise
  • 68,105
  • 3
  • 30
  • 44
  • Thank you very much, one more question I’m also trying to delete the folder I created for my client in my PC in the end of my code, somehow I get error and it doesn' get deleted. My code goes like this: `try: client=p4.fetch_client("-S", stream_root, client_name) client._root = client_root client._client = client_name p4.save_client(client) p4.client = client_name p4.run_sync("-f", root_path) ...... p4.run("client", "-d", client_name) shutil.rmtree(client_root)` Error : `return _rmtree_unsafe(path,onerror) _rmtree(fullname, onerror) ...` – user14635293 Jan 21 '21 at 16:48
  • That sounds like it's a problem with your `_rmtree_unsafe` function, not anything in the P4 API. Might want to post a new question. – Samwise Jan 21 '21 at 16:51