OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

How can I tell Pyyaml to convert PosixPath to str in yaml.dump?

  • Thread starter Thread starter xaviersjs
  • Start date Start date
X

xaviersjs

Guest
I understand that YAML allows you to represent arbitrary data using tags. I would like to convert a PosixPath to a str instead of representing it as a !!pathlib.PosixPath. How can I tell pyyaml to convert PosixPath to str every time it encounters the type?
<p>I understand that YAML allows you to represent arbitrary data using tags. I would like to convert a PosixPath to a str instead of representing it as a <code>!!pathlib.PosixPath</code>. How can I tell pyyaml to convert PosixPath to str every time it encounters the type?</p>
 

Latest posts

Top