Re: Help needed (Was: Bug#943083: libncl: Python2 removal in sid/bullseye)

2019-12-16 Thread Andrey Rahmatullin
On Mon, Dec 16, 2019 at 11:07:07AM +0100, Andreas Tille wrote:
> I'm afraid 2to3 skipped this very file.  I retried manually:
> 
> $ 2to3 -w roundTripNCLTest.py 
> RefactoringTool: Skipping optional fixer: buffer
> RefactoringTool: Skipping optional fixer: idioms
> RefactoringTool: Skipping optional fixer: set_literal
> RefactoringTool: Skipping optional fixer: ws_comma
> RefactoringTool: Can't parse roundTripNCLTest.py: ParseError: bad input: 
> type=22, value='=', context=('', (41, 93))
> RefactoringTool: No files need to be modified.
> RefactoringTool: There was 1 error:
> RefactoringTool: Can't parse roundTripNCLTest.py: ParseError: bad input: 
> type=22, value='=', context=('', (41, 93))
It worked for me, but didn't change that line.

ii  2to3   3.7.5-3  all  2to3 binary using python3

-- 
WBR, wRAR


signature.asc
Description: PGP signature


Re: Help needed (Was: Bug#943083: libncl: Python2 removal in sid/bullseye)

2019-12-16 Thread Andreas Tille
On Mon, Dec 16, 2019 at 01:31:02PM +0500, Andrey Rahmatullin wrote:
> On Mon, Dec 16, 2019 at 09:17:50AM +0100, Andreas Tille wrote:
> > inputParentPath = lineIter.next().strip()
> > AttributeError: '_io.StringIO' object has no attribute 'next'
> This should be changed to next(lineIter).strip(), 2to3 for some reason
> missed it.

I'm afraid 2to3 skipped this very file.  I retried manually:

$ 2to3 -w roundTripNCLTest.py 
RefactoringTool: Skipping optional fixer: buffer
RefactoringTool: Skipping optional fixer: idioms
RefactoringTool: Skipping optional fixer: set_literal
RefactoringTool: Skipping optional fixer: ws_comma
RefactoringTool: Can't parse roundTripNCLTest.py: ParseError: bad input: 
type=22, value='=', context=('', (41, 93))
RefactoringTool: No files need to be modified.
RefactoringTool: There was 1 error:
RefactoringTool: Can't parse roundTripNCLTest.py: ParseError: bad input: 
type=22, value='=', context=('', (41, 93))


I also had to replace a call to file() by open() - now it works.

Is this by any chance a bug in 2to3?

Kind regards

Andreas.

-- 
http://fam-tille.de



Re: Help needed (Was: Bug#943083: libncl: Python2 removal in sid/bullseye)

2019-12-16 Thread Andrey Rahmatullin
On Mon, Dec 16, 2019 at 09:17:50AM +0100, Andreas Tille wrote:
> inputParentPath = lineIter.next().strip()
> AttributeError: '_io.StringIO' object has no attribute 'next'
This should be changed to next(lineIter).strip(), 2to3 for some reason
missed it.

-- 
WBR, wRAR


signature.asc
Description: PGP signature


Help needed (Was: Bug#943083: libncl: Python2 removal in sid/bullseye)

2019-12-16 Thread Andreas Tille
Control: tags -1 help

Hi,

I tried 2to3 on the Python files belonging to libncl test suite.
Upstream is using a somehow complex method to read config files.
Before trying a complete rewrite I wonder whether someone might
be able to make some sense out of:

...
make  check-local
make[4]: Entering directory 
'/build/libncl-2.1.21+git20190531.feceb81/example/ncltest'
/usr/bin/python3 ../../test/roundTripNCLTest.py ../../example/ncltest/ncltest 
../../test/OldValidIn ../../test/OldValidOut
Traceback (most recent call last):
  File "../../test/roundTripNCLTest.py", line 243, in 
inputParentPath = lineIter.next().strip()
AttributeError: '_io.StringIO' object has no attribute 'next'
make[4]: *** [Makefile:626: check-local] Error 1
...


Kind regards

  Andreas.

-- 
http://fam-tille.de