All of lore.kernel.org
 help / color / mirror / Atom feed
* python3 issues
@ 2019-03-25 22:20 YOUNG, MICHAEL A.
  2019-03-26  1:32 ` Elliott Mitchell
  2019-03-26 13:16 ` Wei Liu
  0 siblings, 2 replies; 15+ messages in thread
From: YOUNG, MICHAEL A. @ 2019-03-25 22:20 UTC (permalink / raw)
  To: xen-devel

[-- Attachment #1: Type: text/plain, Size: 513 bytes --]

I have been testing the python3 changes committed to xen and found a few 
issues. There are a couple of ocaml python build scripts that don't work 
for me with python3, and I needed a few fixes to get pygrub to work, 
mostly due to the change from strings to bytes. I am attaching the patch I 
put together in testing to get these things to work to illustrate where 
the problems are and in case it is useful to others, though I believe at 
least some of it isn't compatible with python2.

 	Michael Young

[-- Attachment #2: xen.python3.extra.patch --]
[-- Type: text/plain, Size: 5551 bytes --]

--- xen-4.12.0-rc5/tools/ocaml/libs/xentoollog/genlevels.py.orig	2019-03-06 14:42:49.000000000 +0000
+++ xen-4.12.0-rc5/tools/ocaml/libs/xentoollog/genlevels.py	2019-03-13 21:33:59.805930989 +0000
@@ -1,6 +1,7 @@
 #!/usr/bin/python
 
 import sys
+from functools import reduce
 
 def read_levels():
 	f = open('../../../libs/toollog/include/xentoollog.h', 'r')
@@ -86,14 +87,14 @@
 def autogen_header(open_comment, close_comment):
     s = open_comment + " AUTO-GENERATED FILE DO NOT EDIT " + close_comment + "\n"
     s += open_comment + " autogenerated by \n"
-    s += reduce(lambda x,y: x + " ", range(len(open_comment + " ")), "")
+    s += reduce(lambda x,y: x + " ", list(range(len(open_comment + " "))), "")
     s += "%s" % " ".join(sys.argv)
     s += "\n " + close_comment + "\n\n"
     return s
 
 if __name__ == '__main__':
 	if len(sys.argv) < 3:
-		print >>sys.stderr, "Usage: genlevels.py <mli> <ml> <c-inc>"
+		print("Usage: genlevels.py <mli> <ml> <c-inc>", file=sys.stderr)
 		sys.exit(1)
 
 	levels, olevels = read_levels()
--- xen-4.12.0-rc5/tools/ocaml/libs/xl/genwrap.py.orig	2019-03-06 14:42:49.000000000 +0000
+++ xen-4.12.0-rc5/tools/ocaml/libs/xl/genwrap.py	2019-03-13 21:34:00.674962832 +0000
@@ -3,6 +3,7 @@
 import sys,os
 
 import idl
+from functools import reduce
 
 # typename -> ( ocaml_type, c_from_ocaml, ocaml_from_c )
 builtins = {
@@ -78,7 +79,7 @@
     elif isinstance(ty,idl.Array):
         return "%s array" % ocaml_type_of(ty.elem_type)
     elif isinstance(ty,idl.Builtin):
-        if not builtins.has_key(ty.typename):
+        if ty.typename not in builtins:
             raise NotImplementedError("Unknown Builtin %s (%s)" % (ty.typename, type(ty)))
         typename,_,_ = builtins[ty.typename]
         if not typename:
@@ -251,7 +252,7 @@
             else:
                 s += "\texternal default : ctx -> %sunit -> t = \"stub_libxl_%s_init\"\n" % (union_args, ty.rawname)
 
-        if functions.has_key(ty.rawname):
+        if ty.rawname in functions:
             for name,args in functions[ty.rawname]:
                 s += "\texternal %s : " % name
                 s += " -> ".join(args)
@@ -278,7 +279,7 @@
         else:
             s += "%s = Int_val(%s);" % (c, o)
     elif isinstance(ty,idl.Builtin):
-        if not builtins.has_key(ty.typename):
+        if ty.typename not in builtins:
             raise NotImplementedError("Unknown Builtin %s (%s)" % (ty.typename, type(ty)))
         _,fn,_ = builtins[ty.typename]
         if not fn:
@@ -375,7 +376,7 @@
         else:
             s += "%s = Val_int(%s);" % (o, c)
     elif isinstance(ty,idl.Builtin):
-        if not builtins.has_key(ty.typename):
+        if ty.typename not in builtins:
             raise NotImplementedError("Unknown Builtin %s (%s)" % (ty.typename, type(ty)))
         _,_,fn = builtins[ty.typename]
         if not fn:
@@ -513,14 +514,14 @@
 def autogen_header(open_comment, close_comment):
     s = open_comment + " AUTO-GENERATED FILE DO NOT EDIT " + close_comment + "\n"
     s += open_comment + " autogenerated by \n"
-    s += reduce(lambda x,y: x + " ", range(len(open_comment + " ")), "")
+    s += reduce(lambda x,y: x + " ", list(range(len(open_comment + " "))), "")
     s += "%s" % " ".join(sys.argv)
     s += "\n " + close_comment + "\n\n"
     return s
 
 if __name__ == '__main__':
     if len(sys.argv) < 4:
-        print >>sys.stderr, "Usage: genwrap.py <idl> <mli> <ml> <c-inc>"
+        print("Usage: genwrap.py <idl> <mli> <ml> <c-inc>", file=sys.stderr)
         sys.exit(1)
 
     (_,types) = idl.parse(sys.argv[1])
@@ -533,7 +534,7 @@
 
     for t in blacklist:
         if t not in [ty.rawname for ty in types]:
-            print "unknown type %s in blacklist" % t
+            print("unknown type %s in blacklist" % t)
 
     types = [ty for ty in types if not ty.rawname in blacklist]
 
@@ -564,7 +565,7 @@
             cinc.write("\n")
         cinc.write(gen_Val_ocaml(ty))
         cinc.write("\n")
-        if functions.has_key(ty.rawname):
+        if ty.rawname in functions:
             cinc.write(gen_c_stub_prototype(ty, functions[ty.rawname]))
             cinc.write("\n")
         if ty.init_fn is not None:
--- xen-4.12.0-rc6/tools/pygrub/src/GrubConf.py.orig	2019-03-24 22:44:05.502581989 +0000
+++ xen-4.12.0-rc6/tools/pygrub/src/GrubConf.py	2019-03-24 22:49:14.025934786 +0000
@@ -230,10 +230,10 @@
     def _get_default(self):
         return self._default
     def _set_default(self, val):
-        if val == "saved":
+        if val == "saved" or not val.isdecimal():
             self._default = 0
         else:
-            self._default = val
+            self._default = int(val)
 
         if self._default < 0:
             raise ValueError("default must be positive number")
--- xen-4.12.0-rc6/tools/pygrub/src/pygrub.orig	2019-03-24 22:44:05.503582025 +0000
+++ xen-4.12.0-rc6/tools/pygrub/src/pygrub	2019-03-24 22:48:24.446113809 +0000
@@ -457,7 +457,7 @@
         # limit read size to avoid pathological cases
         buf = f.read(FS_READ_MAX)
         del f
-        self.cf.parse(buf)
+        self.cf.parse(buf.decode())
 
     def image_index(self):
         if isinstance(self.cf.default, int):
@@ -960,5 +960,5 @@
         ostring = format_simple(bootcfg["kernel"], bootcfg["ramdisk"], args, "\0")
 
     sys.stdout.flush()
-    os.write(fd, ostring)
+    os.write(fd, ostring.encode())
     

[-- Attachment #3: Type: text/plain, Size: 157 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: python3 issues
  2019-03-25 22:20 python3 issues YOUNG, MICHAEL A.
@ 2019-03-26  1:32 ` Elliott Mitchell
  2019-03-26 13:16 ` Wei Liu
  1 sibling, 0 replies; 15+ messages in thread
From: Elliott Mitchell @ 2019-03-26  1:32 UTC (permalink / raw)
  To: YOUNG, MICHAEL A.; +Cc: xen-devel

On Mon, Mar 25, 2019 at 10:20:05PM +0000, YOUNG, MICHAEL A. wrote:
> I have been testing the python3 changes committed to xen and found a few 
> issues. There are a couple of ocaml python build scripts that don't work 
> for me with python3, and I needed a few fixes to get pygrub to work, 
> mostly due to the change from strings to bytes. I am attaching the patch I 
> put together in testing to get these things to work to illustrate where 
> the problems are and in case it is useful to others, though I believe at 
> least some of it isn't compatible with python2.

Most Python code can be easily made compatible with both Python 2 and
Python 3 with the right constructs.


> --- xen-4.12.0-rc5/tools/ocaml/libs/xentoollog/genlevels.py.orig	2019-03-06 14:42:49.000000000 +0000
> +++ xen-4.12.0-rc5/tools/ocaml/libs/xentoollog/genlevels.py	2019-03-13 21:33:59.805930989 +0000
> @@ -86,14 +87,14 @@
>  def autogen_header(open_comment, close_comment):
>      s = open_comment + " AUTO-GENERATED FILE DO NOT EDIT " + close_comment + "\n"
>      s += open_comment + " autogenerated by \n"
> -    s += reduce(lambda x,y: x + " ", range(len(open_comment + " ")), "")
> +    s += reduce(lambda x,y: x + " ", list(range(len(open_comment + " "))), "")
>      s += "%s" % " ".join(sys.argv)
>      s += "\n " + close_comment + "\n\n"
>      return s
>  
>  if __name__ == '__main__':
>  	if len(sys.argv) < 3:
> -		print >>sys.stderr, "Usage: genlevels.py <mli> <ml> <c-inc>"
> +		print("Usage: genlevels.py <mli> <ml> <c-inc>", file=sys.stderr)
>  		sys.exit(1)
>  
>  	levels, olevels = read_levels()

The print() function notation is required for Python 3, but has a bit of
trouble with Python 2.  Python 2 though does have support.  At the top of
the relevant files add "from __future__ import print_function" and the
print() will work in Python 2.  I'm unsure of the status of the other
constructs in this patch.


-- 
(\___(\___(\______          --=> 8-) EHM <=--          ______/)___/)___/)
 \BS (    |         ehem+sigmsg@m5p.com  PGP 87145445         |    )   /
  \_CS\   |  _____  -O #include <stddisclaimer.h> O-   _____  |   /  _/
8A19\___\_|_/58D2 7E3D DDF4 7BA6 <-PGP-> 41D1 B375 37D0 8714\_|_/___/5445



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: python3 issues
  2019-03-25 22:20 python3 issues YOUNG, MICHAEL A.
  2019-03-26  1:32 ` Elliott Mitchell
@ 2019-03-26 13:16 ` Wei Liu
  2019-03-26 13:43   ` Wei Liu
  2019-03-27  0:36   ` Hans van Kranenburg
  1 sibling, 2 replies; 15+ messages in thread
From: Wei Liu @ 2019-03-26 13:16 UTC (permalink / raw)
  To: YOUNG, MICHAEL A.; +Cc: xen-devel, Wei Liu

On Mon, Mar 25, 2019 at 10:20:05PM +0000, YOUNG, MICHAEL A. wrote:
> I have been testing the python3 changes committed to xen and found a few 
> issues. There are a couple of ocaml python build scripts that don't work 
> for me with python3, and I needed a few fixes to get pygrub to work, 
> mostly due to the change from strings to bytes. I am attaching the patch I 
> put together in testing to get these things to work to illustrate where 
> the problems are and in case it is useful to others, though I believe at 
> least some of it isn't compatible with python2.

My fault. Somehow all my local testing and project's CIs failed to catch
these files.

Thanks for fixing these.  I will turn it into a proper patch, put your
SoB there and submit it.

> 
>  	Michael Young

> --- xen-4.12.0-rc5/tools/ocaml/libs/xentoollog/genlevels.py.orig	2019-03-06 14:42:49.000000000 +0000
> +++ xen-4.12.0-rc5/tools/ocaml/libs/xentoollog/genlevels.py	2019-03-13 21:33:59.805930989 +0000
> @@ -1,6 +1,7 @@
>  #!/usr/bin/python
>  
>  import sys
> +from functools import reduce

We should have from __future__ import print_function here to be python2
compatible.

>  
>  def read_levels():
>  	f = open('../../../libs/toollog/include/xentoollog.h', 'r')
> @@ -86,14 +87,14 @@
>  def autogen_header(open_comment, close_comment):
>      s = open_comment + " AUTO-GENERATED FILE DO NOT EDIT " + close_comment + "\n"
>      s += open_comment + " autogenerated by \n"
> -    s += reduce(lambda x,y: x + " ", range(len(open_comment + " ")), "")
> +    s += reduce(lambda x,y: x + " ", list(range(len(open_comment + " "))), "")

I don't think list is required here. reduce should work with generator
just fine.

>      s += "%s" % " ".join(sys.argv)
>      s += "\n " + close_comment + "\n\n"
>      return s
>  
>  if __name__ == '__main__':
>  	if len(sys.argv) < 3:
> -		print >>sys.stderr, "Usage: genlevels.py <mli> <ml> <c-inc>"
> +		print("Usage: genlevels.py <mli> <ml> <c-inc>", file=sys.stderr)
>  		sys.exit(1)
>  
>  	levels, olevels = read_levels()
> --- xen-4.12.0-rc5/tools/ocaml/libs/xl/genwrap.py.orig	2019-03-06 14:42:49.000000000 +0000
> +++ xen-4.12.0-rc5/tools/ocaml/libs/xl/genwrap.py	2019-03-13 21:34:00.674962832 +0000
> @@ -3,6 +3,7 @@
>  import sys,os
>  
>  import idl
> +from functools import reduce

Same here as above.
>          if ty.init_fn is not None:
> --- xen-4.12.0-rc6/tools/pygrub/src/GrubConf.py.orig	2019-03-24 22:44:05.502581989 +0000
> +++ xen-4.12.0-rc6/tools/pygrub/src/GrubConf.py	2019-03-24 22:49:14.025934786 +0000
> @@ -230,10 +230,10 @@
>      def _get_default(self):
>          return self._default
>      def _set_default(self, val):
> -        if val == "saved":
> +        if val == "saved" or not val.isdecimal():
>              self._default = 0
>          else:
> -            self._default = val
> +            self._default = int(val)
>  
>          if self._default < 0:
>              raise ValueError("default must be positive number")
> --- xen-4.12.0-rc6/tools/pygrub/src/pygrub.orig	2019-03-24 22:44:05.503582025 +0000
> +++ xen-4.12.0-rc6/tools/pygrub/src/pygrub	2019-03-24 22:48:24.446113809 +0000
> @@ -457,7 +457,7 @@
>          # limit read size to avoid pathological cases
>          buf = f.read(FS_READ_MAX)
>          del f
> -        self.cf.parse(buf)
> +        self.cf.parse(buf.decode())

Hmm... This could be a bit problematic for 2 compatibility. I will need
some time to check the documents.

Wei.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: python3 issues
  2019-03-26 13:16 ` Wei Liu
@ 2019-03-26 13:43   ` Wei Liu
  2019-03-26 18:18     ` M A Young
  2019-03-27  0:36   ` Hans van Kranenburg
  1 sibling, 1 reply; 15+ messages in thread
From: Wei Liu @ 2019-03-26 13:43 UTC (permalink / raw)
  To: YOUNG, MICHAEL A.; +Cc: xen-devel, Wei Liu

On Tue, Mar 26, 2019 at 01:16:35PM +0000, Wei Liu wrote:
> On Mon, Mar 25, 2019 at 10:20:05PM +0000, YOUNG, MICHAEL A. wrote:
> >          if ty.init_fn is not None:
> > --- xen-4.12.0-rc6/tools/pygrub/src/GrubConf.py.orig	2019-03-24 22:44:05.502581989 +0000
> > +++ xen-4.12.0-rc6/tools/pygrub/src/GrubConf.py	2019-03-24 22:49:14.025934786 +0000
> > @@ -230,10 +230,10 @@
> >      def _get_default(self):
> >          return self._default
> >      def _set_default(self, val):
> > -        if val == "saved":
> > +        if val == "saved" or not val.isdecimal():

Your change suggested there could be a non-decimal string that is not
"saved" -- is this really needed?

Wei.

> >              self._default = 0
> >          else:
> > -            self._default = val
> > +            self._default = int(val)

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: python3 issues
  2019-03-26 13:43   ` Wei Liu
@ 2019-03-26 18:18     ` M A Young
  2019-03-26 21:06       ` Hans van Kranenburg
  0 siblings, 1 reply; 15+ messages in thread
From: M A Young @ 2019-03-26 18:18 UTC (permalink / raw)
  To: Wei Liu; +Cc: xen-devel

On Tue, 26 Mar 2019, Wei Liu wrote:

> On Tue, Mar 26, 2019 at 01:16:35PM +0000, Wei Liu wrote:
> > On Mon, Mar 25, 2019 at 10:20:05PM +0000, YOUNG, MICHAEL A. wrote:
> > >          if ty.init_fn is not None:
> > > --- xen-4.12.0-rc6/tools/pygrub/src/GrubConf.py.orig	2019-03-24 22:44:05.502581989 +0000
> > > +++ xen-4.12.0-rc6/tools/pygrub/src/GrubConf.py	2019-03-24 22:49:14.025934786 +0000
> > > @@ -230,10 +230,10 @@
> > >      def _get_default(self):
> > >          return self._default
> > >      def _set_default(self, val):
> > > -        if val == "saved":
> > > +        if val == "saved" or not val.isdecimal():
> 
> Your change suggested there could be a non-decimal string that is not
> "saved" -- is this really needed?

It is getting set to ${next_entry} presumably from the clause 

if [ "${next_entry}" ] ; then
   set default="${next_entry}"
   set next_entry=
   save_env next_entry
   set boot_once=true
else
   set default="${saved_entry}"
fi

in the grub.cfg file giving the error

  File "/usr/lib64/python3.7/site-packages/grub/GrubConf.py", line 239, in 
_set_default
    if self._default < 0:
TypeError: '<' not supported between instances of 'str' and 'int'

I didn't see this with python 2 before the patch so I assume python3 is 
more fussy.

	Michael Young

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: python3 issues
  2019-03-26 18:18     ` M A Young
@ 2019-03-26 21:06       ` Hans van Kranenburg
  2019-04-01  9:18         ` Wei Liu
  2019-04-01  9:42         ` Wei Liu
  0 siblings, 2 replies; 15+ messages in thread
From: Hans van Kranenburg @ 2019-03-26 21:06 UTC (permalink / raw)
  To: M A Young, Wei Liu; +Cc: xen-devel

On 3/26/19 7:18 PM, M A Young wrote:
> On Tue, 26 Mar 2019, Wei Liu wrote:
> 
>> On Tue, Mar 26, 2019 at 01:16:35PM +0000, Wei Liu wrote:
>>> On Mon, Mar 25, 2019 at 10:20:05PM +0000, YOUNG, MICHAEL A. wrote:
>>>>          if ty.init_fn is not None:
>>>> --- xen-4.12.0-rc6/tools/pygrub/src/GrubConf.py.orig	2019-03-24 22:44:05.502581989 +0000
>>>> +++ xen-4.12.0-rc6/tools/pygrub/src/GrubConf.py	2019-03-24 22:49:14.025934786 +0000
>>>> @@ -230,10 +230,10 @@
>>>>      def _get_default(self):
>>>>          return self._default
>>>>      def _set_default(self, val):
>>>> -        if val == "saved":
>>>> +        if val == "saved" or not val.isdecimal():
>>
>> Your change suggested there could be a non-decimal string that is not
>> "saved" -- is this really needed?
> 
> It is getting set to ${next_entry} presumably from the clause 
> 
> if [ "${next_entry}" ] ; then
>    set default="${next_entry}"
>    set next_entry=
>    save_env next_entry
>    set boot_once=true
> else
>    set default="${saved_entry}"
> fi
> 
> in the grub.cfg file giving the error
> 
>   File "/usr/lib64/python3.7/site-packages/grub/GrubConf.py", line 239, in 
> _set_default
>     if self._default < 0:
> TypeError: '<' not supported between instances of 'str' and 'int'
> 
> I didn't see this with python 2 before the patch so I assume python3 is 
> more fussy.

Comparison is also used for sorting.

In Python 2, numeric values always sort before strings. So, for example:

== sorted(['a','b','c', 1, 2, 3])
[1, 2, 3, 'a', 'b', 'c']

However, this behavior also easily leads to bugs, for example when
someone forgets to convert strings that hold numeric values to actual
numbers and still compares things, which silently introduces unintended
behavior.

So, the above if self._default < 0 will just always be False if
self._default is a string. I didn't read the context of these lines, but
this looks like an actual bug currently.

Python 3 no longer allows comparing string and int, because it doesn't
make sense.

== sorted([1,2,3,'a','b','c'])
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: unorderable types: str() < int()

So I guess that if the contents are expected to be "saved" or a number
as string like "1", "2", then:

1. check for "saved"
2. try: int(val) except: blah
3. etc

Also, python 2 does not have isdecimal() on strings.

Hans

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: python3 issues
  2019-03-26 13:16 ` Wei Liu
  2019-03-26 13:43   ` Wei Liu
@ 2019-03-27  0:36   ` Hans van Kranenburg
  2019-04-01 10:04     ` Wei Liu
  1 sibling, 1 reply; 15+ messages in thread
From: Hans van Kranenburg @ 2019-03-27  0:36 UTC (permalink / raw)
  To: Wei Liu, YOUNG, MICHAEL A.; +Cc: xen-devel

On 3/26/19 2:16 PM, Wei Liu wrote:
> On Mon, Mar 25, 2019 at 10:20:05PM +0000, YOUNG, MICHAEL A. wrote:
>> [...]
>> --- xen-4.12.0-rc6/tools/pygrub/src/pygrub.orig	2019-03-24 22:44:05.503582025 +0000
>> +++ xen-4.12.0-rc6/tools/pygrub/src/pygrub	2019-03-24 22:48:24.446113809 +0000
>> @@ -457,7 +457,7 @@
>>          # limit read size to avoid pathological cases
>>          buf = f.read(FS_READ_MAX)
>>          del f
>> -        self.cf.parse(buf)
>> +        self.cf.parse(buf.decode())
> 
> Hmm... This could be a bit problematic for 2 compatibility. I will need
> some time to check the documents.

The exact moment when you're typing .decode() or .encode() to try fix a
python2/3 problem, you're entering a world of pain (tm).

[insert big lebowski walter pointing gun gif here]

Some of the python 2 and 3 compatibility things can be fixed easily by
importing things from the future, but when dealing with strings and
bytes, you're entering the "is it really worth it" department.

In python 2, strings are bytes, and there's some added duct tape
available to do something with unicode and utf-8.

In python 3, strings are unicode and bytes are bytes, which is sooooooo
much more convenient. If the strings have to be stored in some location
that stores bytes, you can encode them. If you have some incoming byte
stream, you can decode it.

I don't really have recommendations to make both of them work with the
same lines of code since I tried and gave up when doing it myself.

What you're looking at is how the in-memory storage for a 'string' is
done and how to connect input and output to that, while looking at
python 2 and 3 functions with the same name, doing different things in
a different context. There is no sane way to do this that works with
python 2 and 3.

Hans

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: python3 issues
  2019-03-26 21:06       ` Hans van Kranenburg
@ 2019-04-01  9:18         ` Wei Liu
  2019-04-01  9:42         ` Wei Liu
  1 sibling, 0 replies; 15+ messages in thread
From: Wei Liu @ 2019-04-01  9:18 UTC (permalink / raw)
  To: Hans van Kranenburg; +Cc: xen-devel, Wei Liu, M A Young

On Tue, Mar 26, 2019 at 10:06:48PM +0100, Hans van Kranenburg wrote:
> On 3/26/19 7:18 PM, M A Young wrote:
> > On Tue, 26 Mar 2019, Wei Liu wrote:
> > 
> >> On Tue, Mar 26, 2019 at 01:16:35PM +0000, Wei Liu wrote:
> >>> On Mon, Mar 25, 2019 at 10:20:05PM +0000, YOUNG, MICHAEL A. wrote:
> >>>>          if ty.init_fn is not None:
> >>>> --- xen-4.12.0-rc6/tools/pygrub/src/GrubConf.py.orig	2019-03-24 22:44:05.502581989 +0000
> >>>> +++ xen-4.12.0-rc6/tools/pygrub/src/GrubConf.py	2019-03-24 22:49:14.025934786 +0000
> >>>> @@ -230,10 +230,10 @@
> >>>>      def _get_default(self):
> >>>>          return self._default
> >>>>      def _set_default(self, val):
> >>>> -        if val == "saved":
> >>>> +        if val == "saved" or not val.isdecimal():
> >>
> >> Your change suggested there could be a non-decimal string that is not
> >> "saved" -- is this really needed?
> > 
> > It is getting set to ${next_entry} presumably from the clause 
> > 
> > if [ "${next_entry}" ] ; then
> >    set default="${next_entry}"
> >    set next_entry=
> >    save_env next_entry
> >    set boot_once=true
> > else
> >    set default="${saved_entry}"
> > fi
> > 
> > in the grub.cfg file giving the error
> > 
> >   File "/usr/lib64/python3.7/site-packages/grub/GrubConf.py", line 239, in 
> > _set_default
> >     if self._default < 0:
> > TypeError: '<' not supported between instances of 'str' and 'int'
> > 
> > I didn't see this with python 2 before the patch so I assume python3 is 
> > more fussy.
> 
> Comparison is also used for sorting.
> 
> In Python 2, numeric values always sort before strings. So, for example:
> 
> == sorted(['a','b','c', 1, 2, 3])
> [1, 2, 3, 'a', 'b', 'c']
> 
> However, this behavior also easily leads to bugs, for example when
> someone forgets to convert strings that hold numeric values to actual
> numbers and still compares things, which silently introduces unintended
> behavior.
> 
> So, the above if self._default < 0 will just always be False if
> self._default is a string. I didn't read the context of these lines, but
> this looks like an actual bug currently.
> 
> Python 3 no longer allows comparing string and int, because it doesn't
> make sense.
> 
> == sorted([1,2,3,'a','b','c'])
> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
> TypeError: unorderable types: str() < int()

Thanks for the detailed explanation!

I think the original behaviour is not very nice. Python lacking type
annotation doesn't help either.

> 
> So I guess that if the contents are expected to be "saved" or a number
> as string like "1", "2", then:
> 
> 1. check for "saved"
> 2. try: int(val) except: blah
> 3. etc

I think a better way is to use string conversation all the way -- it
doesn't make sense for an API to return string sometimes and integers
sometimes. I will give it a stab.

Wei.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: python3 issues
  2019-03-26 21:06       ` Hans van Kranenburg
  2019-04-01  9:18         ` Wei Liu
@ 2019-04-01  9:42         ` Wei Liu
  2019-04-01  9:59           ` M A Young
  1 sibling, 1 reply; 15+ messages in thread
From: Wei Liu @ 2019-04-01  9:42 UTC (permalink / raw)
  To: Hans van Kranenburg; +Cc: xen-devel, Wei Liu, M A Young

On Tue, Mar 26, 2019 at 10:06:48PM +0100, Hans van Kranenburg wrote:
> 
> Python 3 no longer allows comparing string and int, because it doesn't
> make sense.
> 
> == sorted([1,2,3,'a','b','c'])
> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
> TypeError: unorderable types: str() < int()
> 
> So I guess that if the contents are expected to be "saved" or a number
> as string like "1", "2", then:
> 
> 1. check for "saved"
> 2. try: int(val) except: blah
> 3. etc
> 

Actually I think you scheme here is better. Relying on string comparison
seems to be error-prone.

Wei.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: python3 issues
  2019-04-01  9:42         ` Wei Liu
@ 2019-04-01  9:59           ` M A Young
  2019-04-01 10:01             ` Wei Liu
  0 siblings, 1 reply; 15+ messages in thread
From: M A Young @ 2019-04-01  9:59 UTC (permalink / raw)
  To: Wei Liu; +Cc: Hans van Kranenburg, xen-devel



On Mon, 1 Apr 2019, Wei Liu wrote:

> On Tue, Mar 26, 2019 at 10:06:48PM +0100, Hans van Kranenburg wrote:
> > 
> > Python 3 no longer allows comparing string and int, because it doesn't
> > make sense.
> > 
> > == sorted([1,2,3,'a','b','c'])
> > Traceback (most recent call last):
> >   File "<stdin>", line 1, in <module>
> > TypeError: unorderable types: str() < int()
> > 
> > So I guess that if the contents are expected to be "saved" or a number
> > as string like "1", "2", then:
> > 
> > 1. check for "saved"
> > 2. try: int(val) except: blah
> > 3. etc
> > 
> 
> Actually I think you scheme here is better. Relying on string comparison
> seems to be error-prone.
> 
> Wei.

I tested with the patch

--- xen-4.12.0-rc6/tools/pygrub/src/GrubConf.py.orig	2019-03-24 
22:44:05.502581989 +0000
+++ xen-4.12.0-rc6/tools/pygrub/src/GrubConf.py	2019-03-24 
22:49:14.025934786 +0000
@@ -233,7 +233,10 @@
         if val == "saved":
             self._default = 0
         else:
-            self._default = val
+            try:
+                self._default = int(val)
+            except ValueError:
+                self._default = 0
 
         if self._default < 0:
             raise ValueError("default must be positive number")

which works for me but should probably have some logging added for debug 
purposes.

	Michael Young

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: python3 issues
  2019-04-01  9:59           ` M A Young
@ 2019-04-01 10:01             ` Wei Liu
  0 siblings, 0 replies; 15+ messages in thread
From: Wei Liu @ 2019-04-01 10:01 UTC (permalink / raw)
  To: M A Young; +Cc: Hans van Kranenburg, xen-devel, Wei Liu

On Mon, Apr 01, 2019 at 10:59:05AM +0100, M A Young wrote:
> 
> 
> On Mon, 1 Apr 2019, Wei Liu wrote:
> 
> > On Tue, Mar 26, 2019 at 10:06:48PM +0100, Hans van Kranenburg wrote:
> > > 
> > > Python 3 no longer allows comparing string and int, because it doesn't
> > > make sense.
> > > 
> > > == sorted([1,2,3,'a','b','c'])
> > > Traceback (most recent call last):
> > >   File "<stdin>", line 1, in <module>
> > > TypeError: unorderable types: str() < int()
> > > 
> > > So I guess that if the contents are expected to be "saved" or a number
> > > as string like "1", "2", then:
> > > 
> > > 1. check for "saved"
> > > 2. try: int(val) except: blah
> > > 3. etc
> > > 
> > 
> > Actually I think you scheme here is better. Relying on string comparison
> > seems to be error-prone.
> > 
> > Wei.
> 
> I tested with the patch
> 
> --- xen-4.12.0-rc6/tools/pygrub/src/GrubConf.py.orig	2019-03-24 
> 22:44:05.502581989 +0000
> +++ xen-4.12.0-rc6/tools/pygrub/src/GrubConf.py	2019-03-24 
> 22:49:14.025934786 +0000
> @@ -233,7 +233,10 @@
>          if val == "saved":
>              self._default = 0
>          else:
> -            self._default = val
> +            try:
> +                self._default = int(val)
> +            except ValueError:
> +                self._default = 0
>  
>          if self._default < 0:
>              raise ValueError("default must be positive number")
> 
> which works for me but should probably have some logging added for debug 
> purposes.


Ha, I have the exact same snippet in my patch. :-)

Wei.

> 
> 	Michael Young

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: python3 issues
  2019-03-27  0:36   ` Hans van Kranenburg
@ 2019-04-01 10:04     ` Wei Liu
  0 siblings, 0 replies; 15+ messages in thread
From: Wei Liu @ 2019-04-01 10:04 UTC (permalink / raw)
  To: Hans van Kranenburg; +Cc: xen-devel, Wei Liu, YOUNG, MICHAEL A.

On Wed, Mar 27, 2019 at 01:36:10AM +0100, Hans van Kranenburg wrote:
> On 3/26/19 2:16 PM, Wei Liu wrote:
> > On Mon, Mar 25, 2019 at 10:20:05PM +0000, YOUNG, MICHAEL A. wrote:
> >> [...]
> >> --- xen-4.12.0-rc6/tools/pygrub/src/pygrub.orig	2019-03-24 22:44:05.503582025 +0000
> >> +++ xen-4.12.0-rc6/tools/pygrub/src/pygrub	2019-03-24 22:48:24.446113809 +0000
> >> @@ -457,7 +457,7 @@
> >>          # limit read size to avoid pathological cases
> >>          buf = f.read(FS_READ_MAX)
> >>          del f
> >> -        self.cf.parse(buf)
> >> +        self.cf.parse(buf.decode())
> > 
> > Hmm... This could be a bit problematic for 2 compatibility. I will need
> > some time to check the documents.
> 
> The exact moment when you're typing .decode() or .encode() to try fix a
> python2/3 problem, you're entering a world of pain (tm).
> 
> [insert big lebowski walter pointing gun gif here]
> 
> Some of the python 2 and 3 compatibility things can be fixed easily by
> importing things from the future, but when dealing with strings and
> bytes, you're entering the "is it really worth it" department.
> 
> In python 2, strings are bytes, and there's some added duct tape
> available to do something with unicode and utf-8.
> 
> In python 3, strings are unicode and bytes are bytes, which is sooooooo
> much more convenient. If the strings have to be stored in some location
> that stores bytes, you can encode them. If you have some incoming byte
> stream, you can decode it.
> 
> I don't really have recommendations to make both of them work with the
> same lines of code since I tried and gave up when doing it myself.
> 
> What you're looking at is how the in-memory storage for a 'string' is
> done and how to connect input and output to that, while looking at
> python 2 and 3 functions with the same name, doing different things in
> a different context. There is no sane way to do this that works with
> python 2 and 3.

I have tested the following snippet:

    from __future__ import print_function
    import sys
    
    
    s = b'1234'
    if sys.version_info[0] < 3:
        print(s) 
    else:
        print(s.decode())

It seems to be the easiest way to solve this issue.

Wei.

> 
> Hans

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: python3 issues
  2016-06-03 14:15 ` Smith, Elliot
@ 2016-06-03 16:45   ` Smith, Elliot
  0 siblings, 0 replies; 15+ messages in thread
From: Smith, Elliot @ 2016-06-03 16:45 UTC (permalink / raw)
  To: Barros Pena, Belen; +Cc: Avery, Brian, Bartosh, Eduard, toaster

[-- Attachment #1: Type: text/plain, Size: 4236 bytes --]

Quick update on progress.

I have fixed the 'k' issue, got the tests running again, and fixed the
table filters. My work is here:

elliot/toaster/python3

NB this is a branch from master, rather than toaster-next, though I think
my work shouldn't clash with toaster-next too much (fingers crossed).

However, I am seeing build failures which look like this:

NOTE: Preparing RunQueue
NOTE: Logging error 2: {'pathname':
'/home/ell/dev/toaster/poky/_toaster_clones/_git_git.yoctoproject.org_poky_master/bitbake/lib/bb/runqueue.py',
'lineno': 1202, 'message': 'An uncaught exception occured in runqueue,
please see the failure below:', 'build': <Build: 1 Project object
core-image-minimal>, 'level': 2}
ERROR: An uncaught exception occured in runqueue, please see the failure
below:

I haven't been able to track this down, but I'm not sure it's related to
Python 3 changes. It could be, but my guess is it's something screwed up in
my environment.

(I also had an earlier build failure because the python pygobject recipe
was referred to incorrectly somewhere (python rather than python3), so the
recipe couldn't be found; I put this down to something in my sstate-cache
and tried another build, which resulted in the above.)

I'll continue investigating the image file download next week, once I get
an image build which works correctly.

I couldn't reproduce the issue where the in progress builds show in the
project builds table, though.

Elliot

On 3 June 2016 at 15:15, Smith, Elliot <elliot.smith@intel.com> wrote:

> I've been testing this branch; notes below.
>
> On 2 June 2016 at 17:31, Barros Pena, Belen <belen.barros.pena@intel.com>
> wrote:
>
>> I was asked to look at the branch that makes sure Toaster works with
>> python 3
>>
>>
>> http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=ed/oe/python3
>>
>> I've found a few issues. I am not a 100% sure if they are this branch only
>> or if they also happen in master (python3 changes apparently have been
>> merged), but I thought I'd share early. Here comes the list:
>>
>
> I'm working on master, which includes these changes (Ed's branch has
> diverged from master slightly, but the important commits match between
> them).
>
>
>>
>> * We need to remove old releases from toasterconf.json, since the change
>> to Python 3 means we can no longer support those. Ed is already on the
>> case, I believe
>>
>
> I've supplied patches for this to the appropriate mailing lists. I also
> did patches for the krogoth and jethro branches to remove master from the
> releases.
>
>
>> * Image artifact downloads don't seem to be working (all other artifacts
>> are fine)
>>
>
> I haven't had a chance to test this yet, but will.
>
>
>> * Filters in the tasks page (build information) don't seem to be working.
>> All of them return an error
>>
>
> I also see this error ("Exception Value: name 'k' is not defined"). I'll
> have a look this afternoon.
>
> * The variables table returns an error
>>
>
> Note that this is the same 'k' error as for the tasks page.
>
> * In the custom image details page, the add | remove filter is not
>> working: the filtering does not happen
>>
>
> This is the same 'k' error again.
>
>
>> * The all projects table is showing builds in progress information (builds
>> in progress information should not appear in any tables)
>>
>
> I haven't seen this (yet). I'll keep testing and see if it crops up.
>
>
>> * My builds for custom images don't seem to be working. I start them, but
>> I never see any progress in the UI. The toaster_ui.log doesn't show them
>> at all, so I am kind of confused.
>>
>
> I haven't tried this yet, but will.
>
> Note that the tests need a small fix, as the version of Selenium I got
> when I used Python3 pip was different. We don't have this in
> toaster-requirements.txt, as it's only required for running the tests, but
> we should perhaps change the instructions to fix Selenium to a known
> version, too.
>
> Elliot
> --
> Elliot Smith
> Software Engineer
> Intel Open Source Technology Centre
>



-- 
Elliot Smith
Software Engineer
Intel Open Source Technology Centre

[-- Attachment #2: Type: text/html, Size: 7492 bytes --]

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: python3 issues
  2016-06-02 16:31 Barros Pena, Belen
@ 2016-06-03 14:15 ` Smith, Elliot
  2016-06-03 16:45   ` Smith, Elliot
  0 siblings, 1 reply; 15+ messages in thread
From: Smith, Elliot @ 2016-06-03 14:15 UTC (permalink / raw)
  To: Barros Pena, Belen; +Cc: Avery, Brian, Bartosh, Eduard, toaster

[-- Attachment #1: Type: text/plain, Size: 2477 bytes --]

I've been testing this branch; notes below.

On 2 June 2016 at 17:31, Barros Pena, Belen <belen.barros.pena@intel.com>
wrote:

> I was asked to look at the branch that makes sure Toaster works with
> python 3
>
> http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=ed/oe/python3
>
> I've found a few issues. I am not a 100% sure if they are this branch only
> or if they also happen in master (python3 changes apparently have been
> merged), but I thought I'd share early. Here comes the list:
>

I'm working on master, which includes these changes (Ed's branch has
diverged from master slightly, but the important commits match between
them).


>
> * We need to remove old releases from toasterconf.json, since the change
> to Python 3 means we can no longer support those. Ed is already on the
> case, I believe
>

I've supplied patches for this to the appropriate mailing lists. I also did
patches for the krogoth and jethro branches to remove master from the
releases.


> * Image artifact downloads don't seem to be working (all other artifacts
> are fine)
>

I haven't had a chance to test this yet, but will.


> * Filters in the tasks page (build information) don't seem to be working.
> All of them return an error
>

I also see this error ("Exception Value: name 'k' is not defined"). I'll
have a look this afternoon.

* The variables table returns an error
>

Note that this is the same 'k' error as for the tasks page.

* In the custom image details page, the add | remove filter is not
> working: the filtering does not happen
>

This is the same 'k' error again.


> * The all projects table is showing builds in progress information (builds
> in progress information should not appear in any tables)
>

I haven't seen this (yet). I'll keep testing and see if it crops up.


> * My builds for custom images don't seem to be working. I start them, but
> I never see any progress in the UI. The toaster_ui.log doesn't show them
> at all, so I am kind of confused.
>

I haven't tried this yet, but will.

Note that the tests need a small fix, as the version of Selenium I got when
I used Python3 pip was different. We don't have this in
toaster-requirements.txt, as it's only required for running the tests, but
we should perhaps change the instructions to fix Selenium to a known
version, too.

Elliot
-- 
Elliot Smith
Software Engineer
Intel Open Source Technology Centre

[-- Attachment #2: Type: text/html, Size: 4751 bytes --]

^ permalink raw reply	[flat|nested] 15+ messages in thread

* python3 issues
@ 2016-06-02 16:31 Barros Pena, Belen
  2016-06-03 14:15 ` Smith, Elliot
  0 siblings, 1 reply; 15+ messages in thread
From: Barros Pena, Belen @ 2016-06-02 16:31 UTC (permalink / raw)
  To: toaster; +Cc: Avery, Brian, Bartosh, Eduard

I was asked to look at the branch that makes sure Toaster works with
python 3

http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=ed/oe/python3

I've found a few issues. I am not a 100% sure if they are this branch only
or if they also happen in master (python3 changes apparently have been
merged), but I thought I'd share early. Here comes the list:

* We need to remove old releases from toasterconf.json, since the change
to Python 3 means we can no longer support those. Ed is already on the
case, I believe

* Image artifact downloads don't seem to be working (all other artifacts
are fine)

Environment:


Request Method: GET
Request URL: 
http://icarus.isw.intel.com:8000/toastergui/build/4/artifact/imagefile/id/1

Django Version: 1.8.13
Python Version: 3.4.3
Installed Applications:
('django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.messages',
 'django.contrib.sessions',
 'django.contrib.admin',
 'django.contrib.staticfiles',
 'django.contrib.humanize',
 'bldcollector',
 'toastermain',
 'bldcontrol',
 'orm',
 'toastergui')
Installed Middleware:
('django.middleware.common.CommonMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware')


Traceback:
File 
"/home/belen/.local/lib/python3.4/site-packages/django/core/handlers/base.p
y" in get_response
  132.                     response = wrapped_callback(request,
*callback_args, **callback_kwargs)
File "/home/belen/toaster-python3/bitbake/lib/toaster/toastergui/views.py"
in build_artifact
  2991.                 response = HttpResponse(fsock, content_type =
content_type)
File 
"/home/belen/.local/lib/python3.4/site-packages/django/http/response.py"
in __init__
  342.         self.content = content
File 
"/home/belen/.local/lib/python3.4/site-packages/django/http/response.py"
in content
  363.             value = b''.join(self.make_bytes(chunk) for chunk in
value)
File 
"/home/belen/.local/lib/python3.4/site-packages/django/http/response.py"
in <genexpr>
  363.             value = b''.join(self.make_bytes(chunk) for chunk in
value)
File "/usr/lib/python3.4/codecs.py" in decode
  319.         (result, consumed) = self._buffer_decode(data, self.errors,
final)

Exception Type: UnicodeDecodeError at
/toastergui/build/4/artifact/imagefile/id/1
Exception Value: 'utf-8' codec can't decode byte 0xdb in position 1032:
invalid continuation byte

==============================================================

* Filters in the tasks page (build information) don't seem to be working.
All of them return an error

Environment:


Request Method: GET
Request URL: 
http://icarus.isw.intel.com:8000/toastergui/build/4/tasks/?orderby=order%3A
%2B&count=25&filter=task_executed%3A1&page=1&search=

Django Version: 1.8.13
Python Version: 3.4.3
Installed Applications:
('django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.messages',
 'django.contrib.sessions',
 'django.contrib.admin',
 'django.contrib.staticfiles',
 'django.contrib.humanize',
 'bldcollector',
 'toastermain',
 'bldcontrol',
 'orm',
 'toastergui')
Installed Middleware:
('django.middleware.common.CommonMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware')


Traceback:
File 
"/home/belen/.local/lib/python3.4/site-packages/django/core/handlers/base.p
y" in get_response
  132.                     response = wrapped_callback(request,
*callback_args, **callback_kwargs)
File "/home/belen/toaster-python3/bitbake/lib/toaster/toastergui/views.py"
in tasks
  1263.     return tasks_common(request, build_id, 'tasks', '')
File "/home/belen/toaster-python3/bitbake/lib/toaster/toastergui/views.py"
in tasks_common
  1066.         queryset = _get_queryset(Task, queryset_all,
filter_string, search_term, ordering_string, 'order')
File "/home/belen/toaster-python3/bitbake/lib/toaster/toastergui/views.py"
in _get_queryset
  354.         filter_query = _get_filtering_query(filter_string)
File "/home/belen/toaster-python3/bitbake/lib/toaster/toastergui/views.py"
in _get_filtering_query
  271.             x = __get_q_for_val(k, val)

Exception Type: NameError at /toastergui/build/4/tasks/
Exception Value: name 'k' is not defined

========================================================


* The variables table returns an error

Environment:


Request Method: GET
Request URL: 
http://icarus.isw.intel.com:8000/toastergui/build/4/configvars?orderby=vari
able_name%3A%2B&page=1&filter=description__regex%3A.%2B&count=100

Django Version: 1.8.13
Python Version: 3.4.3
Installed Applications:
('django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.messages',
 'django.contrib.sessions',
 'django.contrib.admin',
 'django.contrib.staticfiles',
 'django.contrib.humanize',
 'bldcollector',
 'toastermain',
 'bldcontrol',
 'orm',
 'toastergui')
Installed Middleware:
('django.middleware.common.CommonMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware')


Traceback:
File 
"/home/belen/.local/lib/python3.4/site-packages/django/core/handlers/base.p
y" in get_response
  132.                     response = wrapped_callback(request,
*callback_args, **callback_kwargs)
File "/home/belen/toaster-python3/bitbake/lib/toaster/toastergui/views.py"
in configvars
  1419.     queryset = _get_queryset(Variable, queryset, filter_string,
search_term, ordering_string, 'variable_name')
File "/home/belen/toaster-python3/bitbake/lib/toaster/toastergui/views.py"
in _get_queryset
  354.         filter_query = _get_filtering_query(filter_string)
File "/home/belen/toaster-python3/bitbake/lib/toaster/toastergui/views.py"
in _get_filtering_query
  271.             x = __get_q_for_val(k, val)

Exception Type: NameError at /toastergui/build/4/configvars
Exception Value: name 'k' is not defined

===========================================

* In the custom image details page, the add | remove filter is not
working: the filtering does not happen

* The all projects table is showing builds in progress information (builds
in progress information should not appear in any tables)

* My builds for custom images don't seem to be working. I start them, but
I never see any progress in the UI. The toaster_ui.log doesn't show them
at all, so I am kind of confused.

I think that's it so far.

Cheers

Belén






^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2019-04-01 10:06 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-25 22:20 python3 issues YOUNG, MICHAEL A.
2019-03-26  1:32 ` Elliott Mitchell
2019-03-26 13:16 ` Wei Liu
2019-03-26 13:43   ` Wei Liu
2019-03-26 18:18     ` M A Young
2019-03-26 21:06       ` Hans van Kranenburg
2019-04-01  9:18         ` Wei Liu
2019-04-01  9:42         ` Wei Liu
2019-04-01  9:59           ` M A Young
2019-04-01 10:01             ` Wei Liu
2019-03-27  0:36   ` Hans van Kranenburg
2019-04-01 10:04     ` Wei Liu
  -- strict thread matches above, loose matches on Subject: below --
2016-06-02 16:31 Barros Pena, Belen
2016-06-03 14:15 ` Smith, Elliot
2016-06-03 16:45   ` Smith, Elliot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.