| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
| |
|
| |
|
|
|
| |
The same value is inherited from File.
|
| |
|
| |
|
| |
|
|
|
| |
Fixed #27777 -- Made File.open() work with the with statement
|
|
|
|
| |
Thanks Tim Graham for the review.
|
| |
|
| |
|
| |
|
|
|
|
| |
Thanks Tim for the review.
|
|
|
|
| |
Thanks Tim Graham and Simon Charette for the reviews.
|
|
|
|
| |
Thanks Tim Graham for the review.
|
| |
|
| |
|
|
|
|
|
| |
The smart_* version should only be used when a lazy string should keep
its lazy status.
|
|
|
|
|
| |
This reverts commit 1b407050dd53e56686fdd3e168f8cac4f9be8306 as it
introduces a regression in the test for refs #26772.
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
Thanks Tim for the review.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
Refs #22307.
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
|
|
|
|
|
| |
This was not working properly when ContentFile was initialized with
an unicode string.
Thanks Alexey Boriskin for the report and the test.
|
|
|
|
| |
for Python 2 object model compatibility methods.
|
| |
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
| |
* 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
|
|
|
|
| |
These methods actually return unicode.
|
|
|
|
|
| |
These classes already have an identical __unicode__ method, which
will be used after an upcoming refactoring.
|
|
|
|
| |
Of course, __nonzero__ alias has been kept for Python 2 compatibility.
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
| |
Thanks Vinay Sajip for the support of his django3 branch and
Jannis Leidel for the review.
|
|
|
|
| |
gzip.GzipFile does not support files with mode set to None.
|
|
|
|
|
| |
This is a preparation for unicode literals general usage in
Django (Python 3 compatibility).
|
|
|
|
|
| |
io.StringIO would force the content to be Unicode, which would be
slightly backwards incompatible.
|
|
|
|
|
| |
Also replaced StringIO.StringIO by BytesIO in some other appropriate
places. StringIO is not available in Python 3.
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
| |
ContentFile, for consistency with File.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17298 bcc190cf-cafb-0310-a4f2-bffc1f526a37
|
|
|
|
|
|
| |
managers. Thanks to Florian Apolloner for the patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@14671 bcc190cf-cafb-0310-a4f2-bffc1f526a37
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
| |
Armin Ronacher.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10723 bcc190cf-cafb-0310-a4f2-bffc1f526a37
|
|
|
|
|
|
| |
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
|