* [PATCH] parse/ast.py: MethodNode fix character mapping error
@ 2015-07-10 16:44 Aníbal Limón
2015-07-10 16:55 ` Richard Purdie
0 siblings, 1 reply; 4+ messages in thread
From: Aníbal Limón @ 2015-07-10 16:44 UTC (permalink / raw)
To: bitbake-devel
When found an anonymous function the func name is made by filename
and lineno, the filename need to be converted to string before using
translation because produces an error of encoding.
Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
---
lib/bb/parse/ast.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/bb/parse/ast.py b/lib/bb/parse/ast.py
index 1130b14..4937006 100644
--- a/lib/bb/parse/ast.py
+++ b/lib/bb/parse/ast.py
@@ -149,7 +149,7 @@ class MethodNode(AstNode):
def eval(self, data):
text = '\n'.join(self.body)
if self.func_name == "__anonymous":
- funcname = ("__anon_%s_%s" % (self.lineno, self.filename.translate(MethodNode.tr_tbl)))
+ funcname = ("__anon_%s_%s" % (self.lineno, str(self.filename).translate(MethodNode.tr_tbl)))
text = "def %s(d):\n" % (funcname) + text
bb.methodpool.insert_method(funcname, text, self.filename)
anonfuncs = data.getVar('__BBANONFUNCS', False) or []
--
1.9.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] parse/ast.py: MethodNode fix character mapping error
2015-07-10 16:44 [PATCH] parse/ast.py: MethodNode fix character mapping error Aníbal Limón
@ 2015-07-10 16:55 ` Richard Purdie
2015-07-10 20:16 ` Aníbal Limón
0 siblings, 1 reply; 4+ messages in thread
From: Richard Purdie @ 2015-07-10 16:55 UTC (permalink / raw)
To: Aníbal Limón; +Cc: bitbake-devel
On Fri, 2015-07-10 at 11:44 -0500, Aníbal Limón wrote:
> When found an anonymous function the func name is made by filename
> and lineno, the filename need to be converted to string before using
> translation because produces an error of encoding.
Could you explain a little about why we don't hit this error in general?
Cheers,
Richard
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] parse/ast.py: MethodNode fix character mapping error
2015-07-10 16:55 ` Richard Purdie
@ 2015-07-10 20:16 ` Aníbal Limón
2015-07-10 20:21 ` Christopher Larson
0 siblings, 1 reply; 4+ messages in thread
From: Aníbal Limón @ 2015-07-10 20:16 UTC (permalink / raw)
To: Richard Purdie; +Cc: bitbake-devel
Hi Richard,
Sorry it was my mistake in my code because i'm loading a recipe file
using bb.cache.Cache.loadDataFull
passing an unicode filepath this causes the error but i think it need to
be sanitized? to avoid this kind of
problems.
Cheers,
alimon
On 10/07/15 11:55, Richard Purdie wrote:
> On Fri, 2015-07-10 at 11:44 -0500, Aníbal Limón wrote:
>> When found an anonymous function the func name is made by filename
>> and lineno, the filename need to be converted to string before using
>> translation because produces an error of encoding.
> Could you explain a little about why we don't hit this error in general?
>
> Cheers,
>
> Richard
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] parse/ast.py: MethodNode fix character mapping error
2015-07-10 20:16 ` Aníbal Limón
@ 2015-07-10 20:21 ` Christopher Larson
0 siblings, 0 replies; 4+ messages in thread
From: Christopher Larson @ 2015-07-10 20:21 UTC (permalink / raw)
To: Aníbal Limón; +Cc: bitbake-devel@lists.openembedded.org
[-- Attachment #1: Type: text/plain, Size: 1270 bytes --]
%s already converts the arguments to strings, last I checked. Am I missing
someting here?
On Fri, Jul 10, 2015 at 1:16 PM, Aníbal Limón <anibal.limon@linux.intel.com>
wrote:
> Hi Richard,
>
> Sorry it was my mistake in my code because i'm loading a recipe file using
> bb.cache.Cache.loadDataFull
> passing an unicode filepath this causes the error but i think it need to
> be sanitized? to avoid this kind of
> problems.
>
> Cheers,
> alimon
>
>
> On 10/07/15 11:55, Richard Purdie wrote:
>
>> On Fri, 2015-07-10 at 11:44 -0500, Aníbal Limón wrote:
>>
>>> When found an anonymous function the func name is made by filename
>>> and lineno, the filename need to be converted to string before using
>>> translation because produces an error of encoding.
>>>
>> Could you explain a little about why we don't hit this error in general?
>>
>> Cheers,
>>
>> Richard
>>
>>
> --
> _______________________________________________
> bitbake-devel mailing list
> bitbake-devel@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/bitbake-devel
>
--
Christopher Larson
clarson at kergoth dot com
Founder - BitBake, OpenEmbedded, OpenZaurus
Maintainer - Tslib
Senior Software Engineer, Mentor Graphics
[-- Attachment #2: Type: text/html, Size: 2141 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2015-07-10 20:21 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-10 16:44 [PATCH] parse/ast.py: MethodNode fix character mapping error Aníbal Limón
2015-07-10 16:55 ` Richard Purdie
2015-07-10 20:16 ` Aníbal Limón
2015-07-10 20:21 ` Christopher Larson
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.