f



upgrade problem tcl/tk-8.4 -> 8.5 -- please help

Hi,

unfortunately I have next to no knowledge in Tcl.

When upgrading from Tcl/Tk-8.4.* to  8.5.3 an error occurs in
an old script (tkdiff+)

I get
unmatched open brace in list
unmatched open brace in list
     while executing
"foreach {pattern dummy1 dummy2} $content {
		if {$pattern == $data(v:status:pattern)} {
			set content [lreplace $content $i $i [clock format [clock s..."


where $content contains (many lines removed)

/Src/Src/Tcl/tkdiff-4.1.3-unix|/Src/Src/Tcl/tkdiff-4.1.4-unix {Sat Mar 08 16:20:58 CET 2008} {
     directory:.                                                            none
     directory:..                                                           none
          file:COPYING                                                      none
          file:Changelog                                                    nok
          file:tkdiff                                                       nok
          file:tkdiff.bck                                                   none  }

/home/jarausch/Python_My/BackUp_X|/numa-i/home/jarausch/Python_My/BackUp_OLD {Tue May 20 14:39:37 CEST 2008} {
     directory:.                                                            none
     directory:..                                                           none
          file:AFS_Launch.C                                                 none
          file:BackUp.Config                                                none


     directory:jarausch                                                     none
          file:walk_bench.py                                                none
          file:walktree.html                                                none
          file:walktree.py                                                  none
          file:walktree.pyc                                                 none  }


Many thanks for a hint,

Helmut Jarausch

Lehrstuhl fuer Numerische Mathematik
RWTH - Aachen University
D 52056 Aachen, Germany
0
jarausch (168)
7/31/2008 7:30:09 AM
comp.lang.tcl 23428 articles. 2 followers. Post Follow

4 Replies
1227 Views

Similar Articles

[PageSpeed] 58

On Jul 31, 12:30 am, Helmut Jarausch <jarau...@skynet.be> wrote:
> Hi,
>
> unfortunately I have next to no knowledge in Tcl.
>
> When upgrading from Tcl/Tk-8.4.* to  8.5.3 an error occurs in
> an old script (tkdiff+)
>
> I get
> unmatched open brace in list
> unmatched open brace in list
>      while executing
> "foreach {pattern dummy1 dummy2} $content {
>                 if {$pattern == $data(v:status:pattern)} {
>                         set content [lreplace $content $i $i [clock format [clock s..."
>
> where $content contains (many lines removed)

Maybe $content contains many lines and is removed, but it probably
also contains brace characters, and is not really a list.  If it *is*
a list, are you sure it has a multiple of three elements?

My guess is it is different from before because of changes
to the [clock] command, including some annoying degradation
of functionality in [clock scan], but losing inconsistencies
and errors that were there previously.



Donald Arseneau                          asnd@triumf.ca
0
asnd (4601)
7/31/2008 8:24:02 AM
On Jul 31, 1:24 am, Donald Arseneau <a...@triumf.ca> wrote:
> On Jul 31, 12:30 am, Helmut Jarausch <jarau...@skynet.be> wrote:
> > When upgrading from Tcl/Tk-8.4.* to  8.5.3 an error occurs in
> > an old script (tkdiff+)
> > unmatched open brace in list
> >      while executing
> > "foreach {pattern dummy1 dummy2} $content {

> Maybe $content contains many lines and is removed, but it probably
> also contains brace characters, and is not really a list.

OK, I grabbed tkdiff+.3.07g, and that line is part of status:save,
and $content is the contents of the rc file, likely .tkdiffrc or
_tkdiff.rc.  Check that the file has not been clobbered.

Ummmm... does your rc file contain comments?  Comments are allowed
for processing the file, but I don't see any method for handling
them when saving the status.

Donald Arseneau                          a...@triumf.ca

0
asnd (4601)
7/31/2008 8:37:40 AM
Donald Arseneau wrote:
> On Jul 31, 1:24 am, Donald Arseneau <a...@triumf.ca> wrote:
>> On Jul 31, 12:30 am, Helmut Jarausch <jarau...@skynet.be> wrote:
>>> When upgrading from Tcl/Tk-8.4.* to  8.5.3 an error occurs in
>>> an old script (tkdiff+)
>>> unmatched open brace in list
>>>      while executing
>>> "foreach {pattern dummy1 dummy2} $content {
> 
>> Maybe $content contains many lines and is removed, but it probably
>> also contains brace characters, and is not really a list.
> 
> OK, I grabbed tkdiff+.3.07g, and that line is part of status:save,
> and $content is the contents of the rc file, likely .tkdiffrc or
> _tkdiff.rc.  Check that the file has not been clobbered.
> 
> Ummmm... does your rc file contain comments?  Comments are allowed
> for processing the file, but I don't see any method for handling
> them when saving the status.
> 
> Donald Arseneau                          a...@triumf.ca
> 

Thanks Donald!

I've remove .tkdiffrc and now the error occurs at line 9422

  	foreach {p d f} $content {
		# remove entries older than 6 months
		if {[clock scan "6 months" -base [clock scan $d]] > [clock seconds]} {
			puts $out "[list $p] [list $d] [list $f]\n"
		}
Naively I've tried

#!/usr/bin/wish
set t [clock format [clock seconds]]

puts stdout $t
clock scan $t

# this gives
Thu Jul 31 10:01:57 +0000 2008
Error in startup script: unable to convert date-time string "Thu Jul 31 10:01:57 +0000 2008"
     while executing
"FreeScan $string $base $timezone $locale"
     (procedure "::tcl::clock::scan" line 70)
     invoked from within
"clock scan $t"
     (file "clock_test.tcl" line 5)


What am I missing here?

-- 
Helmut Jarausch

Lehrstuhl fuer Numerische Mathematik
RWTH - Aachen University
D 52056 Aachen, Germany
0
jarausch (168)
7/31/2008 10:06:42 AM
Donald Arseneau wrote:
> On Jul 31, 1:24 am, Donald Arseneau <a...@triumf.ca> wrote:
>> On Jul 31, 12:30 am, Helmut Jarausch <jarau...@skynet.be> wrote:
>>> When upgrading from Tcl/Tk-8.4.* to  8.5.3 an error occurs in
>>> an old script (tkdiff+)
>>> unmatched open brace in list
>>>      while executing
>>> "foreach {pattern dummy1 dummy2} $content {
> 
>> Maybe $content contains many lines and is removed, but it probably
>> also contains brace characters, and is not really a list.
> 
> OK, I grabbed tkdiff+.3.07g, and that line is part of status:save,
> and $content is the contents of the rc file, likely .tkdiffrc or
> _tkdiff.rc.  Check that the file has not been clobbered.
> 
> Ummmm... does your rc file contain comments?  Comments are allowed
> for processing the file, but I don't see any method for handling
> them when saving the status.
> 

Meanwhile I've managed to patch tkdiff+ since
clock format / clock scan
seems inconsistent to me in Tcl 8.5.3  (see my other reply)

Here is the patch

--- tkdiff+-SAVE	2006-09-14 14:20:47.000000000 +0000
+++ tkdiff+	2008-07-31 11:14:12.000000000 +0000
@@ -3677,7 +3677,7 @@

      # put the tkdiff version in the file. It might be handy later
      puts $fid "# This file was generated by $g(name) $g(version)"
-    puts $fid "# [clock format [clock seconds]]\n"
+    puts $fid "# [clock format [clock seconds] -format "%Y/%m/%d %H:%M"]\n"
      puts $fid "set prefsFileVersion {$g(version)}\n"

      # now, put all of the preferences in the file
@@ -8940,7 +8940,7 @@
  	set mtime "?               "
  	catch { set size [file size $file] }
  	catch { set mtime [clock format [file mtime $file] \
-							-format {%Y/%m/%d %H:%M}]}
+							-format "%Y/%m/%d %H:%M"]}
  	return "\t[file tail $file]\t$size\t$mtime"
  }

@@ -9403,7 +9403,7 @@
  	set i 1
  	foreach {pattern dummy1 dummy2} $content {
  		if {$pattern == $data(v:status:pattern)} {
-			set content [lreplace $content $i $i [clock format [clock seconds]]]
+			set content [lreplace $content $i $i [clock format [clock seconds] -format "%Y/%m/%d %H:%M"]]
  			incr i
  			set content [lreplace $content $i $i $files]
  			set done 1
@@ -9412,14 +9412,14 @@
  		incr i 3
  	}
  	if {!$done} {
-		lappend content $data(v:status:pattern) [clock format [clock seconds]] $files
+		lappend content $data(v:status:pattern) [clock format [clock seconds] -format "%Y/%m/%d %H:%M"] $files
  	}

  	# write file
  	set out [open $data(v:rcfile) "w"]
  	foreach {p d f} $content {
  		# remove entries older than 6 months
-		if {[clock scan "6 months" -base [clock scan $d]] > [clock seconds]} {
+		if {[clock add [clock scan $d -format "%Y/%m/%d %H:%M"] 6 "months"] > [clock seconds]} {
  			puts $out "[list $p] [list $d] [list $f]\n"
  		}
  	}


-- 
Helmut Jarausch

Lehrstuhl fuer Numerische Mathematik
RWTH - Aachen University
D 52056 Aachen, Germany
0
jarausch (168)
7/31/2008 11:20:05 AM
Reply: