Commit 60ab634c by Sébastien Eustace

Read/write the pyproject.tom file using utf-8

parent 65fad088
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
- Changed the dependency installation order, deepest dependencies are now installed first. - Changed the dependency installation order, deepest dependencies are now installed first.
- Improved solver error messages. - Improved solver error messages.
- `poetry` now always reads/writes the `pyproject.toml` file with the `utf-8` encoding.
### Fixed ### Fixed
......
...@@ -17,7 +17,7 @@ class TomlFile: ...@@ -17,7 +17,7 @@ class TomlFile:
return self._path return self._path
def read(self, raw=False): # type: (bool) -> dict def read(self, raw=False): # type: (bool) -> dict
with self._path.open() as f: with self._path.open(encoding="utf-8") as f:
if raw: if raw:
return toml.loads(f.read()) return toml.loads(f.read())
...@@ -29,7 +29,7 @@ class TomlFile: ...@@ -29,7 +29,7 @@ class TomlFile:
else: else:
data = dumps(data) data = dumps(data)
with self._path.open("w") as f: with self._path.open("w", encoding="utf-8") as f:
f.write(data) f.write(data)
def __getattr__(self, item): def __getattr__(self, item):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment