Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 943207 - app-vim/vim-latex-1.10.0-r2: Python syntax warning on loading Latex file with python-3.12
Summary: app-vim/vim-latex-1.10.0-r2: Python syntax warning on loading Latex file with...
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Vim Maintainers
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks: 921826
  Show dependency tree
 
Reported: 2024-11-10 22:54 UTC by pogosyan
Modified: 2024-11-10 23:23 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description pogosyan 2024-11-10 22:54:20 UTC
When loading any latex file in vim run in konsole with vim-latex plugin enabled I get 

Error detected while processing BufRead Autocommands for "*.tex"..function dist#ft#FTtex[49]..FileType
 Autocommands for "*"..function <SNR>19_LoadFTPlugin[18]..script /usr/share/vim/vimfiles/ftplugin/tex_
latexSuite.vim[12]../usr/share/vim/vimfiles/ftplugin/latex-suite/main.vim[969]../usr/share/vim/vimfile
s/ftplugin/latex-suite/texviewer.vim:
line  895:
/usr/share/vim/vimfiles/ftplugin/latex-suite/bibtools.py:34: SyntaxWarning: invalid escape sequence '\s'
  """ 
Press ENTER or type command to continue


Reproducible: Always

Steps to Reproduce:
1.  Load any .tex file
2.  Observe the warning on loading the file
3.  After pressing ENTER editing proceeds seemingly normally


Expected Results:  
No errors/warnings on loading the file
Comment 2 pogosyan 2024-11-10 23:22:27 UTC
The error/warning comes from line 47 of
/usr/share/vim/vimfiles/ftplugin/latex-suite/bibtools.py:34


class Bibliography(dict):
    def __init__(self, txt, macros={}):
        """
        txt:
            a string which represents the entire bibtex entry. A typical
            entry is of the form:
                @ARTICLE{ellington:84:part3,
                  author = {Ellington, C P},
                  title = {The Aerodynamics of Hovering Insect Flight. III. Kinematics},
                  journal = {Philosophical Transactions of the Royal Society of London. Series B, Biological Sciences},
                  year = {1984},
                  volume = {305},
                  pages = {41-78},
                  number = {1122},
                  owner = {Srinath},
Line 47 >>        pdf = {C:\srinath\research\papers\Ellington-3-Kinematics.pdf},
                  timestamp = {2006.01.02},
                }
        """



where in pdf = {C:\srinath\research\papers\Ellington-3-Kinematics.pdf}
\s \r \p \E are attempted to be interpreted as Python escape sequences.
I never coded in Python, but what I read from the docs,
triple quotes """   """ do not stop escape sequences to be interpreted.
One needs to preceded the string with 'r', i.e. have

    def __init__(self, txt, macros={}):
        r"""
        txt:
.....


that seems to work for me.
Comment 3 pogosyan 2024-11-10 23:23:46 UTC
Wow, that was a fast reply :)