Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix to address issues with handling pathlib-based paths - Closes #49 #54

Merged
merged 2 commits into from
Jun 24, 2021

Conversation

jcohen02
Copy link
Collaborator

In more recent versions of Django, the django-admin startproject script creates a settings file where BASE_DIR is specified using pathlib.Path. In older versions it was set using os.path.

django-drf-filepond has some code that attempts to use string functions on BASE_DIR assuming that it is a string. However, if the startproject command was used and the default BASE_DIR setting is left in place, this will cause issues in certain circumstances.

This fix addresses these problems while also retaining support for Python 2.7 (despite being well beyond EOL, aiming to keep support for legacy apps using django-drf-filepond for now), which doesn't have the pathlib module. The fix also retainins support for Python 3.5 which does have pathlib, but where the os.path.join function, which is also used with BASE_DIR in this library, can't accept pathlib.Path obejcts as parameters.

@jcohen02 jcohen02 self-assigned this Jun 23, 2021
@jcohen02 jcohen02 merged commit dca2e3a into master Jun 24, 2021
@jcohen02 jcohen02 deleted the fix/issue49 branch June 24, 2021 07:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant