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

Import fails when CacheStorage enabled and file contains LF char #1397

Closed
matthewhegarty opened this issue Feb 21, 2022 · 3 comments
Closed
Labels

Comments

@matthewhegarty
Copy link
Contributor

Describe the bug

If using CacheStorage, the process crashes if attempting to import a file with the /r feed char (which was the default on mac os).

I believe this is a bug in tablib.

To Reproduce

  • Set tmp_storage_class to CacheStorage in admin.py
  • Use the UI to import the file tests/core/exports/books-mac.csv
  • The import will fail with 'Error encountered while trying to read file: books-mac.csv'
  • The underlying exception is 'new-line character seen in unquoted field - do you need to open the file in universal-newline mode?'

Versions (please complete the following information):

  • Django Import Export: 2.7.2
  • Python 3.9.10
  • Django 4.0

Expected behavior

The file should import without issue.

Additional context

I found this whilst testing #1306 so wanted to record it here so that it is a known issue.

@matthewhegarty
Copy link
Contributor Author

This is fixed in an upstream change in tablib.

@hugovk
Copy link

hugovk commented Apr 9, 2022

This is fixed in an upstream change in tablib.

Released in Tablib 3.2.1 🚀

https://github.com/jazzband/tablib/releases/tag/v3.2.1

@matthewhegarty
Copy link
Contributor Author

Fixed in release 3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants