Skip to main content

Replacement for cgi FieldStorage parser

Project description

This package provides a replacement for the cgi.FieldStorage parser which prevents to load file upoad data into memory.

CHANGES

0.6.3 (2025-09-01)

  • fixed parser.py

  • Added safe_decode() to handle utf-8 with fallback to latin-1 for all text input.

  • Added fix_quoted_value() to unescape quoted header values and repair broken utf-8 sequences.

  • Improved parseHeader() to use safe_decode and fix_quoted_value, supports RFC2231/5987 encoded filenames.

  • Improved query string parsing: * normalize broken CRLF and newline separated parameters * allow “;” as alternative separator * decode all keys and values with safe_decode

  • Improved parseFormData(): * explicit handling of GET, HEAD and POST * detect multipart boundaries from content-type if missing * normalize header keys to lowercase

  • Fixed parseMultiParts(): * restored full behavior (headers, disposition, type, inner boundary, length) * Python 3 uses BytesParser for raw headers * Python 2 forces latin-1 decode to avoid UnicodeEncodeError

  • MultiPartField: * value returns text only for explicit text/* types, bytes for file uploads * improved readMulti with robust header parsing * skipLines fixed for Python 2 compatibility

  • General: * consistent handling of latin-1 fallback for all headers * no more UnicodeEncodeError on header parsing * backward compatible with Python 2.7 and Python 3.x

  • fixed normalizer.py

  • Extended UNICODE_MAPPING: * German umlauts and sharp s * French accented letters (e, a, c, oe, OE) * Spanish letters (n, N, inverted ? and !) * Italian accented vowels * Scandinavian letters (A ring, O slash, Thorn, Eth) * Central/Eastern European letters (Polish, Czech, Slovak, etc.) * Greek alphabet (upper and lower case)

  • Mapping is now more complete for western, central and southern European languages.

  • Fallback ensures safe ASCII-only output for file names and URLs.

  • Code is now Python 2/3 compatible

  • Safer encoding handling across all modules

  • Better user input tolerance for broken clients

0.6.2 (2025-08-20)

  • improved form field parsing. Prevent including line break between value and boundary

0.6.1 (2025-08-14)

  • Compatibility with Python3

0.6.0 (2025-07-15)

  • Compatibility with Python3

0.5.1 (2011-10-18)

  • implemented temporary file factory arguments called tmpFileFactoryArguments. This allows to use ‘w+b’ or max_size for SpooledTemporaryFile

  • updated license info

  • fix package meta data

0.5.0 (2009-05-11)

  • initial release

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

p01.cgi-0.6.3.tar.gz (75.1 kB view details)

Uploaded Source

File details

Details for the file p01.cgi-0.6.3.tar.gz.

File metadata

  • Download URL: p01.cgi-0.6.3.tar.gz
  • Upload date:
  • Size: 75.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.8.3 requests/2.27.1 setuptools/44.1.1 requests-toolbelt/1.0.0 tqdm/4.64.1 CPython/2.7.18

File hashes

Hashes for p01.cgi-0.6.3.tar.gz
Algorithm Hash digest
SHA256 d43da9f144b0797c8f28a6b8751aa0a23f3ad0e8b2219e601acf49bb40e93e68
MD5 c540d01183618d8c21362096c1783f26
BLAKE2b-256 afc55ffc3244f433ab842c4b42a03875fac7d20b3de7fcbb725e35b93c52a586

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page