Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
D
django
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
django
Commits
4ad9f4d4
Kaydet (Commit)
4ad9f4d4
authored
Kas 02, 2013
tarafından
Alex Gaynor
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Replaced a hardcoded "2" with the right named constant
üst
ee48f4af
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletion
+5
-1
uploadedfile.py
django/core/files/uploadedfile.py
+5
-1
No files found.
django/core/files/uploadedfile.py
Dosyayı görüntüle @
4ad9f4d4
...
...
@@ -2,6 +2,7 @@
Classes representing uploaded files.
"""
import
errno
import
os
from
io
import
BytesIO
...
...
@@ -13,6 +14,7 @@ from django.utils.encoding import force_str
__all__
=
(
'UploadedFile'
,
'TemporaryUploadedFile'
,
'InMemoryUploadedFile'
,
'SimpleUploadedFile'
)
class
UploadedFile
(
File
):
"""
A abstract uploaded file (``TemporaryUploadedFile`` and
...
...
@@ -53,6 +55,7 @@ class UploadedFile(File):
name
=
property
(
_get_name
,
_set_name
)
class
TemporaryUploadedFile
(
UploadedFile
):
"""
A file uploaded to a temporary location (i.e. stream-to-disk).
...
...
@@ -75,12 +78,13 @@ class TemporaryUploadedFile(UploadedFile):
try
:
return
self
.
file
.
close
()
except
OSError
as
e
:
if
e
.
errno
!=
2
:
if
e
.
errno
!=
errno
.
ENOENT
:
# Means the file was moved or deleted before the tempfile
# could unlink it. Still sets self.file.close_called and
# calls self.file.file.close() before the exception
raise
class
InMemoryUploadedFile
(
UploadedFile
):
"""
A file uploaded into memory (i.e. stream-to-memory).
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment