bug-global
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [python3 only] when use "--gtagslabel=pygements", gtags don't output


From: Shigio YAMAGUCHI
Subject: Re: [python3 only] when use "--gtagslabel=pygements", gtags don't output (C language) function names into GTAGS
Date: Fri, 10 Mar 2017 11:09:49 +0900

Hi,
It was not reproduced in my environment.
GLOBAL-current
Python 3.6.0
MacOS 10.11.6

Since GLOBAL does not support Windows, I cannot say 
it is a bug at this stage. 
However, if it is a fix and it does not affect the UNIX 
version, I will accept a patch.

Regards,
Shigio


2017-03-09 22:16 GMT+09:00 ishigane <address@hidden>:
Dear all,

It might be a bug? I send a report.
Target is "*.c"(C language file).

When run "gtags" with "--gtagslabel=pygments" option, GTAGS file don't have any function names.
CTagsParser (at "share/gtags/script/pygments_parser.py") failed to initialize, gtags only use pygments.

This issue occurs only using python3. In the case of python 2.7.13, no problem.

environments:
   Windows10 Pro x64
   global 6.5.6 (http://adoxa.altervista.org/global/)
   python 3.6.0 x64 + pygments 2.2.0
   exuberant ctags 5.8 (patched, http://hp.vector.co.jp/authors/VA025040/ctags/)

Instructions:
1. I prepared "test.c". Content is like below.
----------
#include <stdio.h>

void test() {
}

int main(int argc, **char argv) {
        return 0;
}
-----------

2. gtags --gtagslabel=pygments
3. gtags -d GTAGS

expected result(same as python2):
  __.COMPNAME     __.COMPNAME
  __.COMPRESS     __.COMPRESS ddefine ttypedef
  __.VERSION      __.VERSION 6
main    1 @n 6 int @n(int argc, **char argv) {
test    1 @n 3 void @n() {

actual result(python3):
  __.COMPNAME     __.COMPNAME
  __.COMPRESS     __.COMPRESS ddefine ttypedef
  __.VERSION      __.VERSION 6

cause:
"share/gtags/script/pygments_parser.py".

At handle_requests(), CtagsParser failed to initialize.
At CtagsParser.__init__, subprocess.Popen() failed.

Because of "ctags_command"(argument of CtagsParser.__init__) is byte type.

patch:
--- pygments_parser.py.orig     2017-01-13 12:32:06 +0900
+++ pygments_parser.py  2017-03-09 18:44:25 +0900
@@ -239,6 +239,8 @@
                  stdout=subprocess.PIPE, stderr=subprocess.PIPE)
      if p.wait() == 0:
          path = p.stdout.readline().rstrip()
+    if sys.version_info >= (3, ):
+        path = path.decode()
      return path

  def main():

I don't know well about python(is checking/converting really ok?), it might be exists more better way.

Regards,
Seigo Ishigane


_______________________________________________
Bug-global mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/bug-global




--
Shigio YAMAGUCHI <address@hidden>
PGP fingerprint: 
26F6 31B4 3D62 4A92 7E6F  1C33 969C 3BE3 89DD A6EB (Currently in use)
D1CB 0B89 B346 4AB6 5663  C4B6 3CA5 BBB3 57BE DDA3 (Used until 2017/2)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]