#31529: Add support for pathlib and os.PathLike in migrations serializer.
-------------------------------------+-------------------------------------
Reporter: Nick Pope | Owner: Nick Pope
Type: New | Status: assigned
feature |
Component: Database | Version: master
layer (models, ORM) | Keywords: pathlib migrations
Severity: Normal | serializer
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
Some of these types do not serialize as expected or at all.
- We can serialize instances of `os.PathLike` to `str` or `bytes` by using
`repr(os.fspath(value))`.
- We can serialize pathlib instances, converting to
`pathlib.PurePosixPath` or `pathlib.PureWindowsPath`.
It is necessary to serialize concrete paths to pure paths to avoid
migrations that are incompatible on different operating systems.
--
Ticket URL: <https://code.djangoproject.com/ticket/31529>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/050.5d960b15739dcc3ebb90705a06d91574%40djangoproject.com.