Skip to content

dainstall incompatible with requests 2.34.0 #20

@alexszem

Description

@alexszem

Hello Mr. Pyle,

I've noticed that dainstall does not work with the requests package since 2.34. I've encountered this in our GitHub Actions Pipeline which uses Python 3.12. Here's a full list of dependencies which the pip install docassemblecli command installed when it was broken:

  • certifi-2026.4.22
  • charset_normalizer-3.4.7
  • docassemblecli-0.0.25
  • idna-3.15
  • packaging-26.2
  • pyyaml-6.0.3
  • requests-2.34.2
  • tomli-2.4.1
  • tomli_w-1.2.0
  • urllib3-2.7.0
  • watchdog-6.0.0

and here's the stack trace:

Traceback (most recent call last):
  File "/opt/hostedtoolcache/Python/3.12.13/x64/bin/dainstall", line 6, in <module>
    sys.exit(dainstall())
             ^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.12.13/x64/lib/python3.12/site-packages/docassemblecli/commands.py", line 527, in dainstall
    do_install(args, apikey, apiurl, to_ignore)
  File "/opt/hostedtoolcache/Python/3.12.13/x64/lib/python3.12/site-packages/docassemblecli/commands.py", line 765, in do_install
    r = requests.post(apiurl + '/api/package', data=data, files={'zip': archive}, headers={'X-API-Key': apikey}, timeout=50)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.12.13/x64/lib/python3.12/site-packages/requests/api.py", line 134, in post
    return request("post", url, data=data, json=json, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.12.13/x64/lib/python3.12/site-packages/requests/api.py", line 71, in request
    return session.request(method=method, url=url, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.12.13/x64/lib/python3.12/site-packages/requests/sessions.py", line 635, in request
    prep = self.prepare_request(req)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.12.13/x64/lib/python3.12/site-packages/requests/sessions.py", line 541, in prepare_request
    p.prepare(
  File "/opt/hostedtoolcache/Python/3.12.13/x64/lib/python3.12/site-packages/requests/models.py", line 442, in prepare
    self.prepare_body(data, files, json)
  File "/opt/hostedtoolcache/Python/3.12.13/x64/lib/python3.12/site-packages/requests/models.py", line 635, in prepare_body
    (body, content_type) = self._encode_files(files, raw_data)
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.12.13/x64/lib/python3.12/site-packages/requests/models.py", line 250, in _encode_files
    body, content_type = encode_multipart_formdata(new_fields)
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.12.13/x64/lib/python3.12/site-packages/urllib3/filepost.py", line 81, in encode_multipart_formdata
    body.write(data)
TypeError: a bytes-like object is required, not '_TemporaryFileWrapper'

for this command:

dainstall --apiurl "$DA_URL" --apikey "$DA_API_KEY" --noconfig docassemble-dws_utils

The current fix I've found to work is to run this instead:

pip install docassemblecli requests==2.33

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions