[Bug 205394] New: Make new Language module more error-resistant
![](https://seccdn.libravatar.org/avatar/3035b38ff33cf86f480bb169b8500b80.jpg?s=120&d=mm&r=g)
https://bugzilla.novell.com/show_bug.cgi?id=205394 Summary: Make new Language module more error-resistant Product: openSUSE 10.2 Version: Alpha 4 Platform: Other OS/Version: Other Status: NEW Severity: Enhancement Priority: P5 - None Component: YaST2 AssignedTo: jsuchome@novell.com ReportedBy: locilka@novell.com QAContact: jsrain@novell.com I've used the Language module for my own 'Alpha4+' ;) and because I haven't copied new languages definitions on the right place. SystemAgent.cc(Read):544 Can't access directory '/usr/share/YaST2/data/languages': No such file or directory' Language.ycp:144 Argument (/* any -> list <string> */SCR::Read (.target.dir, languages_directory, [])) to foreach(...) is nil Please, add a check for 'nil' there (or any other similar check). Thanks -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
![](https://seccdn.libravatar.org/avatar/3035b38ff33cf86f480bb169b8500b80.jpg?s=120&d=mm&r=g)
https://bugzilla.novell.com/show_bug.cgi?id=205394 ------- Comment #1 from locilka@novell.com 2006-09-13 03:54 MST ------- Created an attachment (id=98557) --> (https://bugzilla.novell.com/attachment.cgi?id=98557&action=view) y2log.gz -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
![](https://seccdn.libravatar.org/avatar/3035b38ff33cf86f480bb169b8500b80.jpg?s=120&d=mm&r=g)
https://bugzilla.novell.com/show_bug.cgi?id=205394 jsuchome@novell.com changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |INVALID ------- Comment #2 from jsuchome@novell.com 2006-09-13 04:35 MST ------- You have to use correct yast2-country package. I assume you got the empty map as a result anyway, not nil. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
![](https://seccdn.libravatar.org/avatar/3035b38ff33cf86f480bb169b8500b80.jpg?s=120&d=mm&r=g)
https://bugzilla.novell.com/show_bug.cgi?id=205394 ------- Comment #3 from locilka@novell.com 2006-09-13 05:32 MST ------- You cannot assume that everything is OK when loading data from SCR, it rather seems that the module internally expects that everything goes all right. On the other hand, if you don't care, just ignore it. --- this --- Language.ycp:144 Argument (/* any -> list <string> */SCR::Read (.target.dir, languages_directory, [])) to foreach(...) is nil is incorrect code, but if you don't care, I don't either... -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
![](https://seccdn.libravatar.org/avatar/3035b38ff33cf86f480bb169b8500b80.jpg?s=120&d=mm&r=g)
https://bugzilla.novell.com/show_bug.cgi?id=205394 ------- Comment #4 from jsuchome@novell.com 2006-09-13 05:37 MST -------
seems that the module internally expects that everything goes all right
Not really. Did you get wrong result from your function? The module just expects it is correctly installed, which is quite ususal expectation, I think. And even if you break your /usr/share/YaST2/data/languages directory manually, the function doesn't return wrong result. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
![](https://seccdn.libravatar.org/avatar/3035b38ff33cf86f480bb169b8500b80.jpg?s=120&d=mm&r=g)
https://bugzilla.novell.com/show_bug.cgi?id=205394 ------- Comment #5 from locilka@novell.com 2006-09-13 05:44 MST ------- It's always a matter of opinion :) ;) I'd say that if part of code reports "Argument ... to foreach(...) is nil", then it is a mistake, that this exception is not handled before. It doesn't matter than the function than returns correct data. The correct could be: .. = (...) SCR::Read() / SCR::Dir(); if (... == nil) y2error ("some error message"); else ... -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
participants (1)
-
bugzilla_noreply@novell.com