Skip to content

send breaks with recent versions of pbincli #12

@blacklight

Description

@blacklight

The pbincli API now requires the presence of the auth parameter in the configuration. Without it, uploads fail:

File "/home/me/bin/paster", line 145, in <module>
  main()
  ~~~~^^
File "/home/me/bin/paster", line 128, in main
  rs = send_text(
      get_text(opts.file),
  ...<3 lines>...
      format=opts.format,
  )
File "/home/blacklight/me/paster", line 48, in send_text
  response = privatebinapi.send(
      'https://paste.example.org',
  ...<3 lines>...
      formatting=format,
  )
File "/home/me/.local/lib/python3.13/site-packages/privatebinapi/upload.py", line 123, in send
  data, passcode = prepare_upload(
                   ~~~~~~~~~~~~~~^
      server, text=text, file=file, password=password, expiration=expiration, compression=compression,
      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      formatting=formatting, burn_after_reading=burn_after_reading, discussion=discussion
      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  )
  ^
File "/home/me/.local/lib/python3.13/site-packages/privatebinapi/upload.py", line 63, in prepare_upload
  api_client = PrivateBin(settings)
File "/home/me/.local/lib/python3.13/site-packages/pbincli/api.py", line 50, in __init__
  self.session = _config_requests(settings, False)
                 ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
File "/home/me/.local/lib/python3.13/site-packages/pbincli/api.py", line 17, in _config_requests
  settings["auth"] and not shortener
  ~~~~~~~~^^^^^^^^
KeyError: 'auth'

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