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

module 'click.termui' has no attribute 'get_terminal_size' #661

Closed
remisiki opened this issue Apr 7, 2023 · 11 comments · Fixed by #684
Closed

module 'click.termui' has no attribute 'get_terminal_size' #661

remisiki opened this issue Apr 7, 2023 · 11 comments · Fixed by #684

Comments

@remisiki
Copy link

remisiki commented Apr 7, 2023

I am getting this error when uploading a folder to bucket with prefix.

command

oci os object bulk-upload --src-dir folder -bn bucket-name --prefix "folder/"

message

{
  "skipped-objects": [],
  "upload-failures": {
    "folder/newFile": "module 'click.termui' has no attribute 'get_terminal_size'"
  },
  "uploaded-objects": {}
}

operating system: arch linux 6.2.9-arch1-1
oci-cli version: 3.25.1-1
python-click version: 8.1.3-1

@Olygo
Copy link

Olygo commented May 16, 2023

same issue, fixed after removing Ansible due to incompatible python-click release.

@dch
Copy link
Contributor

dch commented Jun 7, 2023

also here - its impossible to upload atm:

$ oci os object bulk-upload \
  --namespace $OCI_NS \
  --bucket-name freebsd-images \
  --parallel-upload-count 10 \
  --verify-checksum \
  --no-overwrite \
  --src-dir /tmp/img --include FreeBSD-13.2-RELEASE-oci-zfs.qcow2

{
  "skipped-objects": [],
  "upload-failures": {
    "FreeBSD-13.2-RELEASE-oci-zfs.qcow2": "module 'click.termui' has no attribute 'get_terminal_size'"
  },
  "uploaded-objects": {}
}
$ uname -a
FreeBSD 14.0-CURRENT main-n263295-3e103bcfbbec GENERIC-NODEBUG amd64
$ oci --version
3.27.1
# pkg info py39-click
py39-click-8.1.3

@dch
Copy link
Contributor

dch commented Jun 7, 2023

This appears to be mentioned in https://click.palletsprojects.com/en/8.1.x/changes/#version-8-1-0 "use shutil.get_terminal_size" instead.

@Kanvipasricha
Copy link
Member

OCI CLI team is looking into the issue, we will be releasing a fix at the earliest possible.

@abarrak
Copy link

abarrak commented Dec 26, 2023

Same here, facing this issue during downloading as well.

$ oci os object bulk-download  --bucket-name=nvh-data-test --download-dir=.                                                                  

/opt/homebrew/Cellar/oci-cli/3.37.1/libexec/lib/python3.12/site-packages/oci_cli/cli_util.py:1080: SyntaxWarning: invalid escape sequence '\['
  list_type = {'module': complex_type_definition['module'], 'class': re.match('list\[(.*)\]', complex_type_definition['class']).group(1)}  # noqa: W605
/opt/homebrew/Cellar/oci-cli/3.37.1/libexec/lib/python3.12/site-packages/oci_cli/cli_util.py:2289: SyntaxWarning: invalid escape sequence '\s'
  json_page_matcher = re.compile("(^\s*\[)([\s\S]*?)(}\s*\]$)")  # noqa: W605
/opt/homebrew/Cellar/oci-cli/3.37.1/libexec/lib/python3.12/site-packages/oci_cli/cli_util.py:2340: SyntaxWarning: invalid escape sequence '\s'
  json_page_matcher = re.compile("(^[\s\S]*\[\s)([\s\S]*?)(}\s*\]\s*}$)")  # noqa: W605
/opt/homebrew/Cellar/oci-cli/3.37.1/libexec/lib/python3.12/site-packages/oci_cli/cli_util.py:2381: SyntaxWarning: invalid escape sequence '\`'
  'with double escape character \`.\ne.g. --query data[*].\`"display-name\`"',  # noqa: E127, W605
/opt/homebrew/Cellar/oci-cli/3.37.1/libexec/lib/python3.12/site-packages/oci_cli/json_skeleton_utils.py:252: SyntaxWarning: invalid escape sequence '\['
  sub_kls = re.match('list\[(.*)\]', cls).group(1)  # noqa: W605
/opt/homebrew/Cellar/oci-cli/3.37.1/libexec/lib/python3.12/site-packages/oci_cli/json_skeleton_utils.py:269: SyntaxWarning: invalid escape sequence '\('
  key_sub_kls = re.match('dict\(([^,]*), (.*)\)', cls).group(1)    # noqa: W605
/opt/homebrew/Cellar/oci-cli/3.37.1/libexec/lib/python3.12/site-packages/oci_cli/json_skeleton_utils.py:270: SyntaxWarning: invalid escape sequence '\('
  value_sub_kls = re.match('dict\(([^,]*), (.*)\)', cls).group(2)  # noqa: W605

{
  "download-failures": {
    ...
    "data/2022-12-21/A1234GHI567892/A1234GHI567892_text_20221219_test-file-000.txt.info": "module 'click.termui' has no attribute 'get_terminal_size'",
    "data/2022-12-21/AZA1234GHI567892/AZA1234GHI567892_text_20221220_motd": "module 'click.termui' has no attribute 'get_terminal_size'",
    "data/2022-12-21/AZA1234GHI567892/AZA1234GHI567892_text_20221220_motd.info": "module 'click.termui' has no attribute 'get_terminal_size'",
    "data/2022-12-21/AZBY1234GHI567892/AZBY1234GHI567892_text_20221221_test-file-000.txt": "module 'click.termui' has no attribute 'get_terminal_size'",
    "data/2022-12-21/AZBY1234GHI567892/AZBY1234GHI567892_text_20221221_test-file-000.txt.info": "module 'click.termui' has no attribute 'get_terminal_size'",
    "data/2022-12-21/AZXY1234GHI567892/AZXY1234GHI567892_text_20221221_notify.conf": "module 'click.termui' has no attribute 'get_terminal_size'",
    "data/2022-12-21/AZXY1234GHI567892/AZXY1234GHI567892_text_20221221_notify.conf.info": "module 'click.termui' has no attribute 'get_terminal_size'",
    "data/2022-12-21/AZXY1234GHI567892/AZXY1234GHI567892_text_20221222_protocols": "module 'click.termui' has no attribute 'get_terminal_size'",
    "data/2022-12-21/AZXY1234GHI567892/AZXY1234GHI567892_text_20221222_protocols.info": "module 'click.termui' has no attribute 'get_terminal_size'",
    "data/2022-12-21/BZ31234FGHI567892/BZ31234FGHI567892_text_20221221_motd": "module 'click.termui' has no attribute 'get_terminal_size'",
    "data/2022-12-21/BZ31234FGHI567892/BZ31234FGHI567892_text_20221221_motd.info": "module 'click.termui' has no attribute 'get_terminal_size'",
    "data/2022-12-21/ZZZZA1234GHI567892/ZZZZA1234GHI567892_text_20221220_motd": "module 'click.termui' has no attribute 'get_terminal_size'",
    "data/2022-12-21/ZZZZA1234GHI567892/ZZZZA1234GHI567892_text_20221220_motd.info": "module 'click.termui' has no attribute 'get_terminal_size'",
    "testdir/": "module 'click.termui' has no attribute 'get_terminal_size'"
  },
  "downloaded-objects": [],
  "skipped-objects": []
}

@karthik-k-kamath
Copy link
Member

Thanks all for sharing. Fix for this is planned to be released in Jan 2024

@kocic11
Copy link

kocic11 commented Jan 9, 2024

Will the January fix resolve the SyntaxWarning warnings?

@lucas-padua
Copy link

lucas-padua commented Feb 7, 2024

Had the same problem while using bulk-download, does anyone know how to solve this?

Update
Updating to the latest version fixed the problem, so this issue should be closed.

@karthik-k-kamath
Copy link
Member

Lucas, fix for this was released in Jan, so can you try the latest CLI version?

@karthik-k-kamath
Copy link
Member

Thanks Lucas, for confirming 👍🏼

@lucas-padua
Copy link

No problem, thanks for the fix 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants