microsoft / microsoft/azure-devops-python-api

create_attachment in wiki_client unable to upload png files

Open
#425 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
684
Forks
218
Avg merge
8d 10h
Merged PRs (30d)
1

Description

I am trying to create a png file as attachment in azure wiki as code and getting the following issue:

azure.devops.exceptions.AzureDevOpsServiceError: The wiki attachment creation failed with message : The input is not a valid Base-64 string as it contains a non-base 64 character, more than two padding characters, or an illegal character among the padding characters.

This is the snippet

version_descriptor = GitVersionDescriptor(version="main",version_type="branch")
with open("./sample-image.png","rb") as png_file:
    wiki_client.create_attachment(upload_stream=png_file, version_descriptor=version_descriptor, project="<project-name>", wiki_identifier="<wiki-name>",  name="sample-image.png")

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at wiki_client.create_attachment and reproduce the failure with the provided binary PNG upload snippet. Trace how upload_stream is handled before the Azure Wiki request; done means the PNG attachment is created successfully without the Base-64 error.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, python
Domain
api
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
40/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.