Socket
Socket
Sign inDemoInstall

bom-open

Package Overview
Dependencies
0
Maintainers
1
Alerts
File Explorer

Install Socket

Detect and block malicious and high-risk dependencies

Install

    bom-open

Context manager to open encoded text file or stdin/stdout


Maintainers
1

Readme

Build Status License: Unlicense

Python 3 context manager to open a file or stdio. When reading in text mode, encoding can be detected with chardet. When reading Unicode, always chooses an encoding which removes Byte Order Mark (utf-8-sig, utf-16 or utf-32).

Additional arguments are passed to open().

Python writes a Byte Order Mark for utf-8-sig, utf-16, or utf-32. Python does not write BOM when endianness is specified.

Differences from open()

If file=None or '-', open stdin (when reading) or stdout (when writing).

If encoding=None and mode is readable and text mode ('r' or 'w+'), file encoding will be detected using chardet.

FAQs


Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc