Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
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
cpython
Commits
f206d0e3
Kaydet (Commit)
f206d0e3
authored
Tem 29, 2010
tarafından
Georg Brandl
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fix for r83202: improve the handling of empty lines.
üst
c62a7041
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
7 deletions
+8
-7
configparser.py
Lib/configparser.py
+8
-7
No files found.
Lib/configparser.py
Dosyayı görüntüle @
f206d0e3
...
...
@@ -558,7 +558,7 @@ class RawConfigParser:
indent_level
=
0
e
=
None
# None, or an exception
for
lineno
,
line
in
enumerate
(
fp
,
start
=
1
):
# strip
prefix-only
comments
# strip
full line
comments
comment_start
=
None
for
prefix
in
self
.
_startonly_comment_prefixes
:
if
line
.
strip
()
.
startswith
(
prefix
):
...
...
@@ -572,11 +572,14 @@ class RawConfigParser:
break
value
=
line
[:
comment_start
]
.
strip
()
if
not
value
:
if
self
.
_empty_lines_in_values
and
comment_start
is
None
:
if
self
.
_empty_lines_in_values
:
# add empty line to the value, but only if there was no
# comment on the line
if
cursect
is
not
None
and
optname
:
cursect
[
optname
]
.
append
(
'
\n
'
)
if
(
comment_start
is
None
and
cursect
is
not
None
and
optname
and
cursect
[
optname
]
is
not
None
):
cursect
[
optname
]
.
append
(
''
)
# newlines added at join
else
:
# empty line marks end of value
indent_level
=
sys
.
maxsize
...
...
@@ -643,9 +646,7 @@ class RawConfigParser:
for
options
in
all_sections
:
for
name
,
val
in
options
.
items
():
if
isinstance
(
val
,
list
):
if
val
[
-
1
]
==
'
\n
'
:
val
=
val
[:
-
1
]
options
[
name
]
=
'
\n
'
.
join
(
val
)
options
[
name
]
=
'
\n
'
.
join
(
val
)
.
rstrip
()
def
_handle_error
(
self
,
exc
,
fpname
,
lineno
,
line
):
if
not
exc
:
...
...
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