Re: [patch] Re: LyX master still not ready for Python 3

2017-04-10 Thread Enrico Forestieri
On Mon, Apr 10, 2017 at 03:07:34PM +0200, Jean-Marc Lasgouttes wrote: > Le 10/04/2017 à 12:27, José Abílio Matos a écrit : > > Since this fixes a bug I think that it should be committed. > > For the final version I intend to uniform all the changes that have been > > done > > to support python 2

Re: [patch] Re: LyX master still not ready for Python 3

2017-04-10 Thread Jean-Marc Lasgouttes
Le 10/04/2017 à 12:27, José Abílio Matos a écrit : Since this fixes a bug I think that it should be committed. For the final version I intend to uniform all the changes that have been done to support python 2 and 3 to make the code more maintainable. OK, I did that. JMarc

Re: [patch] Re: LyX master still not ready for Python 3

2017-04-10 Thread José Abílio Matos
On Monday, 10 April 2017 11.02.21 WEST Jean-Marc Lasgouttes wrote: > As I wrote, it fixes my problem. Do you want me to apply it, or are > there reasons to hold it? > > JMarc Since this fixes a bug I think that it should be committed. For the final version I intend to uniform all the changes that

Re: [patch] Re: LyX master still not ready for Python 3

2017-04-10 Thread Jean-Marc Lasgouttes
Le 05/04/2017 à 22:08, Enrico Forestieri a écrit : Most probably you have some non-ascii characters in a \DeclareLaTeXClass line in some of your layout files. Now those files are explicitly read as utf-8 encoded. If this is so, the attached patch should help. Another consequence of the recent ch

Re: [patch] Re: LyX master still not ready for Python 3

2017-04-07 Thread Jean-Marc Lasgouttes
Le 05/04/2017 à 22:08, Enrico Forestieri a écrit : Most probably you have some non-ascii characters in a \DeclareLaTeXClass line in some of your layout files. Now those files are explicitly read as utf-8 encoded. I do have UTF-8 encoded layouts. If this is so, the attached patch should help.

Re: [patch] Re: LyX master still not ready for Python 3

2017-04-06 Thread José Abílio Matos
On Wednesday, 5 April 2017 21.08.09 WEST Enrico Forestieri wrote: > Most probably you have some non-ascii characters in a \DeclareLaTeXClass > line in some of your layout files. Now those files are explicitly read as > utf-8 encoded. If this is so, the attached patch should help. It should be some

Re: [patch] Re: LyX master still not ready for Python 3

2017-04-06 Thread José Abílio Matos
On Wednesday, 5 April 2017 21.48.21 WEST Uwe Stöhr wrote: > El 05.04.2017 a las 22:08, Enrico Forestieri escribió: > > Most probably you have some non-ascii characters in a \DeclareLaTeXClass > > line in some of your layout files. Now those files are explicitly read as > > utf-8 encoded. If this is

Re: [patch] Re: LyX master still not ready for Python 3

2017-04-06 Thread José Abílio Matos
On Wednesday, 5 April 2017 09.38.24 WEST Kornel Benko wrote: > ATM cmake(lyx) checks for python >= 2.7. I stand corrected then. :-) Thank you Kornel. -- José Abílio

Re: [patch] Re: LyX master still not ready for Python 3

2017-04-05 Thread Uwe Stöhr
El 05.04.2017 a las 22:08, Enrico Forestieri escribió: Most probably you have some non-ascii characters in a \DeclareLaTeXClass line in some of your layout files. Now those files are explicitly read as utf-8 encoded. If this is so, the attached patch should help. Yes. This is necessary. Moreov

Re: [patch] Re: LyX master still not ready for Python 3

2017-04-05 Thread Enrico Forestieri
On Wed, Apr 05, 2017 at 02:01:36PM +0200, Jean-Marc Lasgouttes wrote: > > I am not sure what the status is, but with latest version I get the > following from configure.py: > > Traceback (most recent call last): > File "/home/local/lasgoutt/lyx/master/lib/configure.py", line 1825, in > > r

Re: [patch] Re: LyX master still not ready for Python 3

2017-04-05 Thread Jean-Marc Lasgouttes
Le 04/04/2017 à 21:01, José Abílio Matos a écrit : On Sunday, 2 April 2017 13.40.05 WEST Uwe Stöhr wrote: - the file was opened without the correct encoding. Since nothing was give, utf8 was used. That failed because on Windows it is in cp1252. In my patch I use io.open which works with Python 2

Re: [patch] Re: LyX master still not ready for Python 3

2017-04-05 Thread Kornel Benko
Am Dienstag, 4. April 2017 um 23:14:22, schrieb José Abílio Matos > On Tuesday, 4 April 2017 21.43.58 WEST Uwe Stöhr wrote: > > Hi José, > > > > many thanks for having a look. > > > > Why CMake 2.6? That was released 9 years (sic!) ago. Using it is a > > potential security issue. i am wondering

Re: [patch] Re: LyX master still not ready for Python 3

2017-04-04 Thread José Abílio Matos
On Tuesday, 4 April 2017 21.43.58 WEST Uwe Stöhr wrote: > Hi José, > > many thanks for having a look. > > Why CMake 2.6? That was released 9 years (sic!) ago. Using it is a > potential security issue. i am wondering if people still use this. > > In my opinion we should rely on CMake 2.8, release

Re: [patch] Re: LyX master still not ready for Python 3

2017-04-04 Thread Uwe Stöhr
El 04.04.2017 a las 21:01, José Abílio Matos escribió: Regarding the support for older versions of python 2 we already test both using the autotools ( >= 2.7.0 ) and cmake (>= 2.6). Hi José, many thanks for having a look. Why CMake 2.6? That was released 9 years (sic!) ago. Using it is a po

Re: [patch] Re: LyX master still not ready for Python 3

2017-04-04 Thread José Abílio Matos
On Sunday, 2 April 2017 13.40.05 WEST Uwe Stöhr wrote: > - the file was opened without the correct encoding. Since nothing was > give, utf8 was used. That failed because on Windows it is in cp1252. In > my patch I use io.open which works with Python 2.6 and 2.7. I think we > don't need to support a

[patch] Re: LyX master still not ready for Python 3

2017-04-02 Thread Uwe Stöhr
Am 02.04.2017 um 14:07 schrieb Uwe Stöhr: I don't know enough about Python and cannot provide a patch. Well, the attached patch fixes the problem for me. It works with Python 2 and 3. There were 2 problems: - the explicit encoding made the string a byte-like object in which we cannot use

Re: LyX master still not ready for Python 3

2017-04-02 Thread Uwe Stöhr
Am 30.03.2017 um 14:37 schrieb José Abílio Matos: What about changing that line to: os.write(fd, b'\\relax') it should work for both versions, no? No. This works for Python 2 but it does not fix the real problem I desribed: inpname = shortPath(str(tmpfname, encoding)).replace('\\', '/') fa

Re: LyX master still not ready for Python 3

2017-03-30 Thread José Abílio Matos
On Wednesday, 29 March 2017 23.09.23 WEST Uwe Stöhr wrote: > And indeed by using i n line 208 > > os.write(fd, b'\relax') > instead of > os.write(fd, r'\relax') > > I get with > inpname = shortPath(str(tmpfname)).replace('\\', '/') > no error. But then it will of course fail with Python 2. > > r

Re: LyX master still not ready for Python 3

2017-03-29 Thread Uwe Stöhr
Am 29.03.2017 um 23:05 schrieb Uwe Stöhr: ('de_DE', 'cp1252') OK, using inpname = shortPath(str(tmpfname).encode(encoding)).replace('\\', '/') or inpname = shortPath(str(tmpfname).encode('cp1252')).replace('\\', '/') gives this error: TypeError: a bytes-like object is required, not 'str' I

Re: LyX master still not ready for Python 3

2017-03-29 Thread Uwe Stöhr
Am 29.03.2017 um 15:41 schrieb José Abílio Matos: OK, I committed a change that should fix this problem. Thanks José, this does not fix the bug. I get still the same error message: 22:59:50.996: File "D:/LyXGit/Master/lib/configure.py", line 1811, in 22:59:50.999: windows_style_tex_

Re: LyX master still not ready for Python 3

2017-03-29 Thread José Abílio Matos
On Wednesday, 29 March 2017 18.24.26 WEST Enrico Forestieri wrote: > On Wed, Mar 29, 2017 at 02:41:23PM +0100, José Abílio Matos wrote: > > OK, I committed a change that should fix this problem. > > I hope so ;) When dealing with windows I always hope, after all hope is the last to die. :-) >

Re: LyX master still not ready for Python 3

2017-03-29 Thread Enrico Forestieri
On Wed, Mar 29, 2017 at 02:41:23PM +0100, José Abílio Matos wrote: > > OK, I committed a change that should fix this problem. I hope so ;) C:\python>python Python 2.7.10 (default, May 23 2015, 09:40:32) [MSC v.1500 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for mo

Re: LyX master still not ready for Python 3

2017-03-29 Thread José Abílio Matos
On Wednesday, 29 March 2017 01.12.06 WEST Uwe Stöhr wrote: > As requested by José, I installed Python 3.6.1 and tested today's master > with it. As result LyX cannot be started because the reconfiguration fails: > > 02:05:53.187: Checking whether TeX allows spaces in file names... yes > 02:05:53.1

Re: LyX master still not ready for Python 3

2017-03-29 Thread José Abílio Matos
On Wednesday, 29 March 2017 01.12.06 WEST Uwe Stöhr wrote: > As requested by José, I installed Python 3.6.1 and tested today's master > with it. As result LyX cannot be started because the reconfiguration fails: > > 02:05:53.187: Checking whether TeX allows spaces in file names... yes > 02:05:53.1