Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Copy-sftp module bug #429

Open
jaimeozaez opened this issue Feb 7, 2025 · 1 comment
Open

Copy-sftp module bug #429

jaimeozaez opened this issue Feb 7, 2025 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@jaimeozaez
Copy link
Member

When module copy-sftp is run by itself (I mean, outside of finish function), an error is raised (even though all the files seem to have been copied correctly).

This is an example of the error:

╭───────────────────────────────────────────── Traceback (most recent call last) ──────────────────────────────────────────────╮
│ /data/ucct/bi/pipelines/micromamba/envs/buisciii-tools_2.2.5/bin/bu-isciii:8 in <module>                                     │
│                                                                                                                              │
│   7 │   sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])                                                     │
│ ❱ 8 │   sys.exit(run_bu_isciii())                                                                                            │
│   9                                                                                                                          │
│                                                                                                                              │
│ /data/ucct/bi/pipelines/micromamba/envs/buisciii-tools_2.2.5/lib/python3.13/site-packages/bu_isciii/__main__.py:66 in        │
│ run_bu_isciii                                                                                                                │
│                                                                                                                              │
│    65 │   # Lanch the click cli                                                                                              │
│ ❱  66 │   bu_isciii_cli()                                                                                                    │
│    67                                                                                                                        │
│                                                                                                                              │
│ /data/ucct/bi/pipelines/micromamba/envs/buisciii-tools_2.2.5/lib/python3.13/site-packages/click/core.py:1161 in __call__     │
│                                                                                                                              │
│   1160 │   │   """Alias for :meth:`main`."""                                                                                 │
│ ❱ 1161 │   │   return self.main(*args, **kwargs)                                                                             │
│   1162                                                                                                                       │
│                                                                                                                              │
│ /data/ucct/bi/pipelines/micromamba/envs/buisciii-tools_2.2.5/lib/python3.13/site-packages/click/core.py:1082 in main         │
│                                                                                                                              │
│   1081 │   │   │   │   with self.make_context(prog_name, args, **extra) as ctx:                                              │
│ ❱ 1082 │   │   │   │   │   rv = self.invoke(ctx)                                                                             │
│   1083 │   │   │   │   │   if not standalone_mode:                                                                           │
│                                                                                                                              │
│ /data/ucct/bi/pipelines/micromamba/envs/buisciii-tools_2.2.5/lib/python3.13/site-packages/click/core.py:1697 in invoke       │
│                                                                                                                              │
│   1696 │   │   │   │   with sub_ctx:                                                                                         │
│ ❱ 1697 │   │   │   │   │   return _process_result(sub_ctx.command.invoke(sub_ctx))                                           │
│   1698                                                                                                                       │
│                                                                                                                              │
│ /data/ucct/bi/pipelines/micromamba/envs/buisciii-tools_2.2.5/lib/python3.13/site-packages/click/core.py:1443 in invoke       │
│                                                                                                                              │
│   1442 │   │   if self.callback is not None:                                                                                 │
│ ❱ 1443 │   │   │   return ctx.invoke(self.callback, **ctx.params)                                                            │
│   1444                                                                                                                       │
│                                                                                                                              │
│ /data/ucct/bi/pipelines/micromamba/envs/buisciii-tools_2.2.5/lib/python3.13/site-packages/click/core.py:788 in invoke        │
│                                                                                                                              │
│    787 │   │   │   with ctx:                                                                                                 │
│ ❱  788 │   │   │   │   return __callback(*args, **kwargs)                                                                    │
│    789                                                                                                                       │
│                                                                                                                              │
│ /data/ucct/bi/pipelines/micromamba/envs/buisciii-tools_2.2.5/lib/python3.13/site-packages/click/decorators.py:33 in new_func │
│                                                                                                                              │
│    32 │   def new_func(*args: "P.args", **kwargs: "P.kwargs") -> "R":                                                        │
│ ❱  33 │   │   return f(get_current_context(), *args, **kwargs)                                                               │
│    34                                                                                                                        │
│                                                                                                                              │
│ /data/ucct/bi/pipelines/micromamba/envs/buisciii-tools_2.2.5/lib/python3.13/site-packages/bu_isciii/__main__.py:383 in       │
│ copy_sftp                                                                                                                    │
│                                                                                                                              │
│   382 │   )                                                                                                                  │
│ ❱ 383 │   new_del.copy_sftp()                                                                                                │
│   384                                                                                                                        │
│                                                                                                                              │
│ /data/ucct/bi/pipelines/micromamba/envs/buisciii-tools_2.2.5/lib/python3.13/site-packages/bu_isciii/copy_sftp.py:167 in      │
│ copy_sftp                                                                                                                    │
│                                                                                                                              │
│   166 │   │   │   │   for folders_list in self.last_folders:                                                                 │
│ ❱ 167 │   │   │   │   │   final_folder = os.path.join(                                                                       │
│   168 │   │   │   │   │   │   self.sftp_folder, self.service_folder, folders_list                                            │
│ in join:90                                                                                                                   │
│ in _check_arg_types:188                                                                                                      │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
TypeError: join() argument must be str, bytes, or os.PathLike object, not 'NoneType'
@jaimeozaez jaimeozaez added the bug Something isn't working label Feb 7, 2025
@victor5lm
Copy link
Contributor

This issue arises exclusively when selecting "all" when running the copy-sftp module, because the variable "folders_list" is None:

finally:
for folders_list in self.last_folders:
final_folder = os.path.join(
self.sftp_folder, self.service_folder, folders_list
)
stderr.print(
"Listing the content of the final folder %s" % folders_list
)
self.listdirs(final_folder)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants