fsspec 2023.9.0__tar.gz → 2023.9.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. {fsspec-2023.9.0/fsspec.egg-info → fsspec-2023.9.1}/PKG-INFO +1 -1
  2. {fsspec-2023.9.0 → fsspec-2023.9.1}/fsspec/_version.py +3 -3
  3. {fsspec-2023.9.0 → fsspec-2023.9.1}/fsspec/asyn.py +2 -2
  4. {fsspec-2023.9.0 → fsspec-2023.9.1}/fsspec/caching.py +1 -1
  5. {fsspec-2023.9.0 → fsspec-2023.9.1}/fsspec/core.py +1 -9
  6. {fsspec-2023.9.0 → fsspec-2023.9.1}/fsspec/gui.py +4 -2
  7. {fsspec-2023.9.0 → fsspec-2023.9.1}/fsspec/implementations/cache_metadata.py +40 -14
  8. {fsspec-2023.9.0 → fsspec-2023.9.1}/fsspec/implementations/cached.py +11 -1
  9. {fsspec-2023.9.0 → fsspec-2023.9.1}/fsspec/implementations/http.py +1 -1
  10. {fsspec-2023.9.0 → fsspec-2023.9.1}/fsspec/implementations/reference.py +8 -8
  11. {fsspec-2023.9.0 → fsspec-2023.9.1}/fsspec/implementations/smb.py +21 -17
  12. {fsspec-2023.9.0 → fsspec-2023.9.1}/fsspec/spec.py +2 -2
  13. {fsspec-2023.9.0 → fsspec-2023.9.1/fsspec.egg-info}/PKG-INFO +1 -1
  14. {fsspec-2023.9.0 → fsspec-2023.9.1}/LICENSE +0 -0
  15. {fsspec-2023.9.0 → fsspec-2023.9.1}/MANIFEST.in +0 -0
  16. {fsspec-2023.9.0 → fsspec-2023.9.1}/README.md +0 -0
  17. {fsspec-2023.9.0 → fsspec-2023.9.1}/fsspec/__init__.py +0 -0
  18. {fsspec-2023.9.0 → fsspec-2023.9.1}/fsspec/archive.py +0 -0
  19. {fsspec-2023.9.0 → fsspec-2023.9.1}/fsspec/callbacks.py +0 -0
  20. {fsspec-2023.9.0 → fsspec-2023.9.1}/fsspec/compression.py +0 -0
  21. {fsspec-2023.9.0 → fsspec-2023.9.1}/fsspec/config.py +0 -0
  22. {fsspec-2023.9.0 → fsspec-2023.9.1}/fsspec/conftest.py +0 -0
  23. {fsspec-2023.9.0 → fsspec-2023.9.1}/fsspec/dircache.py +0 -0
  24. {fsspec-2023.9.0 → fsspec-2023.9.1}/fsspec/exceptions.py +0 -0
  25. {fsspec-2023.9.0 → fsspec-2023.9.1}/fsspec/fuse.py +0 -0
  26. {fsspec-2023.9.0 → fsspec-2023.9.1}/fsspec/generic.py +0 -0
  27. {fsspec-2023.9.0 → fsspec-2023.9.1}/fsspec/implementations/__init__.py +0 -0
  28. {fsspec-2023.9.0 → fsspec-2023.9.1}/fsspec/implementations/arrow.py +0 -0
  29. {fsspec-2023.9.0 → fsspec-2023.9.1}/fsspec/implementations/cache_mapper.py +0 -0
  30. {fsspec-2023.9.0 → fsspec-2023.9.1}/fsspec/implementations/dask.py +0 -0
  31. {fsspec-2023.9.0 → fsspec-2023.9.1}/fsspec/implementations/dbfs.py +0 -0
  32. {fsspec-2023.9.0 → fsspec-2023.9.1}/fsspec/implementations/dirfs.py +0 -0
  33. {fsspec-2023.9.0 → fsspec-2023.9.1}/fsspec/implementations/ftp.py +0 -0
  34. {fsspec-2023.9.0 → fsspec-2023.9.1}/fsspec/implementations/git.py +0 -0
  35. {fsspec-2023.9.0 → fsspec-2023.9.1}/fsspec/implementations/github.py +0 -0
  36. {fsspec-2023.9.0 → fsspec-2023.9.1}/fsspec/implementations/jupyter.py +0 -0
  37. {fsspec-2023.9.0 → fsspec-2023.9.1}/fsspec/implementations/libarchive.py +0 -0
  38. {fsspec-2023.9.0 → fsspec-2023.9.1}/fsspec/implementations/local.py +0 -0
  39. {fsspec-2023.9.0 → fsspec-2023.9.1}/fsspec/implementations/memory.py +0 -0
  40. {fsspec-2023.9.0 → fsspec-2023.9.1}/fsspec/implementations/sftp.py +0 -0
  41. {fsspec-2023.9.0 → fsspec-2023.9.1}/fsspec/implementations/tar.py +0 -0
  42. {fsspec-2023.9.0 → fsspec-2023.9.1}/fsspec/implementations/webhdfs.py +0 -0
  43. {fsspec-2023.9.0 → fsspec-2023.9.1}/fsspec/implementations/zip.py +0 -0
  44. {fsspec-2023.9.0 → fsspec-2023.9.1}/fsspec/mapping.py +0 -0
  45. {fsspec-2023.9.0 → fsspec-2023.9.1}/fsspec/parquet.py +0 -0
  46. {fsspec-2023.9.0 → fsspec-2023.9.1}/fsspec/registry.py +0 -0
  47. {fsspec-2023.9.0 → fsspec-2023.9.1}/fsspec/tests/abstract/__init__.py +0 -0
  48. {fsspec-2023.9.0 → fsspec-2023.9.1}/fsspec/tests/abstract/common.py +0 -0
  49. {fsspec-2023.9.0 → fsspec-2023.9.1}/fsspec/tests/abstract/copy.py +0 -0
  50. {fsspec-2023.9.0 → fsspec-2023.9.1}/fsspec/tests/abstract/get.py +0 -0
  51. {fsspec-2023.9.0 → fsspec-2023.9.1}/fsspec/tests/abstract/put.py +0 -0
  52. {fsspec-2023.9.0 → fsspec-2023.9.1}/fsspec/transaction.py +0 -0
  53. {fsspec-2023.9.0 → fsspec-2023.9.1}/fsspec/utils.py +0 -0
  54. {fsspec-2023.9.0 → fsspec-2023.9.1}/fsspec.egg-info/SOURCES.txt +0 -0
  55. {fsspec-2023.9.0 → fsspec-2023.9.1}/fsspec.egg-info/dependency_links.txt +0 -0
  56. {fsspec-2023.9.0 → fsspec-2023.9.1}/fsspec.egg-info/not-zip-safe +0 -0
  57. {fsspec-2023.9.0 → fsspec-2023.9.1}/fsspec.egg-info/requires.txt +0 -0
  58. {fsspec-2023.9.0 → fsspec-2023.9.1}/fsspec.egg-info/top_level.txt +0 -0
  59. {fsspec-2023.9.0 → fsspec-2023.9.1}/pyproject.toml +0 -0
  60. {fsspec-2023.9.0 → fsspec-2023.9.1}/requirements.txt +0 -0
  61. {fsspec-2023.9.0 → fsspec-2023.9.1}/setup.cfg +0 -0
  62. {fsspec-2023.9.0 → fsspec-2023.9.1}/setup.py +0 -0
  63. {fsspec-2023.9.0 → fsspec-2023.9.1}/versioneer.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: fsspec
3
- Version: 2023.9.0
3
+ Version: 2023.9.1
4
4
  Summary: File-system specification
5
5
  Home-page: http://github.com/fsspec/filesystem_spec
6
6
  Maintainer: Martin Durant
@@ -8,11 +8,11 @@ import json
8
8
 
9
9
  version_json = '''
10
10
  {
11
- "date": "2023-09-02T07:50:40-0400",
11
+ "date": "2023-09-15T16:17:21-0400",
12
12
  "dirty": false,
13
13
  "error": null,
14
- "full-revisionid": "f5d24b80a0768bf07a113647d7b4e74a3a2999e0",
15
- "version": "2023.9.0"
14
+ "full-revisionid": "247b249a008990c584d2619f030bd42916a82e4a",
15
+ "version": "2023.9.1"
16
16
  }
17
17
  ''' # END VERSION_JSON
18
18
 
@@ -833,7 +833,7 @@ class AsyncFileSystem(AbstractFileSystem):
833
833
 
834
834
  async def _find(self, path, maxdepth=None, withdirs=False, **kwargs):
835
835
  path = self._strip_protocol(path)
836
- out = dict()
836
+ out = {}
837
837
  detail = kwargs.pop("detail", False)
838
838
 
839
839
  # Add the root directory if withdirs is requested
@@ -891,7 +891,7 @@ class AsyncFileSystem(AbstractFileSystem):
891
891
  out.add(p)
892
892
  if not out:
893
893
  raise FileNotFoundError(path)
894
- return list(sorted(out))
894
+ return sorted(out)
895
895
 
896
896
  async def _mkdir(self, path, create_parents=True, **kwargs):
897
897
  pass # not necessary to implement, may not have directories
@@ -456,7 +456,7 @@ class KnownPartsOfAFile(BaseCache):
456
456
 
457
457
  # simple consolidation of contiguous blocks
458
458
  if data:
459
- old_offsets = sorted(list(data.keys()))
459
+ old_offsets = sorted(data.keys())
460
460
  offsets = [old_offsets[0]]
461
461
  blocks = [data.pop(old_offsets[0])]
462
462
  for start, stop in old_offsets[1:]:
@@ -210,7 +210,6 @@ def open_files(
210
210
  num=1,
211
211
  protocol=None,
212
212
  newline=None,
213
- auto_mkdir=True,
214
213
  expand=True,
215
214
  **kwargs,
216
215
  ):
@@ -249,9 +248,6 @@ def open_files(
249
248
  newline: bytes or None
250
249
  Used for line terminator in text mode. If None, uses system default;
251
250
  if blank, uses no translation.
252
- auto_mkdir: bool (True)
253
- If in write mode, this will ensure the target directory exists before
254
- writing, by calling ``fs.mkdirs(exist_ok=True)``.
255
251
  expand: bool
256
252
  **kwargs: dict
257
253
  Extra options that make sense to a particular storage connection, e.g.
@@ -288,9 +284,6 @@ def open_files(
288
284
  protocol=protocol,
289
285
  expand=expand,
290
286
  )
291
- if "r" not in mode and auto_mkdir:
292
- parents = {fs._parent(path) for path in paths}
293
- [fs.makedirs(parent, exist_ok=True) for parent in parents]
294
287
  return OpenFiles(
295
288
  [
296
289
  OpenFile(
@@ -363,7 +356,6 @@ def url_to_fs(url, **kwargs):
363
356
  # non-FS arguments that appear in fsspec.open()
364
357
  # inspect could keep this in sync with open()'s signature
365
358
  known_kwargs = {
366
- "auto_mkdir",
367
359
  "compression",
368
360
  "encoding",
369
361
  "errors",
@@ -625,7 +617,7 @@ def get_fs_token_paths(
625
617
  pchains = [
626
618
  _un_chain(stringify_path(u), storage_options or {})[0] for u in urlpath
627
619
  ]
628
- if len(set(pc[1] for pc in pchains)) > 1:
620
+ if len({pc[1] for pc in pchains}) > 1:
629
621
  raise ValueError("Protocol mismatch getting fs from %s", urlpath)
630
622
  paths = [pc[0] for pc in pchains]
631
623
  else:
@@ -257,12 +257,14 @@ class FileSelector(SigSlot):
257
257
  width_policy="max",
258
258
  )
259
259
  self.protocol = pn.widgets.Select(
260
- options=list(sorted(known_implementations)),
260
+ options=sorted(known_implementations),
261
261
  value=self.init_protocol,
262
262
  name="protocol",
263
263
  align="center",
264
264
  )
265
- self.kwargs = pn.widgets.TextInput(name="kwargs", value="{}", align="center")
265
+ self.kwargs = pn.widgets.TextInput(
266
+ name="kwargs", value=self.init_kwargs, align="center"
267
+ )
266
268
  self.go = pn.widgets.Button(name="⇨", align="end", width=45)
267
269
  self.main = SingleSelect(size=10)
268
270
  self.home = pn.widgets.Button(name="🏠", width=40, height=30, align="end")
@@ -7,6 +7,12 @@ from typing import TYPE_CHECKING
7
7
 
8
8
  from fsspec.utils import atomic_write
9
9
 
10
+ try:
11
+ import ujson as json
12
+ except ImportError:
13
+ if not TYPE_CHECKING:
14
+ import json
15
+
10
16
  if TYPE_CHECKING:
11
17
  from typing import Any, Dict, Iterator, Literal
12
18
 
@@ -23,7 +29,9 @@ class CacheMetadata:
23
29
  All reading and writing of cache metadata is performed by this class,
24
30
  accessing the cached files and blocks is not.
25
31
 
26
- Metadata is stored in a single file per storage directory, pickled.
32
+ Metadata is stored in a single file per storage directory in JSON format.
33
+ For backward compatibility, also reads metadata stored in pickle format
34
+ which is converted to JSON when next saved.
27
35
  """
28
36
 
29
37
  def __init__(self, storage: list[str]):
@@ -41,6 +49,28 @@ class CacheMetadata:
41
49
  self._storage = storage
42
50
  self.cached_files: list[Detail] = [{}]
43
51
 
52
+ # Private attribute to force saving of metadata in pickle format rather than
53
+ # JSON for use in tests to confirm can read both pickle and JSON formats.
54
+ self._force_save_pickle = False
55
+
56
+ def _load(self, fn: str) -> Detail:
57
+ """Low-level function to load metadata from specific file"""
58
+ try:
59
+ with open(fn, "r") as f:
60
+ return json.load(f)
61
+ except ValueError:
62
+ with open(fn, "rb") as f:
63
+ return pickle.load(f)
64
+
65
+ def _save(self, metadata_to_save: Detail, fn: str) -> None:
66
+ """Low-level function to save metadata to specific file"""
67
+ if self._force_save_pickle:
68
+ with atomic_write(fn) as f:
69
+ pickle.dump(metadata_to_save, f)
70
+ else:
71
+ with atomic_write(fn, mode="w") as f:
72
+ json.dump(metadata_to_save, f)
73
+
44
74
  def _scan_locations(
45
75
  self, writable_only: bool = False
46
76
  ) -> Iterator[tuple[str, str, bool]]:
@@ -111,8 +141,7 @@ class CacheMetadata:
111
141
 
112
142
  if self.cached_files[-1]:
113
143
  cache_path = os.path.join(self._storage[-1], "cache")
114
- with atomic_write(cache_path) as fc:
115
- pickle.dump(self.cached_files[-1], fc)
144
+ self._save(self.cached_files[-1], cache_path)
116
145
 
117
146
  writable_cache_empty = not self.cached_files[-1]
118
147
  return expired_files, writable_cache_empty
@@ -122,13 +151,12 @@ class CacheMetadata:
122
151
  cached_files = []
123
152
  for fn, _, _ in self._scan_locations():
124
153
  if os.path.exists(fn):
125
- with open(fn, "rb") as f:
126
- # TODO: consolidate blocks here
127
- loaded_cached_files = pickle.load(f)
128
- for c in loaded_cached_files.values():
129
- if isinstance(c["blocks"], list):
130
- c["blocks"] = set(c["blocks"])
131
- cached_files.append(loaded_cached_files)
154
+ # TODO: consolidate blocks here
155
+ loaded_cached_files = self._load(fn)
156
+ for c in loaded_cached_files.values():
157
+ if isinstance(c["blocks"], list):
158
+ c["blocks"] = set(c["blocks"])
159
+ cached_files.append(loaded_cached_files)
132
160
  else:
133
161
  cached_files.append({})
134
162
  self.cached_files = cached_files or [{}]
@@ -170,8 +198,7 @@ class CacheMetadata:
170
198
  continue
171
199
 
172
200
  if os.path.exists(fn):
173
- with open(fn, "rb") as f:
174
- cached_files = pickle.load(f)
201
+ cached_files = self._load(fn)
175
202
  for k, c in cached_files.items():
176
203
  if k in cache:
177
204
  if c["blocks"] is True or cache[k]["blocks"] is True:
@@ -197,8 +224,7 @@ class CacheMetadata:
197
224
  for c in cache.values():
198
225
  if isinstance(c["blocks"], set):
199
226
  c["blocks"] = list(c["blocks"])
200
- with atomic_write(fn) as f:
201
- pickle.dump(cache, f)
227
+ self._save(cache, fn)
202
228
  self.cached_files[-1] = cached_files
203
229
 
204
230
  def update_file(self, path: str, detail: Detail) -> None:
@@ -5,6 +5,7 @@ import logging
5
5
  import os
6
6
  import tempfile
7
7
  import time
8
+ import weakref
8
9
  from shutil import rmtree
9
10
  from typing import TYPE_CHECKING, Any, Callable, ClassVar
10
11
 
@@ -111,7 +112,9 @@ class CachingFileSystem(AbstractFileSystem):
111
112
  "Both filesystems (fs) and target_protocol may not be both given."
112
113
  )
113
114
  if cache_storage == "TMP":
114
- storage = [tempfile.mkdtemp()]
115
+ tempdir = tempfile.mkdtemp()
116
+ storage = [tempdir]
117
+ weakref.finalize(self, self._remove_tempdir, tempdir)
115
118
  else:
116
119
  if isinstance(cache_storage, str):
117
120
  storage = [cache_storage]
@@ -152,6 +155,13 @@ class CachingFileSystem(AbstractFileSystem):
152
155
 
153
156
  self._strip_protocol: Callable = _strip_protocol
154
157
 
158
+ @staticmethod
159
+ def _remove_tempdir(tempdir):
160
+ try:
161
+ rmtree(tempdir)
162
+ except Exception:
163
+ pass
164
+
155
165
  def _mkcache(self):
156
166
  os.makedirs(self.storage[-1], exist_ok=True)
157
167
 
@@ -192,7 +192,7 @@ class HTTPFileSystem(AsyncFileSystem):
192
192
  for u in out
193
193
  ]
194
194
  else:
195
- return list(sorted(out))
195
+ return sorted(out)
196
196
 
197
197
  async def _ls(self, url, detail=True, **kwargs):
198
198
  if self.use_listings_cache and url in self.dircache:
@@ -150,7 +150,7 @@ class LazyReferenceMapper(collections.abc.MutableMapping):
150
150
  """List top-level directories"""
151
151
  if self.dirs is None:
152
152
  dirs = [p.split("/", 1)[0] for p in self.zmetadata]
153
- self.dirs = set(sorted(p for p in dirs if p and not p.startswith(".")))
153
+ self.dirs = {p for p in dirs if p and not p.startswith(".")}
154
154
  listing = self.dirs
155
155
  if basename:
156
156
  listing = [os.path.basename(path) for path in listing]
@@ -381,17 +381,17 @@ class LazyReferenceMapper(collections.abc.MutableMapping):
381
381
  raws[j] = kerchunk.df._proc_raw(data)
382
382
  # TODO: only save needed columns
383
383
  df = pd.DataFrame(
384
- dict(
385
- path=paths,
386
- offset=offsets,
387
- size=sizes,
388
- raw=raws,
389
- ),
384
+ {
385
+ "path": paths,
386
+ "offset": offsets,
387
+ "size": sizes,
388
+ "raw": raws,
389
+ },
390
390
  copy=False,
391
391
  )
392
392
  if df.path.count() / (df.path.nunique() or 1) > self.cat_thresh:
393
393
  df["path"] = df["path"].astype("category")
394
- object_encoding = dict(raw="bytes", path="utf8")
394
+ object_encoding = {"raw": "bytes", "path": "utf8"}
395
395
  has_nulls = ["path", "raw"]
396
396
 
397
397
  self.fs.mkdirs(f"{base_url or self.out_root}/{field}", exist_ok=True)
@@ -81,7 +81,7 @@ class SMBFileSystem(AbstractFileSystem):
81
81
  ----------
82
82
  host: str
83
83
  The remote server name/ip to connect to
84
- port: int
84
+ port: int or None
85
85
  Port to connect with. Usually 445, sometimes 139.
86
86
  username: str or None
87
87
  Username to connect with. Required if Kerberos auth is not being used.
@@ -114,12 +114,16 @@ class SMBFileSystem(AbstractFileSystem):
114
114
  self.share_access = share_access
115
115
  self._connect()
116
116
 
117
+ @property
118
+ def _port(self):
119
+ return 445 if self.port is None else self.port
120
+
117
121
  def _connect(self):
118
122
  smbclient.register_session(
119
123
  self.host,
120
124
  username=self.username,
121
125
  password=self.password,
122
- port=445 if self.port is None else self.port,
126
+ port=self._port,
123
127
  encrypt=self.encrypt,
124
128
  connection_timeout=self.timeout,
125
129
  )
@@ -139,23 +143,23 @@ class SMBFileSystem(AbstractFileSystem):
139
143
  def mkdir(self, path, create_parents=True, **kwargs):
140
144
  wpath = _as_unc_path(self.host, path)
141
145
  if create_parents:
142
- smbclient.makedirs(wpath, exist_ok=False, port=self.port, **kwargs)
146
+ smbclient.makedirs(wpath, exist_ok=False, port=self._port, **kwargs)
143
147
  else:
144
- smbclient.mkdir(wpath, port=self.port, **kwargs)
148
+ smbclient.mkdir(wpath, port=self._port, **kwargs)
145
149
 
146
150
  def makedirs(self, path, exist_ok=False):
147
151
  if _share_has_path(path):
148
152
  wpath = _as_unc_path(self.host, path)
149
- smbclient.makedirs(wpath, exist_ok=exist_ok, port=self.port)
153
+ smbclient.makedirs(wpath, exist_ok=exist_ok, port=self._port)
150
154
 
151
155
  def rmdir(self, path):
152
156
  if _share_has_path(path):
153
157
  wpath = _as_unc_path(self.host, path)
154
- smbclient.rmdir(wpath, port=self.port)
158
+ smbclient.rmdir(wpath, port=self._port)
155
159
 
156
160
  def info(self, path, **kwargs):
157
161
  wpath = _as_unc_path(self.host, path)
158
- stats = smbclient.stat(wpath, port=self.port, **kwargs)
162
+ stats = smbclient.stat(wpath, port=self._port, **kwargs)
159
163
  if S_ISDIR(stats.st_mode):
160
164
  stype = "directory"
161
165
  elif S_ISLNK(stats.st_mode):
@@ -176,18 +180,18 @@ class SMBFileSystem(AbstractFileSystem):
176
180
  def created(self, path):
177
181
  """Return the created timestamp of a file as a datetime.datetime"""
178
182
  wpath = _as_unc_path(self.host, path)
179
- stats = smbclient.stat(wpath, port=self.port)
183
+ stats = smbclient.stat(wpath, port=self._port)
180
184
  return datetime.datetime.fromtimestamp(stats.st_ctime, tz=datetime.timezone.utc)
181
185
 
182
186
  def modified(self, path):
183
187
  """Return the modified timestamp of a file as a datetime.datetime"""
184
188
  wpath = _as_unc_path(self.host, path)
185
- stats = smbclient.stat(wpath, port=self.port)
189
+ stats = smbclient.stat(wpath, port=self._port)
186
190
  return datetime.datetime.fromtimestamp(stats.st_mtime, tz=datetime.timezone.utc)
187
191
 
188
192
  def ls(self, path, detail=True, **kwargs):
189
193
  unc = _as_unc_path(self.host, path)
190
- listed = smbclient.listdir(unc, port=self.port, **kwargs)
194
+ listed = smbclient.listdir(unc, port=self._port, **kwargs)
191
195
  dirs = ["/".join([path.rstrip("/"), p]) for p in listed]
192
196
  if detail:
193
197
  dirs = [self.info(d) for d in dirs]
@@ -218,14 +222,14 @@ class SMBFileSystem(AbstractFileSystem):
218
222
  if "w" in mode and autocommit is False:
219
223
  temp = _as_temp_path(self.host, path, self.temppath)
220
224
  return SMBFileOpener(
221
- wpath, temp, mode, port=self.port, block_size=bls, **kwargs
225
+ wpath, temp, mode, port=self._port, block_size=bls, **kwargs
222
226
  )
223
227
  return smbclient.open_file(
224
228
  wpath,
225
229
  mode,
226
230
  buffering=bls,
227
231
  share_access=share_access,
228
- port=self.port,
232
+ port=self._port,
229
233
  **kwargs,
230
234
  )
231
235
 
@@ -233,21 +237,21 @@ class SMBFileSystem(AbstractFileSystem):
233
237
  """Copy within two locations in the same filesystem"""
234
238
  wpath1 = _as_unc_path(self.host, path1)
235
239
  wpath2 = _as_unc_path(self.host, path2)
236
- smbclient.copyfile(wpath1, wpath2, port=self.port, **kwargs)
240
+ smbclient.copyfile(wpath1, wpath2, port=self._port, **kwargs)
237
241
 
238
242
  def _rm(self, path):
239
243
  if _share_has_path(path):
240
244
  wpath = _as_unc_path(self.host, path)
241
- stats = smbclient.stat(wpath, port=self.port)
245
+ stats = smbclient.stat(wpath, port=self._port)
242
246
  if S_ISDIR(stats.st_mode):
243
- smbclient.rmdir(wpath, port=self.port)
247
+ smbclient.rmdir(wpath, port=self._port)
244
248
  else:
245
- smbclient.remove(wpath, port=self.port)
249
+ smbclient.remove(wpath, port=self._port)
246
250
 
247
251
  def mv(self, path1, path2, **kwargs):
248
252
  wpath1 = _as_unc_path(self.host, path1)
249
253
  wpath2 = _as_unc_path(self.host, path2)
250
- smbclient.rename(wpath1, wpath2, port=self.port, **kwargs)
254
+ smbclient.rename(wpath1, wpath2, port=self._port, **kwargs)
251
255
 
252
256
 
253
257
  def _as_unc_path(host, path):
@@ -485,7 +485,7 @@ class AbstractFileSystem(metaclass=_Cached):
485
485
  """
486
486
  # TODO: allow equivalent of -name parameter
487
487
  path = self._strip_protocol(path)
488
- out = dict()
488
+ out = {}
489
489
 
490
490
  # Add the root directory if withdirs is requested
491
491
  # This is needed for posix glob compliance
@@ -1182,7 +1182,7 @@ class AbstractFileSystem(metaclass=_Cached):
1182
1182
  out.add(p)
1183
1183
  if not out:
1184
1184
  raise FileNotFoundError(path)
1185
- return list(sorted(out))
1185
+ return sorted(out)
1186
1186
 
1187
1187
  def mv(self, path1, path2, recursive=False, maxdepth=None, **kwargs):
1188
1188
  """Move file(s) from one location to another"""
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: fsspec
3
- Version: 2023.9.0
3
+ Version: 2023.9.1
4
4
  Summary: File-system specification
5
5
  Home-page: http://github.com/fsspec/filesystem_spec
6
6
  Maintainer: Martin Durant
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes