Compare commits

...

5 commits

Author SHA1 Message Date
Jinx
c535f03fe3
Merge 72bc34e4af into 752c80d29f 2024-12-24 12:28:10 +01:00
dependabot[bot]
752c80d29f Update flask-cors requirement from <4,>=3.0.8 to >=3.0.8,<6
Some checks failed
CI / lint (push) Has been cancelled
CI / docs (push) Has been cancelled
Docker build / test (push) Has been cancelled
CI / test (mariadb, minimal, 3.11) (push) Has been cancelled
CI / test (mariadb, normal, 3.11) (push) Has been cancelled
CI / test (mariadb, normal, 3.9) (push) Has been cancelled
CI / test (postgresql, minimal, 3.11) (push) Has been cancelled
CI / test (postgresql, normal, 3.11) (push) Has been cancelled
CI / test (postgresql, normal, 3.9) (push) Has been cancelled
CI / test (sqlite, minimal, 3.10) (push) Has been cancelled
CI / test (sqlite, minimal, 3.11) (push) Has been cancelled
CI / test (sqlite, minimal, 3.12) (push) Has been cancelled
CI / test (sqlite, minimal, 3.9) (push) Has been cancelled
CI / test (sqlite, normal, 3.10) (push) Has been cancelled
CI / test (sqlite, normal, 3.11) (push) Has been cancelled
CI / test (sqlite, normal, 3.12) (push) Has been cancelled
CI / test (sqlite, normal, 3.8) (push) Has been cancelled
CI / test (sqlite, normal, 3.9) (push) Has been cancelled
Docker build / build_upload (push) Has been cancelled
Updates the requirements on [flask-cors](https://github.com/corydolphin/flask-cors) to permit the latest version.
- [Release notes](https://github.com/corydolphin/flask-cors/releases)
- [Changelog](https://github.com/corydolphin/flask-cors/blob/main/CHANGELOG.md)
- [Commits](https://github.com/corydolphin/flask-cors/compare/3.0.8...5.0.0)

---
updated-dependencies:
- dependency-name: flask-cors
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-24 12:28:05 +01:00
Jinx
72bc34e4af Fixed the way the #1288 csv file test is loaded 2024-02-19 16:25:30 +08:00
Jinx
f9e1e9241c
Merge branch 'spiral-project:master' into master 2024-02-19 16:00:47 +08:00
Jinx
12c77b4850 Fixing the issue of garbled characters (Chinese characters) when opening the CSV export in Microsoft Excel. 2024-02-04 14:20:10 +08:00
3 changed files with 6 additions and 6 deletions

View file

@ -442,7 +442,7 @@ class TestExport(IhatemoneyTestCase):
'2016-12-31,red wine,Expense,XXX,200.0,jeanne,1.0,"zorglub, tata"',
'2016-12-31,à raclette,Expense,10.0,XXX,zorglub,2.0,"zorglub, jeanne, tata, pépé"',
]
received_lines = resp.data.decode("utf-8").split("\n")
received_lines = resp.data.decode("utf-8-sig").split("\n")
for i, line in enumerate(expected):
assert set(line.split(",")) == set(received_lines[i].strip("\r").split(","))
@ -476,7 +476,7 @@ class TestExport(IhatemoneyTestCase):
"55.34,XXX,jeanne,tata",
"127.33,XXX,jeanne,zorglub",
]
received_lines = resp.data.decode("utf-8").split("\n")
received_lines = resp.data.decode("utf-8-sig").split("\n")
for i, line in enumerate(expected):
assert set(line.split(",")) == set(received_lines[i].strip("\r").split(","))
@ -682,7 +682,7 @@ class TestExport(IhatemoneyTestCase):
"date,what,bill_type,amount,currency,payer_name,payer_weight,owers",
"2016-12-31,'=COS(36),Expense,10.0,EUR,zorglub,1.0,zorglub",
]
received_lines = resp.data.decode("utf-8").split("\n")
received_lines = resp.data.decode("utf-8-sig").split("\n")
for i, line in enumerate(expected):
assert set(line.split(",")) == set(received_lines[i].strip("\r").split(","))

View file

@ -194,7 +194,7 @@ def list_of_dicts2csv(dict_to_convert):
writer = csv.writer(csv_file)
writer.writerows(csv_data)
csv_file.seek(0)
csv_file = BytesIO(csv_file.getvalue().encode("utf-8"))
csv_file = BytesIO(csv_file.getvalue().encode("utf-8-sig"))
return csv_file
@ -202,7 +202,7 @@ def csv2list_of_dicts(csv_to_convert):
"""Take a csv in-memory file and turns it into
a list of dictionnaries
"""
csv_file = TextIOWrapper(csv_to_convert, encoding="utf-8")
csv_file = TextIOWrapper(csv_to_convert, encoding="utf-8-sig")
reader = csv.DictReader(csv_file)
result = []
for r in reader:

View file

@ -32,7 +32,7 @@ dependencies = [
"email_validator>=1.0,<3",
"Flask>=2,<4",
"Flask-Babel>=1.0,<4",
"Flask-Cors>=3.0.8,<4",
"Flask-Cors>=3.0.8,<6",
"Flask-Limiter>=2.6,<3",
"Flask-Mail>=0.9.1,<1",
"Flask-Migrate>=2.5.3,<5", # Not following semantic versioning (e.g. https://github.com/miguelgrinberg/flask-migrate/commit/1af28ba273de6c88544623b8dc02dd539340294b)