Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(92545)

Unified Diff: Lib/idlelib/IOBinding.py

Issue 15363: Idle/tkinter ~x.py 'save as' fails. closes idle
Patch Set: Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
--- a/Lib/idlelib/IOBinding.py Sun Oct 12 01:11:05 2014 -0400
+++ b/Lib/idlelib/IOBinding.py Sun Oct 12 03:56:36 2014 -0400
@@ -500,15 +500,19 @@
def defaultfilename(self, mode="open"):
if self.filename:
- return os.path.split(self.filename)
+ dirname, base = os.path.split(self.filename)
storchaka 2014/10/12 11:40:28 Either dirname and basename or dir and base for co
+ if base.startswith('~') and sys.platform[:3] == 'win':
storchaka 2014/10/12 11:40:28 base.startswith('~') but sys.platform[:3] == 'win'
+ # Fix Tcl/Tk Tilde Substitution problem on Windows
+ base = './' + base # Escape the tilde
storchaka 2014/10/12 11:40:28 Or rather os.path.join(os.path.curdir, base).
+ return dirname, base
elif self.dirname:
return self.dirname, ""
else:
try:
- pwd = os.getcwd()
+ dirname = os.getcwd()
except OSError:
- pwd = ""
- return pwd, ""
+ dirname = ""
+ return dirname, ""
def asksavefile(self):
dir, base = self.defaultfilename("save")
« no previous file with comments | « no previous file | no next file » | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+