- 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.
* has_patch: 0 => 1
Comment:
[https://github.com/django/django/pull/12839 PR]
--
Ticket URL: <https://code.djangoproject.com/ticket/31529#comment:1>
* component: Database layer (models, ORM) => Migrations
* stage: Unreviewed => Accepted
--
Ticket URL: <https://code.djangoproject.com/ticket/31529#comment:2>
* stage: Accepted => Ready for checkin
--
Ticket URL: <https://code.djangoproject.com/ticket/31529#comment:3>
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"074844e9479a9ee1420685b36189aa2881289993" 074844e9]:
{{{
#!CommitTicketReference repository=""
revision="074844e9479a9ee1420685b36189aa2881289993"
Fixed #31529 -- Added support for serialization of pathlib.Path/PurePath
and os.PathLike in migrations.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/31529#comment:4>