LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 08-09-2018, 02:26 AM   #31
Richard Cranium
Senior Member
 
Registered: Apr 2009
Location: Carrollton, Texas
Distribution: Slackware64 14.2
Posts: 3,033

Rep: Reputation: 1408Reputation: 1408Reputation: 1408Reputation: 1408Reputation: 1408Reputation: 1408Reputation: 1408Reputation: 1408Reputation: 1408Reputation: 1408

In your first post, you managed to not mention Slackware a single time but ubuntu more than once.

You may run iconv on a data file, but running it on a shared library will not do anything that you'd want.


For some reason that I cannot find, the current version of python 2.7 in Slackware64 14.2 is still compiled with ucs2...
Code:
$ python
Python 2.7.15 (default, May  4 2018, 14:13:26) 
[GCC 5.5.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> print "ucs2" if sys.maxunicode < 0x10ffff else "ucs4"
ucs2
>>>
That's despite @bassmadrigal's post where he quoted the then-current changelog:

Code:
+--------------------------+
Thu Sep 8 21:35:02 UTC 2016
d/python-2.7.12-x86_64-1.txz: Upgraded.
       Compiled using --enable-unicode=ucs4.
       The upstream default for Python Unicode is ucs2, but ucs4 is more widely
       used and recommended now. Any Python scripts or binaries that use UCS-2
       will need to be recompiled. These can be identified with the following
       grep command: grep -r -l PyUnicodeUCS2 /usr 2> /dev/null
That change appears to have been reverted with no comment.

EDIT: I think that pigs will nest in trees before that change is back-ported to 14.2. I have no idea what would break.

Last edited by Richard Cranium; 08-09-2018 at 02:28 AM.
 
Old 08-09-2018, 03:32 AM   #32
troqnec
LQ Newbie
 
Registered: May 2013
Posts: 23

Rep: Reputation: Disabled
Ok I will try to explain most simple, that I can (and sorry for my English skill's)..I don't want to configure my python2.7 with ucs4 because like Pat wrote "It will break any binary modules that use Unicode and were compiled using a ucs2 Python."
So is there a chance to copy this file to machine with other distro with ucs4 support and convert it to ucs2? Like I say before, I don't understand programming things and python things. I just think that the problem is in encoding and if the file (data or library) is open on other OS with right configured python can I "save as" in ucs2 format or what ever it is?
And the package of acestream have in his name "ubuntu" cause that OS is supported from them, but it is no problem to start this with any GNU/Linux distro if you have python with ucs4.
 
Old 08-09-2018, 05:42 AM   #33
zakame
Member
 
Registered: Apr 2012
Distribution: Debian, Ubuntu, Slackware
Posts: 250

Rep: Reputation: 152Reputation: 152
In that case I'd probably recommend building your own python, perhaps using pyenv:

Code:
$ env PYTHON_CONFIGURE_OPTS="--enable-unicode=ucs2" pyenv install 2.7.15
$ cd /opt/acestream_3.1.16_ubuntu_16.04_x86_64/
$ pyenv local 2.7.15
$ ./start-engine --client-console
 
1 members found this post helpful.
Old 08-09-2018, 05:19 PM   #34
Richard Cranium
Senior Member
 
Registered: Apr 2009
Location: Carrollton, Texas
Distribution: Slackware64 14.2
Posts: 3,033

Rep: Reputation: 1408Reputation: 1408Reputation: 1408Reputation: 1408Reputation: 1408Reputation: 1408Reputation: 1408Reputation: 1408Reputation: 1408Reputation: 1408
Quote:
Originally Posted by troqnec View Post
So is there a chance to copy this file to machine with other distro with ucs4 support and convert it to ucs2? Like I say before, I don't understand programming things and python things. I just think that the problem is in encoding and if the file (data or library) is open on other OS with right configured python can I "save as" in ucs2 format or what ever it is?
And the package of acestream have in his name "ubuntu" cause that OS is supported from them, but it is no problem to start this with any GNU/Linux distro if you have python with ucs4.
Doing this...
Code:
iconv -f UCS-4 -t UTF-8 Core.so Core1.so
...would place garbage into Core1.so. Core.so isn't a document, it is a piece of compiled code. You can't load it into a text editor, change something, save it, and expect it to work.

My other point merely proved that I can't read a calendar. 14.2 was released on June 30, 2016 and the changelog entry for the UCS4 conversion was on Sept 8, 2016.

@zakame has the best idea.
 
Old 08-09-2018, 05:23 PM   #35
bassmadrigal
LQ Guru
 
Registered: Nov 2003
Location: West Jordan, UT, USA
Distribution: Slackware
Posts: 5,356

Rep: Reputation: 3105Reputation: 3105Reputation: 3105Reputation: 3105Reputation: 3105Reputation: 3105Reputation: 3105Reputation: 3105Reputation: 3105Reputation: 3105Reputation: 3105
Quote:
Originally Posted by Richard Cranium View Post
That's despite @bassmadrigal's post where he quoted the then-current changelog:

Code:
+--------------------------+
Thu Sep 8 21:35:02 UTC 2016
d/python-2.7.12-x86_64-1.txz: Upgraded.
       Compiled using --enable-unicode=ucs4.
       The upstream default for Python Unicode is ucs2, but ucs4 is more widely
       used and recommended now. Any Python scripts or binaries that use UCS-2
       will need to be recompiled. These can be identified with the following
       grep command: grep -r -l PyUnicodeUCS2 /usr 2> /dev/null
That change appears to have been reverted with no comment.
That change was applied to the -current after 14.2's release date, so this current development cycle. It was never applied to 14.2.

In that post, I do mention:

Quote:
It was just brought up too late in the development of 14.2 and Pat didn't feel comfortable throwing that change in the mix so close to the release.
Quote:
Originally Posted by Richard Cranium View Post
My other point merely proved that I can't read a calendar. 14.2 was released on June 30, 2016 and the changelog entry for the UCS4 conversion was on Sept 8, 2016.
It happens to the best of us

Last edited by bassmadrigal; 08-09-2018 at 05:24 PM. Reason: Add extra
 
Old 08-10-2018, 12:00 PM   #36
troqnec
LQ Newbie
 
Registered: May 2013
Posts: 23

Rep: Reputation: Disabled
Thank you zakame for your help...but I have a problem:
Code:
bash-4.3$ env PYTHON_CONFIGURE_OPTS="--enable-unicode=ucs2" pyenv install 2.7.15
Downloading Python-2.7.15.tar.xz...
-> https://www.python.org/ftp/python/2.7.15/Python-2.7.15.tar.xz
Installing Python-2.7.15...
Installed Python-2.7.15 to /home/troqnec/.pyenv/versions/2.7.15

bash-4.3$ cd /opt/acestream_3.1.16_ubuntu_16.04_x86_64/
bash-4.3$ pyenv local 2.7.15
bash-4.3$ ./start-engine --client-console
xx Cannot load libraries: path /opt/acestream_3.1.16_ubuntu_16.04_x86_64/lib
Traceback (most recent call last):
  File "<entry>", line 9, in <module>
ImportError: /opt/acestream_3.1.16_ubuntu_16.04_x86_64/lib/acestreamengine/Core.so: undefined symbol: PyUnicodeUCS4_DecodeUTF8
I have a pythontestencoding.py file with:
Quote:
import sys
if sys.maxunicode > 65535:
print 'UCS4 build'
else:
print 'UCS2 build'
and after start this file:
Quote:
bash-4.3$ pyenv local 2.7.15
bash-4.3$ python /home/troqnec/Downloads/acestream/pytestencoding.py
UCS2 build
Again thanks for the help. I think that this is the right way but I don't have python skill's to fight with this problem.
 
Old 08-10-2018, 12:07 PM   #37
troqnec
LQ Newbie
 
Registered: May 2013
Posts: 23

Rep: Reputation: Disabled
Thank you Richard now I know that this is not a simple text file and this trick with iconv will not work for me..
 
Old 08-10-2018, 11:15 PM   #38
zakame
Member
 
Registered: Apr 2012
Distribution: Debian, Ubuntu, Slackware
Posts: 250

Rep: Reputation: 152Reputation: 152
Quote:
Originally Posted by troqnec View Post
Thank you zakame for your help...but I have a problem:
Code:
bash-4.3$ env PYTHON_CONFIGURE_OPTS="--enable-unicode=ucs2" pyenv install 2.7.15
Downloading Python-2.7.15.tar.xz...
-> https://www.python.org/ftp/python/2.7.15/Python-2.7.15.tar.xz
Installing Python-2.7.15...
Installed Python-2.7.15 to /home/troqnec/.pyenv/versions/2.7.15

bash-4.3$ cd /opt/acestream_3.1.16_ubuntu_16.04_x86_64/
bash-4.3$ pyenv local 2.7.15
bash-4.3$ ./start-engine --client-console
xx Cannot load libraries: path /opt/acestream_3.1.16_ubuntu_16.04_x86_64/lib
Traceback (most recent call last):
  File "<entry>", line 9, in <module>
ImportError: /opt/acestream_3.1.16_ubuntu_16.04_x86_64/lib/acestreamengine/Core.so: undefined symbol: PyUnicodeUCS4_DecodeUTF8
I have a pythontestencoding.py file with:

and after start this file:

Again thanks for the help. I think that this is the right way but I don't have python skill's to fight with this problem.
Its probably the original PYTHON_CONFIGURE_OPTS I wrote, as it used ucs2. Try a rebuild with

Code:
$ pyenv uninstall 2.7.15
$ env PYTHON_CONFIGURE_OPTS="--enable-unicode=ucs4" pyenv install 2.7.15
to see if that helps. You don't need to do "pyenv local" again, there should be a ".python-version" file in the acestream directory that's set to your pyenv-built version.
 
Old 08-11-2018, 06:25 AM   #39
troqnec
LQ Newbie
 
Registered: May 2013
Posts: 23

Rep: Reputation: Disabled
Hmm after your help everything looks fine and I have a ucs4 python, but I have this ucs4 error. I make new directory with new extracted acestream, with pyenv local....
Code:
bash-4.3$ env PYTHON_CONFIGURE_OPTS="--enable-unicode=ucs4" pyenv install 2.7.15
Downloading Python-2.7.15.tar.xz...
-> https://www.python.org/ftp/python/2.7.15/Python-2.7.15.tar.xz
Installing Python-2.7.15...
Installed Python-2.7.15 to /home/troqnec/.pyenv/versions/2.7.15

bash-4.3$ cd /home/troqnec/Downloads/acestream/acestream_3.1.16_ubuntu_16.04_x86_64
bash-4.3$ ls
acestream.conf  acestreamengine  data  lib  start-engine
bash-4.3$ pyenv local 2.7.15
bash-4.3$ ./start-engine --client-console
xx Cannot load libraries: path /home/troqnec/Downloads/acestream/acestream_3.1.16_ubuntu_16.04_x86_64/lib
Traceback (most recent call last):
  File "<entry>", line 9, in <module>
ImportError: /home/troqnec/Downloads/acestream/acestream_3.1.16_ubuntu_16.04_x86_64/lib/acestreamengine/Core.so: undefined symbol: PyUnicodeUCS4_DecodeUTF8
bash-4.3$ python /home/troqnec/Downloads/acestream/pytestencoding.py 
UCS4 build
PS: I have a little progress (may be)
adding this in start-engine script:
Quote:
export PYTHONHOME=/home/troqnec/.pyenv/versions/2.7.15
export PYTHONPATH=$PYTHONPATH:/home/troqnec/.pyenv/versions/2.7.15/lib-dynload:/home/troqnec/.pyenv/versions/2.7.15/lib/python2.7.zip:/home/troqnec/.pyenv/versions/2.7.15
and the result is:
Quote:
ImportError: No module named site
How can I install this site module in pyenv?
Thanks in advance

Last edited by troqnec; 08-11-2018 at 09:27 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Linux on Cisco UCS host - Storage migration yashraj221087 Linux - Server 1 08-10-2015 06:00 AM
Problems using awk/sed/sort with a ucs-2le encoded file Jem7v! Programming 3 02-05-2010 06:03 AM
Perl File handling issue how to handle ucs 16 character set alix123 Programming 1 10-27-2008 06:51 AM
Where are UCS Unicode strings for GTK? donnied Linux - Desktop 0 08-11-2008 10:19 AM
python problem - compiled from source - python -V still showing old version txm123 Linux - Newbie 1 02-15-2006 11:05 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 09:34 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration