Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 94757 Details for
Bug 144611
app-misc/ccal crash on empty entry in editor
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
external editor file not saved fix
ccal-0.6-empty-editor-entry.patch (text/plain), 1.46 KB, created by
Gabi Shaar
on 2006-08-21 02:10:39 UTC
(
hide
)
Description:
external editor file not saved fix
Filename:
MIME Type:
Creator:
Gabi Shaar
Created:
2006-08-21 02:10:39 UTC
Size:
1.46 KB
patch
obsolete
>--- ccal-0.6.py 2006-08-21 11:50:41.000000000 +0300 >+++ ccal-0.6.1.py 2006-08-21 11:51:26.000000000 +0300 >@@ -81,6 +81,8 @@ > import calendar > import datetime > import os >+# tempfile is used as a variable name a lot. >+from tempfile import mkstemp > import sys > import httplib, urllib, pickle, urllib2 > import ConfigParser >@@ -846,11 +848,26 @@ > except: > pass > >- os.system(self.editor+" "+self.temppath+"/"+temptime) >- tempfile=open(self.temppath+"/"+temptime) >- tempstring=tempfile.read() >- templines=tempstring.split("\n") >- entry=templines[0] >+ # this is safer. should be used everywhere. >+ (fd, tempfilename) = mkstemp(".entry","ccal") >+ os.close(fd) >+ # open editor >+ os.system(" ".join((self.editor,tempfilename))) >+ # get the new entry (due to mkstemp file gets created anyway, >+ # but still better to "try") >+ try: >+ tempfile=open(tempfilename) >+ tempstring=tempfile.read() >+ templines=tempstring.splitlines() >+ entry=templines[0] >+ fullentry=templines[1:] >+ except: >+ if tempfile: >+ tempfile.close() >+ entry="" >+ >+ # cleanup temp file >+ os.unlink(tempfilename) > > #re-initialise stuff as vim seems to mess it up > self.scr=curses.initscr() >@@ -868,12 +885,12 @@ > self.handleException(e) > #refresh > self.scr.refresh() >- fullentry=templines[1:] > > try: > curses.curs_set(0) > except: > pass >+ > if entry!="": > self._cal.addItem(ccalItem(entry,fullentry=fullentry)) > curses.noecho()
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 144611
: 94757