Serhiy Storchaka added the comment:
open() does not create parent directories either. And no any function in the
stdlib which creates a file does it. It would be rather error-prone if they do,
because you can create a file at wrong place.
So just create a directory if you need to, and let
New submission from Terunobu Inaba :
In the xml.etree.ElementTree module, the function "write(args)"
(https://docs.python.org/ja/3/library/xml.etree.elementtree.html) does not seem
to have a function like "-p" in "mkdir -p" in UNIX system, i.e., it will raise
an error when some directories