{"action":"closed","issue":{"url":"https://api.github.com/repos/evansd/whitenoise/issues/192","repository_url":"https://api.github.com/repos/evansd/whitenoise","labels_url":"https://api.github.com/repos/evansd/whitenoise/issues/192/labels{/name}","comments_url":"https://api.github.com/repos/evansd/whitenoise/issues/192/comments","events_url":"https://api.github.com/repos/evansd/whitenoise/issues/192/events","html_url":"https://github.com/evansd/whitenoise/issues/192","id":350080321,"node_id":"MDU6SXNzdWUzNTAwODAzMjE=","number":192,"title":"Incompatible with Pathlib from v4.0","user":{"login":"browniebroke","id":861044,"node_id":"MDQ6VXNlcjg2MTA0NA==","avatar_url":"https://avatars1.githubusercontent.com/u/861044?v=4","gravatar_id":"","url":"https://api.github.com/users/browniebroke","html_url":"https://github.com/browniebroke","followers_url":"https://api.github.com/users/browniebroke/followers","following_url":"https://api.github.com/users/browniebroke/following{/other_user}","gists_url":"https://api.github.com/users/browniebroke/gists{/gist_id}","starred_url":"https://api.github.com/users/browniebroke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/browniebroke/subscriptions","organizations_url":"https://api.github.com/users/browniebroke/orgs","repos_url":"https://api.github.com/users/browniebroke/repos","events_url":"https://api.github.com/users/browniebroke/events{/privacy}","received_events_url":"https://api.github.com/users/browniebroke/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-08-13T15:31:15Z","updated_at":"2018-09-11T21:50:46Z","closed_at":"2018-09-11T21:50:46Z","author_association":"CONTRIBUTOR","body":"Python 3.4 added an awesome tool for working with path, [Pathlib](https://docs.python.org/3/library/pathlib.html), which has a nicer API than `os.path`. We've set up our Django project as follow:\r\n\r\n```python\r\nfrom pathlib import Path\r\n\r\nBASE_DIR = (Path(__file__) / '..' / '..' / '..' / '..').resolve()\r\nSTATICFILES_DIRS = [\r\n    BASE_DIR / 'static-build',\r\n]\r\nSTATIC_ROOT = BASE_DIR / 'staticfiles'\r\n```\r\n\r\nSome changes [added in v4.0](https://github.com/evansd/whitenoise/blob/d1f3e2762c75912458f68924ff5f7068da4a130f/whitenoise/base.py#L92) are now relying on [`str.rstrip`](https://docs.python.org/3/library/stdtypes.html?highlight=rstrip#str.rstrip) when processing files to account for trailing slash (I assume). \r\n\r\nHowever, this is breaking our project as pathlib doesn't have the `rstrip()` method:\r\n\r\n```\r\nAttributeError: 'PosixPath' object has no attribute 'rstrip'\r\n```\r\n\r\nI'll try to send a patch to fix this.\r\n"}}
{"actor":{"display_login":"evansd"}}