Summary: | media-video/mplayer2-2.0_p20120828 failes with ord() expected string of length 1, but int found | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Kamen Dokov <polidevk.polidevk> |
Component: | Current packages | Assignee: | Gentoo Media-video project <media-video> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | alex, nikoli, scarabeus, yellowhat46 |
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | AMD64 | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Attachments: | build.log |
Description
Kamen Dokov
2012-09-02 20:07:35 UTC
Created attachment 322776 [details]
build.log
Setting python to 2.7 via eselect worked around the problem form me. (In reply to comment #2) > Setting python to 2.7 via eselect worked around the problem form me. Hmm may be ebuild needs to explicitly request python2 ? (In reply to comment #3) > (In reply to comment #2) > > Setting python to 2.7 via eselect worked around the problem form me. > > Hmm may be ebuild needs to explicitly request python2 ? Apparently accept keywords * works with python3.2 I think it is in the py2 patch I wrote. - sys.stdout.write('"' + ''.join(conv[c] for c in line) + '"\n') + sys.stdout.write('"' + ''.join(conv[ord(c)] for c in line) + '"\n') As in py3 the strings are already array of integers the ord is ambious there. So any ideas how to make this work for both py2 and py3? (In reply to comment #5) > I think it is in the py2 patch I wrote. > > > - sys.stdout.write('"' + ''.join(conv[c] for c in line) + '"\n') > + sys.stdout.write('"' + ''.join(conv[ord(c)] for c in line) + '"\n') > > As in py3 the strings are already array of integers the ord is ambious > there. So > any ideas how to make this work for both py2 and py3? May be with conditional: if python3 system wide is detected then python3 variant, if not, then python2 variant ? (In reply to comment #6) > May be with conditional: if python3 system wide is detected then python3 > variant, if not, then python2 variant ? Nope, conditional patches are wrong, and you cant detect the py version properly from ebuilds unless raping the code a lot. So we just need to do it right. Feel free to hack on it, in a bit I will hopefully have time to fix it. Updating the summary as the version in tree was changed to reflect upstream. No change for this bug tho, so do not try if you have it. (In reply to comment #7) > (In reply to comment #6) > > > May be with conditional: if python3 system wide is detected then python3 > > variant, if not, then python2 variant ? > > Nope, conditional patches are wrong, and you cant detect the py version > properly from ebuilds unless raping the code a lot. > > So we just need to do it right. Feel free to hack on it, in a bit I will > hopefully have time to fix it. I did a little digging around and basically got this answer: "writing code that is supposed to run on both unmodified is rarely a good idea" With that said we should probably just force python3 with the original code or python2 with the patch. Well it is not that hard to do conditionals where needed. Try this file: http://dev.gentooexperimental.org/~scarabeus/0001-Add-py2-compat.-Now-scripts-work-under-both-py3-and-.patch And replace the current patch in files/ dir to see if it works with it. *** Bug 433828 has been marked as a duplicate of this bug. *** (In reply to comment #10) > Well it is not that hard to do conditionals where needed. > > Try this file: > http://dev.gentooexperimental.org/~scarabeus/0001-Add-py2-compat.-Now- > scripts-work-under-both-py3-and-.patch > > And replace the current patch in files/ dir to see if it works with it. I have just tried this patch but I get this error: /TOOLS/file2string.py etc/codecs.conf >codecs.conf.h File "./TOOLS/file2string.py", line 21 catch TypeError: ^ TabError: inconsistent use of tabs and spaces in indentation make: *** [codecs.conf.h] Errore 1 make: *** Eliminazione del file «codecs.conf.h» make: *** Attesa dei processi non terminati.... > I have just tried this patch but I get this error:
>
> /TOOLS/file2string.py etc/codecs.conf >codecs.conf.h
> File "./TOOLS/file2string.py", line 21
> catch TypeError:
> ^
> TabError: inconsistent use of tabs and spaces in indentation
> make: *** [codecs.conf.h] Errore 1
> make: *** Eliminazione del file «codecs.conf.h»
> make: *** Attesa dei processi non terminati....
I am no python expert but it sounds like you used a tab instead of 4 spaces or vice versa. Just make sure your spacing is consistent.
(In reply to comment #13) > > I am no python expert but it sounds like you used a tab instead of 4 spaces > or vice versa. Just make sure your spacing is consistent. Yes yes, I have vim to use tabs by default, but didn't notice the code is space aligned. Updated the patch in the url, so now it should not fail like this, please try again. Perfect, the new patch work for me. Thanks Fixed in cvs. Thanks for the testing. |