0

Getting PermissionError: [Errno 13] Permission denied issue while trying to write into an xml file present in clearcase using python

tree.write(locationXml, pretty_print=True, xml_declaration=True,encoding="UTF-8") 
Nqsir
  • 829
  • 11
  • 19
Amrita
  • 43
  • 3
  • Please help me in this. – Amrita May 24 '19 at 11:11
  • Check your filename and location - this error means what it says, you are not permitted to write to the file you're trying to write to. This could be a directory permission error, or if the file already exists, a file permission error. It could be caused eg. by the file path (`locationXml`?) being incorrect, or your current user account not being permitted to modify the file you want to modify. – user10186512 May 24 '19 at 11:25
  • 1
    ClearCase makes the files readonly. You either have to checkout the file in ClearCase before you attempt to overwrite it, or you need to set the permission to r/w (you can do this in Python with [chmod](https://docs.python.org/3/library/os.html#os.chmod)). But then ClearCase will complain about a "hijacked file". – Adrian W May 24 '19 at 11:37
  • I checkout the file and try to write into it and faced this issue. – Amrita May 24 '19 at 15:00

1 Answers1

0

I checkout the file and try to write into it and faced this issue.

First, it is important to know if is a snapshot or dynamic views.
They have each different edge cases (hijacked vs. eclipsed).

But also it can change with UCM views (where you have to set an UCM activity before being to checkout a file)

In your case, though, check if another process isn't keeping an handle on the file you want to modify, which would explain the error message.
Depending on your OS, check if the file is still accessible once checked out.
For that, a cleartool status in the parent folder of the checked out file remains the best option to get more clues.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250