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
ba6c0d3b
Kaydet (Commit)
ba6c0d3b
authored
Haz 08, 2013
tarafından
Terry Jan Reedy
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
#18151, part 1: Backport idlelilb portion of Andrew Svetlov's 3.4 patch
changing IOError to OSError (#16715).
üst
50793b44
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
18 additions
and
22 deletions
+18
-22
EditorWindow.py
Lib/idlelib/EditorWindow.py
+1
-1
GrepDialog.py
Lib/idlelib/GrepDialog.py
+1
-1
IOBinding.py
Lib/idlelib/IOBinding.py
+2
-2
OutputWindow.py
Lib/idlelib/OutputWindow.py
+1
-1
PyShell.py
Lib/idlelib/PyShell.py
+4
-4
configHandler.py
Lib/idlelib/configHandler.py
+7
-11
rpc.py
Lib/idlelib/rpc.py
+1
-1
textView.py
Lib/idlelib/textView.py
+1
-1
No files found.
Lib/idlelib/EditorWindow.py
Dosyayı görüntüle @
ba6c0d3b
...
@@ -901,7 +901,7 @@ class EditorWindow(object):
...
@@ -901,7 +901,7 @@ class EditorWindow(object):
with
open
(
self
.
recent_files_path
,
'w'
,
with
open
(
self
.
recent_files_path
,
'w'
,
encoding
=
'utf_8'
,
errors
=
'replace'
)
as
rf_file
:
encoding
=
'utf_8'
,
errors
=
'replace'
)
as
rf_file
:
rf_file
.
writelines
(
rf_list
)
rf_file
.
writelines
(
rf_list
)
except
IO
Error
as
err
:
except
OS
Error
as
err
:
if
not
getattr
(
self
.
root
,
"recentfilelist_error_displayed"
,
False
):
if
not
getattr
(
self
.
root
,
"recentfilelist_error_displayed"
,
False
):
self
.
root
.
recentfilelist_error_displayed
=
True
self
.
root
.
recentfilelist_error_displayed
=
True
tkMessageBox
.
showerror
(
title
=
'IDLE Error'
,
tkMessageBox
.
showerror
(
title
=
'IDLE Error'
,
...
...
Lib/idlelib/GrepDialog.py
Dosyayı görüntüle @
ba6c0d3b
...
@@ -82,7 +82,7 @@ class GrepDialog(SearchDialogBase):
...
@@ -82,7 +82,7 @@ class GrepDialog(SearchDialogBase):
for
fn
in
list
:
for
fn
in
list
:
try
:
try
:
f
=
open
(
fn
,
errors
=
'replace'
)
f
=
open
(
fn
,
errors
=
'replace'
)
except
IO
Error
as
msg
:
except
OS
Error
as
msg
:
print
(
msg
)
print
(
msg
)
continue
continue
lineno
=
0
lineno
=
0
...
...
Lib/idlelib/IOBinding.py
Dosyayı görüntüle @
ba6c0d3b
...
@@ -213,7 +213,7 @@ class IOBinding:
...
@@ -213,7 +213,7 @@ class IOBinding:
f
.
seek
(
0
)
f
.
seek
(
0
)
bytes
=
f
.
read
()
bytes
=
f
.
read
()
f
.
close
()
f
.
close
()
except
IO
Error
as
msg
:
except
OS
Error
as
msg
:
tkMessageBox
.
showerror
(
"I/O Error"
,
str
(
msg
),
master
=
self
.
text
)
tkMessageBox
.
showerror
(
"I/O Error"
,
str
(
msg
),
master
=
self
.
text
)
return
False
return
False
chars
,
converted
=
self
.
_decode
(
two_lines
,
bytes
)
chars
,
converted
=
self
.
_decode
(
two_lines
,
bytes
)
...
@@ -378,7 +378,7 @@ class IOBinding:
...
@@ -378,7 +378,7 @@ class IOBinding:
f
.
flush
()
f
.
flush
()
f
.
close
()
f
.
close
()
return
True
return
True
except
IO
Error
as
msg
:
except
OS
Error
as
msg
:
tkMessageBox
.
showerror
(
"I/O Error"
,
str
(
msg
),
tkMessageBox
.
showerror
(
"I/O Error"
,
str
(
msg
),
master
=
self
.
text
)
master
=
self
.
text
)
return
False
return
False
...
...
Lib/idlelib/OutputWindow.py
Dosyayı görüntüle @
ba6c0d3b
...
@@ -106,7 +106,7 @@ class OutputWindow(EditorWindow):
...
@@ -106,7 +106,7 @@ class OutputWindow(EditorWindow):
f
=
open
(
filename
,
"r"
)
f
=
open
(
filename
,
"r"
)
f
.
close
()
f
.
close
()
break
break
except
IO
Error
:
except
OS
Error
:
continue
continue
else
:
else
:
return
None
return
None
...
...
Lib/idlelib/PyShell.py
Dosyayı görüntüle @
ba6c0d3b
...
@@ -59,7 +59,7 @@ else:
...
@@ -59,7 +59,7 @@ else:
try
:
try
:
file
.
write
(
warnings
.
formatwarning
(
message
,
category
,
filename
,
file
.
write
(
warnings
.
formatwarning
(
message
,
category
,
filename
,
lineno
,
line
=
line
))
lineno
,
line
=
line
))
except
IO
Error
:
except
OS
Error
:
pass
## file (probably __stderr__) is invalid, warning dropped.
pass
## file (probably __stderr__) is invalid, warning dropped.
warnings
.
showwarning
=
idle_showwarning
warnings
.
showwarning
=
idle_showwarning
def
idle_formatwarning
(
message
,
category
,
filename
,
lineno
,
line
=
None
):
def
idle_formatwarning
(
message
,
category
,
filename
,
lineno
,
line
=
None
):
...
@@ -213,7 +213,7 @@ class PyShellEditorWindow(EditorWindow):
...
@@ -213,7 +213,7 @@ class PyShellEditorWindow(EditorWindow):
try
:
try
:
with
open
(
self
.
breakpointPath
,
"r"
)
as
fp
:
with
open
(
self
.
breakpointPath
,
"r"
)
as
fp
:
lines
=
fp
.
readlines
()
lines
=
fp
.
readlines
()
except
IO
Error
:
except
OS
Error
:
lines
=
[]
lines
=
[]
try
:
try
:
with
open
(
self
.
breakpointPath
,
"w"
)
as
new_file
:
with
open
(
self
.
breakpointPath
,
"w"
)
as
new_file
:
...
@@ -224,7 +224,7 @@ class PyShellEditorWindow(EditorWindow):
...
@@ -224,7 +224,7 @@ class PyShellEditorWindow(EditorWindow):
breaks
=
self
.
breakpoints
breaks
=
self
.
breakpoints
if
breaks
:
if
breaks
:
new_file
.
write
(
filename
+
'='
+
str
(
breaks
)
+
'
\n
'
)
new_file
.
write
(
filename
+
'='
+
str
(
breaks
)
+
'
\n
'
)
except
IO
Error
as
err
:
except
OS
Error
as
err
:
if
not
getattr
(
self
.
root
,
"breakpoint_error_displayed"
,
False
):
if
not
getattr
(
self
.
root
,
"breakpoint_error_displayed"
,
False
):
self
.
root
.
breakpoint_error_displayed
=
True
self
.
root
.
breakpoint_error_displayed
=
True
tkMessageBox
.
showerror
(
title
=
'IDLE Error'
,
tkMessageBox
.
showerror
(
title
=
'IDLE Error'
,
...
@@ -532,7 +532,7 @@ class ModifiedInterpreter(InteractiveInterpreter):
...
@@ -532,7 +532,7 @@ class ModifiedInterpreter(InteractiveInterpreter):
return
return
try
:
try
:
response
=
clt
.
pollresponse
(
self
.
active_seq
,
wait
=
0.05
)
response
=
clt
.
pollresponse
(
self
.
active_seq
,
wait
=
0.05
)
except
(
EOFError
,
IO
Error
,
KeyboardInterrupt
):
except
(
EOFError
,
OS
Error
,
KeyboardInterrupt
):
# lost connection or subprocess terminated itself, restart
# lost connection or subprocess terminated itself, restart
# [the KBI is from rpc.SocketIO.handle_EOF()]
# [the KBI is from rpc.SocketIO.handle_EOF()]
if
self
.
tkconsole
.
closing
:
if
self
.
tkconsole
.
closing
:
...
...
Lib/idlelib/configHandler.py
Dosyayı görüntüle @
ba6c0d3b
...
@@ -142,7 +142,7 @@ class IdleUserConfParser(IdleConfParser):
...
@@ -142,7 +142,7 @@ class IdleUserConfParser(IdleConfParser):
fname
=
self
.
file
fname
=
self
.
file
try
:
try
:
cfgFile
=
open
(
fname
,
'w'
)
cfgFile
=
open
(
fname
,
'w'
)
except
IO
Error
:
except
OS
Error
:
os
.
unlink
(
fname
)
os
.
unlink
(
fname
)
cfgFile
=
open
(
fname
,
'w'
)
cfgFile
=
open
(
fname
,
'w'
)
with
cfgFile
:
with
cfgFile
:
...
@@ -207,7 +207,7 @@ class IdleConf:
...
@@ -207,7 +207,7 @@ class IdleConf:
userDir
+
',
\n
but the path does not exist.
\n
'
)
userDir
+
',
\n
but the path does not exist.
\n
'
)
try
:
try
:
sys
.
stderr
.
write
(
warn
)
sys
.
stderr
.
write
(
warn
)
except
IO
Error
:
except
OS
Error
:
pass
pass
userDir
=
'~'
userDir
=
'~'
if
userDir
==
"~"
:
# still no path to home!
if
userDir
==
"~"
:
# still no path to home!
...
@@ -217,7 +217,7 @@ class IdleConf:
...
@@ -217,7 +217,7 @@ class IdleConf:
if
not
os
.
path
.
exists
(
userDir
):
if
not
os
.
path
.
exists
(
userDir
):
try
:
try
:
os
.
mkdir
(
userDir
)
os
.
mkdir
(
userDir
)
except
(
OSError
,
IOError
)
:
except
OSError
:
warn
=
(
'
\n
Warning: unable to create user config directory
\n
'
+
warn
=
(
'
\n
Warning: unable to create user config directory
\n
'
+
userDir
+
'
\n
Check path and permissions.
\n
Exiting!
\n\n
'
)
userDir
+
'
\n
Check path and permissions.
\n
Exiting!
\n\n
'
)
sys
.
stderr
.
write
(
warn
)
sys
.
stderr
.
write
(
warn
)
...
@@ -251,7 +251,7 @@ class IdleConf:
...
@@ -251,7 +251,7 @@ class IdleConf:
raw
=
raw
)))
raw
=
raw
)))
try
:
try
:
sys
.
stderr
.
write
(
warning
)
sys
.
stderr
.
write
(
warning
)
except
IO
Error
:
except
OS
Error
:
pass
pass
try
:
try
:
if
self
.
defaultCfg
[
configType
]
.
has_option
(
section
,
option
):
if
self
.
defaultCfg
[
configType
]
.
has_option
(
section
,
option
):
...
@@ -268,13 +268,11 @@ class IdleConf:
...
@@ -268,13 +268,11 @@ class IdleConf:
(
option
,
section
,
default
))
(
option
,
section
,
default
))
try
:
try
:
sys
.
stderr
.
write
(
warning
)
sys
.
stderr
.
write
(
warning
)
except
IO
Error
:
except
OS
Error
:
pass
pass
return
default
return
default
def
SetOption
(
self
,
configType
,
section
,
option
,
value
):
def
SetOption
(
self
,
configType
,
section
,
option
,
value
):
"""In user's config file, set section's option to value.
"""In user's config file, set section's option to value.
"""
"""
self
.
userCfg
[
configType
]
.
SetOption
(
section
,
option
,
value
)
self
.
userCfg
[
configType
]
.
SetOption
(
section
,
option
,
value
)
...
@@ -380,7 +378,7 @@ class IdleConf:
...
@@ -380,7 +378,7 @@ class IdleConf:
(
element
,
themeName
,
theme
[
element
]))
(
element
,
themeName
,
theme
[
element
]))
try
:
try
:
sys
.
stderr
.
write
(
warning
)
sys
.
stderr
.
write
(
warning
)
except
IO
Error
:
except
OS
Error
:
pass
pass
colour
=
cfgParser
.
Get
(
themeName
,
element
,
default
=
theme
[
element
])
colour
=
cfgParser
.
Get
(
themeName
,
element
,
default
=
theme
[
element
])
theme
[
element
]
=
colour
theme
[
element
]
=
colour
...
@@ -637,13 +635,11 @@ class IdleConf:
...
@@ -637,13 +635,11 @@ class IdleConf:
(
event
,
keySetName
,
keyBindings
[
event
]))
(
event
,
keySetName
,
keyBindings
[
event
]))
try
:
try
:
sys
.
stderr
.
write
(
warning
)
sys
.
stderr
.
write
(
warning
)
except
IO
Error
:
except
OS
Error
:
pass
pass
return
keyBindings
return
keyBindings
def
GetExtraHelpSourceList
(
self
,
configSet
):
def
GetExtraHelpSourceList
(
self
,
configSet
):
"""Fetch list of extra help sources from a given configSet.
"""Fetch list of extra help sources from a given configSet.
Valid configSets are 'user' or 'default'. Return a list of tuples of
Valid configSets are 'user' or 'default'. Return a list of tuples of
the form (menu_item , path_to_help_file , option), or return the empty
the form (menu_item , path_to_help_file , option), or return the empty
list. 'option' is the sequence number of the help resource. 'option'
list. 'option' is the sequence number of the help resource. 'option'
...
...
Lib/idlelib/rpc.py
Dosyayı görüntüle @
ba6c0d3b
...
@@ -339,7 +339,7 @@ class SocketIO(object):
...
@@ -339,7 +339,7 @@ class SocketIO(object):
r
,
w
,
x
=
select
.
select
([],
[
self
.
sock
],
[])
r
,
w
,
x
=
select
.
select
([],
[
self
.
sock
],
[])
n
=
self
.
sock
.
send
(
s
[:
BUFSIZE
])
n
=
self
.
sock
.
send
(
s
[:
BUFSIZE
])
except
(
AttributeError
,
TypeError
):
except
(
AttributeError
,
TypeError
):
raise
IO
Error
(
"socket no longer exists"
)
raise
OS
Error
(
"socket no longer exists"
)
except
socket
.
error
:
except
socket
.
error
:
raise
raise
else
:
else
:
...
...
Lib/idlelib/textView.py
Dosyayı görüntüle @
ba6c0d3b
...
@@ -66,7 +66,7 @@ def view_file(parent, title, filename, encoding=None, modal=True):
...
@@ -66,7 +66,7 @@ def view_file(parent, title, filename, encoding=None, modal=True):
try
:
try
:
with
open
(
filename
,
'r'
,
encoding
=
encoding
)
as
file
:
with
open
(
filename
,
'r'
,
encoding
=
encoding
)
as
file
:
contents
=
file
.
read
()
contents
=
file
.
read
()
except
IO
Error
:
except
OS
Error
:
import
tkinter.messagebox
as
tkMessageBox
import
tkinter.messagebox
as
tkMessageBox
tkMessageBox
.
showerror
(
title
=
'File Load Error'
,
tkMessageBox
.
showerror
(
title
=
'File Load Error'
,
message
=
'Unable to load file
%
r .'
%
filename
,
message
=
'Unable to load file
%
r .'
%
filename
,
...
...
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