Skip to content

Using op.read() to pull the contents of a text file attached to an item only pulls the first line of the document #73

@loupetron

Description

@loupetron

Describe the bug
If you use op.read('op://vault/item/text_file') to read a file that is attached to an item, it retrieves the file first line only. It doesn't contain the rest of the document. If I use op read op://vault/item/text_file in Terminal, it pulls the full text file.

To Reproduce
Steps to reproduce the behavior:

In Python environment:

  1. Create an item in 1Password that has a text file named "text.txt" attached to it. (Not a separate document item)
  2. Create python code to pull the file via op.read(secret_reference_to_file)
  3. The variable returned only includes the first line of the file, not the entire contents.

In terminal:

  1. Enter commend op read secret_reference_to_file
  2. The full contents of the text file are displayed in the terminal

Expected behavior
The returned variable should include the entire file, not just the first line

Screenshots
In the screenshot, I have included:

  • Top: Terminal showing the output of the op read command.
  • Left: The Python code with the console output showing the output of the op.read() command.
  • Middle-right: The text as it was uploaded to 1Password.
  • Bottom-right: The item as it appears in 1Password
  • Image

Desktop (please complete the following information):

  • OS: macOS 15.3
  • Python 3.12
  • 1Password

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions