Commit Graph

73 Commits

Author SHA1 Message Date
Peter Thomassen
d38aab39e4
Remove unused code 2024-04-30 18:28:22 +02:00
Ahzam Ahmed
c10f226622
Refactor: Replace try/except with contextlib.suppress() (#8676) 2022-10-05 11:02:00 +01:00
Carlton Gibson
ad282da97c
Replaced parse_header with parse_header_parameters. (#8556)
Add a backwards compatibility shim for Django versions that have no (or an incompatible)
django.utils.http.parse_header_parameters implementation.

Thanks to Shai Berger for review. 

Co-authored-by: Jaap Roes <jroes@leukeleu.nl>
2022-07-14 14:20:36 +02:00
Gregory N. Schmit
335054a5d3 replace force_text with force_str 2019-08-07 21:05:24 +02:00
Jon Dufresne
5e1619bc9e Remove unnecessary assignments immediately before a return statement (#6619)
Cleans up the pattern:

    ...
    myvar = <expression>
    return myvar

To:

    ...
    return <expression>
2019-05-01 07:51:54 +02:00
Jon Dufresne
513a49d63b Drop default 'utf-8' to .encode()/.decode() (#6633)
A Python 3 cleanup that allows for less noise in the code.

https://docs.python.org/3/library/stdtypes.html#bytes.decode
https://docs.python.org/3/library/stdtypes.html#str.encode
2019-05-01 07:49:16 +02:00
Carlton Gibson
0407a0df8a
Dropped Python 2 compatibility. (#6615)
Thanks to Jon Dufresne (@jdufresne) for review.

Co-authored-by: Asif Saif Uddin <auvipy@gmail.com>
Co-authored-by: Rizwan Mansuri <Rizwan@webbyfox.com>
2019-04-30 17:53:44 +02:00
Daniel Hahler
2854679f56 Upgrade isort (#5817)
* Fix isort

* runtests: add --diff to ISORT_ARGS

* requirements-codestyle: bump isort to 4.3.3

* isort: move config to setup.cfg
2018-02-14 20:12:14 +00:00
Jon Dufresne
d3f3c3d9c1 Prefer https protocol for links in docs when available 2018-01-15 15:15:21 +01:00
Ryan P Kilby
8ab75a2f01 Add 'STRICT_JSON' API setting.
STRICT_JSON controls the renderer & parser behavior on whether or not
to accept non-standard float values (NaN, Infinity).
2017-09-25 09:08:20 +02:00
Ryan P Kilby
d740bae95a Update json imports 2017-09-25 09:08:20 +02:00
imdark
cdeab1c490 fixed to pass isort linting 2017-05-24 18:12:38 -07:00
imdark
9a22811671 modified to use a reader
modified to use a reader since direct decoding is not supported
2017-05-24 17:56:49 -07:00
imdark
3a2ad8e68c in order to solve the memory leak at #5146
Large encoded string take a very long time to to release from memory, but if we just pass the stream directly into json.load we get much better memory performance.
2017-05-17 11:49:30 -07:00
Tom Christie
3ef3fee926 Descriptive error from FileUploadParser when filename not included. (#4340)
* Descriptive error from FileUploadParser when filename not included.
* Consistent handling of upload filenames
2016-08-01 18:44:58 +01:00
Stephan Groß
a101251a2a Fix blank lines around docstrings 2016-03-17 11:06:47 +00:00
Dan Lipsitt
fb94be18be docstring typo fix: DateAndFiles -> DataAndFiles 2015-12-16 10:42:10 -08:00
José Padilla
7351a3f6ca Sort imports with isort 2015-06-25 16:55:51 -04:00
José Padilla
83c9136c90 Cleanup import following PEP 8 style guide 2015-06-25 16:10:17 -04:00
Tom Christie
4ee4b4f2dc Merge master 2015-01-30 14:00:25 +00:00
Alexander Dutton
a1fa7218eb Pass {} as data to DataAndFiles, as it ends up in a MergeDict
In the same vein as #2399.
2015-01-23 16:52:24 +00:00
Tom Christie
39f26c9eca Merge master 2015-01-23 14:28:59 +00:00
Tom Christie
f1ac9d3f9b More graceful handling of malformed Content-Disposition 2015-01-23 12:26:44 +00:00
Tom Christie
6065cdbd93 Merge master 2015-01-19 15:16:57 +00:00
Ask Holme
d6bff10f98 Make FileUploadParser work with standard django API
Output from parsers ends up in a Django MergeDict and they exists elements to be dicts - not None
2015-01-10 18:15:21 +01:00
Tom Christie
baaa356489 Merge master 2014-12-12 15:37:43 +00:00
Tymur Maryokhin
95af92ca01 Removed custom urlparse compat 2014-12-04 15:47:42 +01:00
Tymur Maryokhin
d54c67d79d Removed custom StringIO, force_text, smart_text compat 2014-12-04 03:11:42 +01:00
Tom Christie
3d6620c72a Merge 2014-12-03 23:24:06 +00:00
Tom Christie
0359e9250d FileUploadParser. Raising StopFutureHandlers removes any handlers not yet run for the active set. Closes #2109. 2014-12-02 13:52:46 +00:00
José Padilla
7f9dc73672 Remove XML support from core 2014-11-29 14:57:51 -04:00
José Padilla
731c8421af Remove YAML support from core 2014-11-29 14:43:05 -04:00
Tom Christie
381771731f Use six.text_type instead of str everywhere 2014-10-01 13:09:14 +01:00
Tom Christie
5e39e159ee UNICODE_JSON and COMPACT_JSON settings 2014-09-12 11:38:22 +01:00
Jason Bittel
3f7fad2e5a Refactor disposition unpacking for clarity 2014-09-05 16:27:55 -07:00
Jason Bittel
c8e475023c Fix encoded filename parsing to allow for lang 2014-09-05 15:22:43 -07:00
Jason Bittel
bcd8a24db1 Refactor encoded filename feature per #1531 2014-09-05 14:56:54 -07:00
Vladislav Vlastovskiy
bcca9ed0fd Removed use encoding available only in py3 2014-09-05 14:52:01 -07:00
Vladislav Vlastovskiy
8a9f34b838 Added get filename as encoded
This filename described in RFC 6266
2014-09-05 14:50:16 -07:00
Tom Christie
63d02dbea8 Drop six from compat. 1.4.2 is now the lowest supported version. 2014-08-19 17:06:55 +01:00
Vladislav Vlastovskiy
3fe0383572 Fixed convert bytes to str
Use compact function for convert
2014-04-14 13:21:24 +04:00
Vladislav Vlastovskiy
d474934d36 Fixed return type
From bytes to str
2014-04-14 13:01:24 +04:00
Vladislav Vlastovskiy
4b3eb6e0b0 Fixed parse file name 2014-04-14 12:21:38 +04:00
Rob Hudson
e33435d0da Fixed exception handling with YAML and XML parsers. 2013-10-31 15:03:50 -07:00
Tom Christie
2247fd68e9 Fix multipart error when used via content-type overloading 2013-08-29 21:24:29 +01:00
Tom Christie
18007d6846 Simplifying raw data renderering support 2013-08-28 21:52:56 +01:00
Tom Christie
8d590ebfde First hacky pass at displaying raw data 2013-08-27 11:22:19 +01:00
Tom Christie
5fa100245c Update parser docstrings. Closes #968. 2013-07-04 12:47:35 +01:00
Tom Christie
429e078eee Allow None filename on uploaded files 2013-05-08 20:07:51 +01:00
Tom Christie
3353889ae8 Docs for FileUploadParser 2013-05-07 13:27:27 +01:00