summaryrefslogtreecommitdiff
path: root/django/core/files/base.py
Commit message (Collapse)AuthorAgeFilesLines
* Refs #33476 -- Reformatted code with Black.django-bot2022-02-071-12/+13
|
* Fixed "byte string" typo in various docs and comments.Mariusz Felisiak2019-03-281-3/+3
|
* Fixed typo in ContentFile docstring.Thomas Grainger2018-07-271-1/+1
|
* Removed redundant UploadedFile.DEFAULT_CHUNK_SIZE.Sergey Fedoseev2018-03-121-1/+1
| | | The same value is inherited from File.
* Used cached_property for File.size.Sergey Fedoseev2018-03-101-13/+4
|
* Fixed #29188 -- Fixed ContentFile.size after a write().Alex Stovbur2018-03-081-0/+4
|
* Fixed #28982 -- Simplified code with and/or.Дилян Палаузов2018-01-031-6/+2
|
* Fixed #27777 -- Made File.open() work with the with statement (#8310)Ingo Klöcker2017-04-071-0/+2
| | | Fixed #27777 -- Made File.open() work with the with statement
* Refs #27795 -- Removed unneeded force_text callsClaude Paroz2017-03-041-2/+1
| | | | Thanks Tim Graham for the review.
* Refs #27656 -- Updated django.core docstring verbs according to PEP 257.Anton Samarchyan2017-02-211-11/+5
|
* Refs #23919 -- Replaced super(ClassName, self) with super().chillaranand2017-01-251-1/+1
|
* Refs #23919 -- Removed unneeded force_str callsClaude Paroz2017-01-201-2/+2
|
* Refs #23919 -- Removed __nonzero__() methods (for Python 2).Simon Charette2017-01-191-6/+0
| | | | Thanks Tim for the review.
* Refs #23919 -- Removed six.<various>_types usageClaude Paroz2017-01-181-5/+4
| | | | Thanks Tim Graham and Simon Charette for the reviews.
* Refs #23919 -- Removed six.PY2/PY3 usageClaude Paroz2017-01-181-6/+2
| | | | Thanks Tim Graham for the review.
* Refs #23919 -- Removed python_2_unicode_compatible decorator usageClaude Paroz2017-01-181-5/+1
|
* Refs #23919 -- Removed encoding preambles and future importsClaude Paroz2017-01-181-2/+0
|
* Replaced smart_* by force_* calls whenever possibleClaude Paroz2016-09-031-2/+2
| | | | | The smart_* version should only be used when a lazy string should keep its lazy status.
* Reverted "Fixed #26644 -- Allowed wrapping NamedTemporaryFile with File."Tim Graham2016-06-181-4/+0
| | | | | This reverts commit 1b407050dd53e56686fdd3e168f8cac4f9be8306 as it introduces a regression in the test for refs #26772.
* Fixed #26644 -- Allowed wrapping NamedTemporaryFile with File.Hugo Osvaldo Barrera2016-06-141-0/+4
| | | | | | | 914c72be2abb1c6dd860cb9279beaa66409ae1b2 introduced a regression that causes saving a NamedTemporaryFile in a FileField to raise a SuspiciousFileOperation. To remedy this, if a File has an absolute path as a filename, use only the basename as the filename.
* Fixed #26646 -- Added IOBase methods required by TextIOWrapper to File.Simon Charette2016-05-271-4/+0
| | | | Thanks Tim for the review.
* Fixed typo in django.core.files.File docstring.Matt Hooks2015-04-021-1/+1
|
* Fixed #23888 -- Fixed crash in File.__repr__() when name contains unicode.Sergey Fedoseev2014-11-241-3/+4
|
* Fixed #8149 -- Made File.__iter__() support universal newlines.Jon Dufresne2014-10-301-7/+34
| | | | | | | | | | The following are recognized as ending a line: the Unix end-of-line convention '\n', the Windows convention '\r\n', and the old Macintosh convention '\r'. http://www.python.org/dev/peps/pep-0278 Thanks tchaumeny for review.
* Fixed a failing test introduced in 918a16bc4c099ab0cae72a231de3e99e2a9d02cb.Baptiste Mispelon2014-03-221-12/+19
| | | | Refs #22307.
* Fixed #22307 -- Fixed SpooledTemporaryFile bug in File class.Hans Lawrenz2014-03-211-1/+1
| | | | | | | Added condition to prevent checking the existence of a file name of a file like object when the name attribute is None. This is necessary because a SpooledTemporaryFile won't exist on the file system or have a name until it has reached its max_size. Also added tests.
* Fixed #22107 -- Fixed django.core.files.File object iteration.Baptiste Mispelon2014-02-201-1/+1
| | | | | | | Due to a mixup between text and bytes, iteration over a File instance was broken under Python 3. Thanks to trac user pdewacht for the report and patch.
* Fixed all E226 violationsAlex Gaynor2013-11-031-1/+1
|
* More attacking E302 violatorsAlex Gaynor2013-11-021-0/+2
|
* Fixed #19367 -- Fixed saving ContentFile in filesystem storageClaude Paroz2012-12-061-3/+6
| | | | | | This was not working properly when ContentFile was initialized with an unicode string. Thanks Alexey Boriskin for the report and the test.
* Fixed #18963 -- Used a subclass-friendly patternAymeric Augustin2012-11-031-2/+6
| | | | for Python 2 object model compatibility methods.
* Fixed #11739 -- Made ContentFile support Unicode inputClaude Paroz2012-08-291-2/+4
|
* Replaced many smart_bytes by force_bytesClaude Paroz2012-08-291-1/+1
| | | | | | In all those occurrences, we didn't care about preserving the lazy status of the strings, but we really wanted to obtain a real bytestring.
* [py3] Fixed file_storage tests.Aymeric Augustin2012-08-181-2/+4
|
* [py3] Refactored __unicode__ to __str__.Aymeric Augustin2012-08-121-2/+5
| | | | | | | | | * Renamed the __unicode__ methods * Applied the python_2_unicode_compatible decorator * Removed the StrAndUnicode mix-in that is superseded by python_2_unicode_compatible * Kept the __unicode__ methods in classes that specifically test it under Python 2
* [py3] Replaced some __str__ methods by __unicode__Aymeric Augustin2012-08-121-1/+1
| | | | These methods actually return unicode.
* [py3] Removed redundant __str__ methods.Aymeric Augustin2012-08-121-3/+0
| | | | | These classes already have an identical __unicode__ method, which will be used after an upcoming refactoring.
* [py3] Replaced __nonzero__ by __bool__Claude Paroz2012-08-081-2/+4
| | | | Of course, __nonzero__ alias has been kept for Python 2 compatibility.
* [py3] Ported django.utils.encoding.Aymeric Augustin2012-08-071-3/+3
| | | | | | | | | | | * Renamed smart_unicode to smart_text (but kept the old name under Python 2 for backwards compatibility). * Renamed smart_str to smart_bytes. * Re-introduced smart_str as an alias for smart_text under Python 3 and smart_bytes under Python 2 (which is backwards compatible). Thus smart_str always returns a str objects. * Used the new smart_str in a few places where both Python 2 and 3 want a str.
* Fixed #18269 -- Applied unicode_literals for Python 3 compatibility.Claude Paroz2012-06-071-1/+3
| | | | | Thanks Vinay Sajip for the support of his django3 branch and Jannis Leidel for the review.
* Fixed #14681 -- Do not set mode to None on file-like objects.Claude Paroz2012-05-311-1/+2
| | | | gzip.GzipFile does not support files with mode set to None.
* Marked bytestrings with b prefix. Refs #18269Claude Paroz2012-05-191-1/+1
| | | | | This is a preparation for unicode literals general usage in Django (Python 3 compatibility).
* Used io.BytesIO also for ContentFile.Claude Paroz2012-05-051-2/+2
| | | | | io.StringIO would force the content to be Unicode, which would be slightly backwards incompatible.
* Replaced cStringIO.StringIO by io.BytesIO.Claude Paroz2012-05-051-5/+2
| | | | | Also replaced StringIO.StringIO by BytesIO in some other appropriate places. StringIO is not available in Python 3.
* Fixed #15644 -- Improved Django File wrapper to support more file-like ↵Claude Paroz2012-04-051-6/+11
| | | | | | objects. Thanks nickname123 and Michael Palumbo for working on the patch. git-svn-id: http://code.djangoproject.com/svn/django/trunk@17871 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #16590 -- Accepted a 'name' argument in the constructor of ↵Aymeric Augustin2011-12-301-2/+2
| | | | | | ContentFile, for consistency with File. git-svn-id: http://code.djangoproject.com/svn/django/trunk@17298 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #14749 -- added support for using Django's file object as context ↵Alex Gaynor2010-11-211-0/+6
| | | | | | managers. Thanks to Florian Apolloner for the patch. git-svn-id: http://code.djangoproject.com/svn/django/trunk@14671 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #10404: ImageField height_field and width_field options no longer ↵Jacob Kaplan-Moss2009-05-111-7/+9
| | | | | | | | | | | | | | | | depend on putting the image field after the height/width fields as they did after r9766. This bug actually exposed a related handful of inconsistancies in the underlying file handling and wraping, so a few related changes are in here as well: * Dimensions are also now calculated the moment the image is assigned to the field instead of upon save. * The base `File` object now when possible delegates its closed attribute down to the os-level file it wrapps. * In-memory files' `close()` now is a no-op. Without this certain APIs that should be able to handle in-memory files were failing. * Accessing `FieldFile.closed` used to open the file. That's silly, and it doesn't any more. * Some over-eager error handling was squishing some errors that would normally be raised. One unit test was incorrectly depending on this behavior, so the test was removed. Thanks to Armin Ronacher for much of this work. git-svn-id: http://code.djangoproject.com/svn/django/trunk@10737 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #10687: fixed request parsing when upload_handlers is empty. Thanks, ↵Jacob Kaplan-Moss2009-05-081-1/+0
| | | | | | Armin Ronacher. git-svn-id: http://code.djangoproject.com/svn/django/trunk@10723 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #7712, #9404, #10249, #10300: a light refactor and cleanup of file ↵Jacob Kaplan-Moss2009-05-081-57/+19
| | | | | | storage and the `File` object. Thanks to Armin Ronacher and Alex Gaynor. git-svn-id: http://code.djangoproject.com/svn/django/trunk@10717 bcc190cf-cafb-0310-a4f2-bffc1f526a37