Skip to content

Commit

Permalink
Changing os.path to posixpath to prevent issues
Browse files Browse the repository at this point in the history
Changing os.path to posixpath to prevent issues when using pyminio in Windows environments.

os.path uses the current system file system separator and adjust all its functions to that.
MinIO is always a posix path system. When using Pyminio in a Windows system, the paths got undesirable changed, because os.path set them to comply with Windows file system format.

This update prevents that issue to happen.
  • Loading branch information
novama committed Aug 11, 2024
1 parent 6aa6be6 commit 683a89e
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
3 changes: 1 addition & 2 deletions pyminio/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
from datetime import datetime, timezone
from functools import wraps
from io import BytesIO
from os.path import basename, join, normpath
from posixpath import dirname
from posixpath import basename, join, normpath, dirname
from typing import Any, Callable, Dict, Iterable, List, Tuple, Type, TypeVar, Union

from minio import Minio, datatypes
Expand Down
2 changes: 1 addition & 1 deletion pyminio/structures.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import re
from dataclasses import dataclass
from functools import cached_property
from os.path import join
from posixpath import join
from typing import Any, Dict

ROOT = "/"
Expand Down
2 changes: 1 addition & 1 deletion tests/test_pyminio.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from functools import wraps
from os.path import join
from posixpath import join
from typing import Callable, Dict, Generator, List, Union

import pytest
Expand Down

0 comments on commit 683a89e

Please sign in to comment.