[PR #1432] [MERGED] fix import command #2227

Closed
opened 2026-02-27 12:09:57 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/modoboa/modoboa/pull/1432
Author: @ghost
Created: 3/11/2018
Status: Merged
Merged: 4/6/2018
Merged by: @tonioo

Base: masterHead: fix/1430


📝 Commits (4)

  • 3bd365e fix import command
  • dab91eb only use backports.csv on python 2
  • e9c1b53 when importing use chardet if utf-8 fails
  • 26fad9b Merge branch 'master' into fix/1430

📊 Changes

8 files changed (+140 additions, -13 deletions)

View changed files

📝 modoboa/admin/management/commands/subcommands/_export.py (+6 -2)
📝 modoboa/admin/management/commands/subcommands/_import.py (+53 -8)
modoboa/admin/tests/test_data/import_domains.csv (+2 -0)
modoboa/admin/tests/test_data/import_domains_duplicates.csv (+3 -0)
📝 modoboa/admin/tests/test_import_.py (+64 -0)
📝 modoboa/admin/views/export.py (+5 -1)
📝 modoboa/admin/views/import_.py (+6 -1)
📝 requirements.txt (+1 -1)

📄 Description

I can't replicate the issue in #1430, but here's a couple of changes that might fix it.

  • ensure command line args are unicode(py2)/str(py3)

  • use io.open to open file with utf8 encoding

  • set newlines="" in open commands, csv module takes care of line endings

  • add tests for import command


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/modoboa/modoboa/pull/1432 **Author:** [@ghost](https://github.com/ghost) **Created:** 3/11/2018 **Status:** ✅ Merged **Merged:** 4/6/2018 **Merged by:** [@tonioo](https://github.com/tonioo) **Base:** `master` ← **Head:** `fix/1430` --- ### 📝 Commits (4) - [`3bd365e`](https://github.com/modoboa/modoboa/commit/3bd365e78c49f0a3779d534dfe52d8055e8dc20e) fix import command - [`dab91eb`](https://github.com/modoboa/modoboa/commit/dab91eb1496512836cea0a4fd9cdf66986c84686) only use backports.csv on python 2 - [`e9c1b53`](https://github.com/modoboa/modoboa/commit/e9c1b53bb89eacb77f2f1cb1dd24f5dcb756181f) when importing use chardet if utf-8 fails - [`26fad9b`](https://github.com/modoboa/modoboa/commit/26fad9b0b7f971260ea2f09ce559763b997e74cd) Merge branch 'master' into fix/1430 ### 📊 Changes **8 files changed** (+140 additions, -13 deletions) <details> <summary>View changed files</summary> 📝 `modoboa/admin/management/commands/subcommands/_export.py` (+6 -2) 📝 `modoboa/admin/management/commands/subcommands/_import.py` (+53 -8) ➕ `modoboa/admin/tests/test_data/import_domains.csv` (+2 -0) ➕ `modoboa/admin/tests/test_data/import_domains_duplicates.csv` (+3 -0) 📝 `modoboa/admin/tests/test_import_.py` (+64 -0) 📝 `modoboa/admin/views/export.py` (+5 -1) 📝 `modoboa/admin/views/import_.py` (+6 -1) 📝 `requirements.txt` (+1 -1) </details> ### 📄 Description I can't replicate the issue in #1430, but here's a couple of changes that might fix it. - ensure command line args are unicode(py2)/str(py3) - use io.open to open file with utf8 encoding - set newlines="" in open commands, csv module takes care of line endings - add tests for import command --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-27 12:09:57 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/modoboa-modoboa#2227
No description provided.