0
0
mirror of https://github.com/vim/vim.git synced 2025-07-04 23:07:33 -04:00

178 Commits

Author SHA1 Message Date
Ben Jackson
ea19e7856b
patch 9.1.0844: if_python: no way to pass local vars to python
Problem:  if_python: no way to pass local vars to python
Solution: Add locals argument to py3eval(), pyeval() and pyxeval()
          (Ben Jackson)

fixes: #8573
closes: #10594

Signed-off-by: Ben Jackson <puremourning@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-11-06 21:53:07 +01:00
Boris Staletic
83a06705dc
patch 9.1.0784: there are several problems with python 3.13
Problem:  there are several problems with python 3.13
Solution: fix the problems in the python3 interface (Boris Staletic)

This commit does the following things:
1) Since python 3.13.0b1, all statically defined objects are "immortal".
   Besides never getting garbage collected, this also affects reference
   counting:

   - Immportal objects have a reference count of 2^32-1.
   - Reference counting is a no-op.

   All this is considered implementation details by cpython, so
   documentation is next to non-existent.

   Relevant CPython source code:
   https://github.com/python/cpython/blob/v3.13.0/Include/object.h#L62-L107
   https://github.com/python/cpython/blob/v3.13.0/Include/object.h#L389-L391

2) Opt-out of ANSI-painted python stack traces

3) Make python error message severity more consistent

fixes: #15838
closes: #15842

Signed-off-by: Boris Staletic <boris.staletic@protonmail.com>
Signed-off-by: puremourning <puremourning@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-10-14 20:28:39 +02:00
Yee Cheng Chin
508403687d
patch 9.1.0726: not using correct python3 API with dynamic linking
Problem:  not using correct python3 API with dynamic linking
Solution: Use stable IncRef / DecRef in Python 3 dynamic bindings
          (Yee Cheng Chin)

Previously, we were using the Py_DECREF macros even when using dynamic
linking of Python 3. This caused issues because Python's headers contain
references to internal APIs like `_Py_Dealloc` and in v8.1.2201 and
v8.2.1225 we simply hacked around the issue by manually copying the
Python header implementation to Vim and linking in the private APIs.
This is fragile and prone to break. In fact, the Py_DECREF
implementation is different in newer versions of Python meaning that
this could potentially cause memory issues.

Instead, simply use the API versions (`Py_DECREF` and `Py_INCREF`) which
are functions exposed by the Python library. They could be slightly
slower since they require a function call instead of a macro, but are
much more reliable and we should only be calling these when the Python
Vim plugins are crossing the language boundary anyway which are always
going to be slow.

Note that this only affects dynamically linked Python builds that are
not using stable ABI.

Also see #15648

closes: #15653

Signed-off-by: Yee Cheng Chin <ychin.git@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-09-10 20:56:13 +02:00
Yee Cheng Chin
c2285a8cf3
patch 9.1.0724: if_python: link error with python 3.13 and stable ABI
Problem:  if_python: link error with python 3.13 and stable ABI
          (zdohnal)
Solution: Use the correct stable APIs Py_IncRef and Py_DecRef instead
          (Yee Cheng Chin)

This fixes #15460 properly. There was an attempt to fix it in v9.1.0668,
but it did it by manually copy and pasting definitions from Python 3.13
headers, which is problematic as it makes Vim dependent on low-level
implementation details which are subject to change. That change also
pulls in dependencies to private APIs (`_Py_IncRef`) which is a very bad
idea as the next version of Python could very well remove that.

The core issue was simply that `Py_INCREF` and similar functions are not
part of the stable API. We are supposed to be using `Py_IncRef` instead
which performs null-check (similar to `Py_XINCREF`) and is available as
a linkable function. We simply need to call it instead of the macro.
We simply remap `Py_INCREF` (and friends) to the function version in
stable API similar to how we mapped other functions.

related #15460
closes: #15648

Signed-off-by: Yee Cheng Chin <ychin.git@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-09-09 19:55:24 +02:00
Yee Cheng Chin
97a5be4687
patch 9.1.0723: if_python: dynamic linking fails with python3 >= 3.13
Problem:  if_python: dynamic linking fails with python3 >= 3.13
          when using non-stable ABI (zdohnal)
Solution: do not try to import the privat python symbol
          _PyObject_NextNotImplemented
          (Yee Cheng Chin)

Vim is importing a private Python symbol `_PyObject_NextNotImplemented`
because it used to be required as part of the `PyIter_Check()` macro in
an abstraction breaking way. Python eventually fixed the issue and in
3.13 it removed the private symbol export, which broke Vim. Simply
remove importing this private symbol in newer Python versions as it's no
longer needed for PyIter_Check to work.

fixes: #15457
closes: #15649

Signed-off-by: Yee Cheng Chin <ychin.git@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-09-09 19:46:17 +02:00
Ken Takata
9abd7158d7
patch 9.1.0668: build-error with python3.12 and stable ABI
Problem:  build-error with python3.12 and stable ABI (zdohnal)
Solution: Add type casts, define Py_INCREF for Python3.12 and higher
          (Ken Takata)

fixes: #15460

Signed-off-by: Ken Takata <kentkt@csc.jp>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-08-10 09:44:20 +02:00
Yaakov Selkowitz
4179f193cc
patch 9.1.0521: if_py: _PyObject_CallFunction_SizeT is dropped in Python 3.13
Problem:  if_py: _PyObject_CallFunction_SizeT is dropped in Python 3.13
Solution: define PyObject_CallFunction for Python >= 3.13
          (Yaakov Selkowitz)

references: python/cpython#105051

closes: #15088

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-07-04 16:36:05 +02:00
Ken Takata
982ef16059
patch 9.0.2048: python: uninitialized warning
Problem:  python: uninitialized warning
Solution: initialize 'minor' always

win32,py3: Fix uninitialized warning

Fix the following warning:
```
if_python3.c: In function 'py3_get_system_libname':
if_python3.c:879:16: warning: 'minor' may be used uninitialized [-Wmaybe-uninitialized]
  879 |             if (minor == PY_MINOR_VERSION)
      |                ^
if_python3.c:839:24: note: 'minor' was declared here
  839 |         long    major, minor;
      |                        ^~~~~
```

closes: #13368

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Ken Takata <kentkt@csc.jp>
2023-10-18 12:03:41 +02:00
Yee Cheng Chin
396058acd0
patch 9.0.2036: if_python: rework python3.12 build dependency
Problem:  if_python: rework python3.12 build dependency
          (after 9.0.1996)
Solution: use PyTuple_Size instead of inlining the Py_SIZE
          into the Vim code base

Use a simpler fix for Python 3.12 build issues

Python 3.12 introduced link dependencies to their `Py_SIZE()` inline
function, which #13290 fixed by copying the inline function to Vim's
Python binding code. This works but it's fragile, as a future update may
change the implementation of `Py_SIZE` and there is no way for us to
know.

The reason we need `Py_SIZE` to begin with is that we use
`PyTuple_GET_SIZE()` which calls that. Just fix it by mapping that to
(confusingly similarly named) `PyTuple_Size()`, which we already do in
the stable ABI implementation. There's a minor performance cost in that
it's not inlined and it does error checking but that's fine as we only
call this function rarely (in an error handler).

related: #13290
closes: #13359

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Yee Cheng Chin <ychin.git@gmail.com>
2023-10-17 10:38:11 +02:00
Ken Takata
ae3cfa47d3
patch 9.0.2026: win32: python3 dll loading can be improved
Problem:  win32: python3 dll loading can be improved
Solution: Load DLL from registry path

Support loading python3.dll and/or python3xx.dll from the path written
in the registry.  To support Stable ABI's forwarder DLL (python3.dll),
use the `LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR` flag for `LoadLibraryExW()`
because python3xx.dll is placed in the same directory of python3.dll.

If Stable ABI is used, search the latest version from the registry (both
from HKEY_CURRENT_USER and HKEY_LOCAL_MACHINE).  If Stable ABI is not
used, search only the matching version.

closes: #13315

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Ken Takata <kentkt@csc.jp>
2023-10-14 11:49:09 +02:00
Ken Takata
c97b3febc8
patch 9.0.2013: confusing ifdefs in if_<lang>.c
Problem:  confusing ifdefs in if_<lang>.c
Solution: refactor ifndefs to #ifdefs

if_x: Avoid using #ifndef - #else - #endif

Using #ifndef - #else - #endif is sometimes confusing.
Use #ifdef - #else - #endif instead.

closes: #13310

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Ken Takata <kentkt@csc.jp>
2023-10-11 21:27:06 +02:00
Ken Takata
fa145f2009
patch 9.0.1996: Cannot build with python312
Problem:  Cannot build with python312
Solution: Define wrapper types and functions for python 3.12

Py_SIZE() uses PyLong_Type and PyBool_Type starting from Python 3.12.
We need to define our own Py_SIZE() to replace Py{Bool,Long}_Type with
py3_Py{Bool,Long}_Type.
We also need to redefine PyTuple_GET_SIZE() and PyList_GET_SIZE(), because
they use Py_SIZE().

closes: #13281
closes: #13290

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Ken Takata <kentkt@csc.jp>
2023-10-06 19:27:13 +02:00
Ken Takata
119fdd9293
patch 9.0.1980: win32: issues with stable python ABI
Problem:  win32: issues with stable python ABI
Solution: if_python3,win32: Fix Python3 stable ABI

There were some issues in current stable ABI implementation on Windows:
* Python DLL name should be `python3.dll` instead of `python311.dll` and
  so on. (See: https://docs.python.org/3/c-api/stable.html)
* Some non-stable API functions were used:
  - `_PyObject_NextNotImplemented`
  - `PyStdPrinter_Type`
* `reset_stdin()` and `hook_py_exit()` didn't work with `python3.dll`.
  `python3.dll` is a special type of DLL called forwarder DLL.
  It just forwards the functions to other DLL (e.g. `python311.dll`).
  There were two issues regarding these functions:
  - `python3.dll` doesn't have import tables. This caused a crash in
    `get_imported_func_info()`. Add a check whether the specified DLL
    has an import table.
  - `reset_stdin()` and `hook_py_exit()` should be applied to the
    forwarded DLL (e.g. `python311.dll`), not to `python3.dll`.
    Check the export directory of `python3.dll` to find the forwarded
    DLL and apply the functions to it.

closes: #13260

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Ken Takata <kentkt@csc.jp>
2023-10-04 20:05:05 +02:00
Yee Cheng Chin
f7f746b167
patch 9.0.1960: Make CI checks more strict
Problem:  Make CI checks more strict
Solution: Add -Wstrict-prototypes -Wmissing-prototypes to CI,
          fix uncovered problems

Add -Wstrict-prototypes -Wmissing-prototypes warnings check to CI

Add two new warnings to CI, silence some Perl related build-warnings:

- `strict-prototypes` helps prevent declaring a function with an empty
  argument list, e.g. `int func()`. In C++, that's equivalent to `int
  func(void)`, but in C, that means a function that can take any number
  of arguments which is rarely what we want.

- `missing-prototypes` makes sure we use `static` for file-only internal
  functions. Non-static functions should have been declared on a
  prototype file.

- Add `no-compound-token-split-by-macro` to the perl cflags, since it
  throws out a bunch of perl-related warnings that make the CI log
  unnecessary verbose and hard to read. This seems to happen only with
  clang 12 and above.

When applying those changes, it already uncovered a few warnings, so fix
up the code as well (fix prototypes, make the code static, remove
shadowed var declaration)

GTK header needs to have #pragma warning suppressiong because GTK2
headers will warn on `-Wstrict-prototypes`, and it's included by gui.h
and so we can't just turn off the warning in a couple files.

closes: #13223
closes: #13226

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Yee Cheng Chin <ychin.git@gmail.com>
2023-09-30 12:32:37 +02:00
Dominique Pellé
4927bc7d27
patch 9.0.1930: compiler warnings with clang-17
Problem:  compiler warnings with clang-17
Solution: Fix function prototypes and function pointer

fix: clang compilation warnings with -Wstrict-prototypes

Change fixes this kind of compilation warnings with clang:
```
proto/if_python3.pro:13:20: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]
   13 | int python3_version();
      |                    ^
      |                     void
```

closes: #13166

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Dominique Pellé <dominique.pelle@tomtom.com>
2023-09-24 16:16:06 +02:00
Yee Cheng Chin
02c51b1dd8
patch 9.0.1925: if_python: still undefined behaviour with function pointer
Problem:  if_python: still undefined behaviour with function pointer
Solution: fix remaining problems

Fix remaining issues in the if_python code in casting incompatible
function pointers leading to Clang 17 giving runtime errors during
UBSAN.

closes: #13140

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Yee Cheng Chin <ychin.git@gmail.com>
2023-09-21 16:40:12 +02:00
Yee Cheng Chin
d606fccf6f
patch 9.0.1917: undefined behaviour with python function pointer
Problem:  undefined behaviour with python function pointer
Solution: correctly cast function pointers from void

Fix more undefined behaviors in if_python

Fix remaining UBSAN errors from Clang 17 in if_python in casting
function pointers.

Also fix a mistake where `PyMem_Free()` should be returning void, by the
dynamic build is mistakenly casting it as a function that returns an
int.

closes: #13128

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Yee Cheng Chin <ychin.git@gmail.com>
2023-09-20 19:59:47 +02:00
Yee Cheng Chin
2ce070c27a
patch 9.0.1913: if_python: undefined behaviour for function pointers
Problem:  if_python: undefined behaviour for function pointers
Solution: Fix if_python undefined behavior for function pointer casts

Identified by clang 17 UBSAN (see #12745). Make sure to cast function
pointers with the same signature only.

closes: #13122

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Yee Cheng Chin <ychin.git@gmail.com>
2023-09-19 20:30:22 +02:00
Yee Cheng Chin
c13b3d1350
patch 9.0.1776: No support for stable Python 3 ABI
Problem:  No support for stable Python 3 ABI
Solution: Support Python 3 stable ABI

Commits:
1) Support Python 3 stable ABI to allow mixed version interoperatbility

Vim currently supports embedding Python for use with plugins, and the
"dynamic" linking option allows the user to specify a locally installed
version of Python by setting `pythonthreedll`. However, one caveat is
that the Python 3 libs are not binary compatible across minor versions,
and mixing versions can potentially be dangerous (e.g. let's say Vim was
linked against the Python 3.10 SDK, but the user sets `pythonthreedll`
to a 3.11 lib). Usually, nothing bad happens, but in theory this could
lead to crashes, memory corruption, and other unpredictable behaviors.
It's also difficult for the user to tell something is wrong because Vim
has no way of reporting what Python 3 version Vim was linked with.

For Vim installed via a package manager, this usually isn't an issue
because all the dependencies would already be figured out. For prebuilt
Vim binaries like MacVim (my motivation for working on this), AppImage,
and Win32 installer this could potentially be an issue as usually a
single binary is distributed. This is more tricky when a new Python
version is released, as there's a chicken-and-egg issue with deciding
what Python version to build against and hard to keep in sync when a new
Python version just drops and we have a mix of users of different Python
versions, and a user just blindly upgrading to a new Python could lead to
bad interactions with Vim.

Python 3 does have a solution for this problem: stable ABI / limited API
(see https://docs.python.org/3/c-api/stable.html). The C SDK limits the
API to a set of functions that are promised to be stable across
versions. This pull request adds an ifdef config that allows us to turn
it on when building Vim. Vim binaries built with this option should be
safe to freely link with any Python 3 libraies without having the
constraint of having to use the same minor version.

Note: Python 2 has no such concept and this doesn't change how Python 2
integration works (not that there is going to be a new version of Python
2 that would cause compatibility issues in the future anyway).

---

Technical details:
======

The stable ABI can be accessed when we compile with the Python 3 limited
API (by defining `Py_LIMITED_API`). The Python 3 code (in `if_python3.c`
and `if_py_both.h`) would now handle this and switch to limited API
mode. Without it set, Vim will still use the full API as before so this
is an opt-in change.

The main difference is that `PyType_Object` is now an opaque struct that
we can't directly create "static types" out of, and we have to create
type objects as "heap types" instead. This is because the struct is not
stable and changes from version to version (e.g. 3.8 added a
`tp_vectorcall` field to it). I had to change all the types to be
allocated on the heap instead with just a pointer to them.

Other functions are also simply missing in limited API, or they are
introduced too late (e.g. `PyUnicode_AsUTF8AndSize` in 3.10) to it that
we need some other ways to do the same thing, so I had to abstract a few
things into macros, and sometimes re-implement functions like
`PyObject_NEW`.

One caveat is that in limited API, `OutputType` (used for replacing
`sys.stdout`) no longer inherits from `PyStdPrinter_Type` which I don't
think has any real issue other than minor differences in how they
convert to a string and missing a couple functions like `mode()` and
`fileno()`.

Also fixed an existing bug where `tp_basicsize` was set incorrectly for
`BufferObject`, `TabListObject, `WinListObject`.

Technically, there could be a small performance drop, there is a little
more indirection with accessing type objects, and some APIs like
`PyUnicode_AsUTF8AndSize` are missing, but in practice I didn't see any
difference, and any well-written Python plugin should try to avoid
excessing callbacks to the `vim` module in Python anyway.

I only tested limited API mode down to Python 3.7, which seemes to
compile and work fine. I haven't tried earlier Python versions.

2) Fix PyIter_Check on older Python vers / type##Ptr unused warning

For PyIter_Check, older versions exposed them as either macros (used in
full API), or a function (for use in limited API). A previous change
exposed PyIter_Check to the dynamic build because Python just moved it
to function-only in 3.10 anyway. Because of that, just make sure we
always grab the function in dynamic builds in earlier versions since
that's what Python eventually did anyway.

3) Move Py_LIMITED_API define to configure script

Can now use --with-python-stable-abi flag to customize what stable ABI
version to target. Can also use an env var to do so as well.

4) Show +python/dyn-stable in :version, and allow has() feature query

Not sure if the "/dyn-stable" suffix would break things, or whether we
should do it another way. Or just don't show it in version and rely on
has() feature checking.

5) Documentation first draft. Still need to implement v:python3_version

6) Fix PyIter_Check build breaks when compiling against Python 3.8

7) Add CI coverage stable ABI on Linux/Windows / make configurable on Windows

This adds configurable options for Windows make files (both MinGW and
MSVC). CI will also now exercise both traditional full API and stable
ABI for Linux and Windows in the matrix for coverage.

Also added a "dynamic" option to Linux matrix as a drive-by change to
make other scripting languages like Ruby / Perl testable under both
static and dynamic builds.

8) Fix inaccuracy in Windows docs

Python's own docs are confusing but you don't actually want to use
`python3.dll` for the dynamic linkage.

9) Add generated autoconf file

10) Add v:python3_version support

This variable indicates the version of Python3 that Vim was built
against (PY_VERSION_HEX), and will be useful to check whether the Python
library you are loading in dynamically actually fits it. When built with
stable ABI, it will be the limited ABI version instead
(`Py_LIMITED_API`), which indicates the minimum version of Python 3 the
user should have, rather than the exact match. When stable ABI is used,
we won't be exposing PY_VERSION_HEX in this var because it just doesn't
seem necessary to do so (the whole point of stable ABI is the promise
that it will work across versions), and I don't want to confuse the user
with too many variables.

Also, cleaned up some documentation, and added help tags.

11) Fix Python 3.7 compat issues

Fix a couple issues when using limited API < 3.8

- Crash on exit: In Python 3.7, if a heap-allocated type is destroyed
  before all instances are, it would cause a crash later. This happens
  when we destroyed `OptionsType` before calling `Py_Finalize` when
  using the limited API. To make it worse, later versions changed the
  semantics and now each instance has a strong reference to its own type
  and the recommendation has changed to have each instance de-ref its
  own type and have its type in GC traversal. To avoid dealing with
  these cross-version variations, we just don't free the heap type. They
  are static types in non-limited-API anyway and are designed to last
  through the entirety of the app, and we also don't restart the Python
  runtime and therefore do not need it to have absolutely 0 leaks.

  See:
  - https://docs.python.org/3/whatsnew/3.8.html#changes-in-the-c-api
  - https://docs.python.org/3/whatsnew/3.9.html#changes-in-the-c-api

- PyIter_Check: This function is not provided in limited APIs older than
  3.8. Previously I was trying to mock it out using manual
  PyType_GetSlot() but it was brittle and also does not actually work
  properly for static types (it will generate a Python error). Just
  return false. It does mean using limited API < 3.8 is not recommended
  as you lose the functionality to handle iterators, but from playing
  with plugins I couldn't find it to be an issue.

- Fix loading of PyIter_Check so it will be done when limited API < 3.8.
  Otherwise loading a 3.7 Python lib will fail even if limited API was
  specified to use it.

12) Make sure to only load `PyUnicode_AsUTF8AndSize` in needed in limited API

We don't use this function unless limited API >= 3.10, but we were
loading it regardless. Usually it's ok in Unix-like systems where Python
just has a single lib that we load from, but in Windows where there is a
separate python3.dll this would not work as the symbol would not have
been exposed in this more limited DLL file. This makes it much clearer
under what condition is this function needed.

closes: #12032

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Yee Cheng Chin <ychin.git@gmail.com>
2023-08-20 21:18:38 +02:00
Zdenek Dohnal
15a0a0281a
patch 9.0.1716: Windows build with python 3.12 and clang fails
Problem: Windows build with python 3.12 and clang fails
Solution: Remove the PyBool_Type function pointer for python 3.12

Clang on Win doesn't like non-static functions in static struct with
Python 3.12 - removing the new obfuscated function and protecting the
old PyBool function for older Pythons fixes the issue.

closes: #12800

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Zdenek Dohnal <zdohnal@redhat.com>
2023-08-15 22:52:01 +02:00
Zdenek Dohnal
e5e4709a6a
patch 9.0.1709: dynamic build with python 3.12 breaks
Problem: dynamic build with python 3.12 breaks
Solution: if_python3.c: Fix building dynamic Python3 interpreter

There are new extern global variables defined in python3 development
files, which types are within python3 library, so they break dynamic
python3 interpret Vim plugin.

Since the variables are used in macro `Py_SIZE` which is used in other
python3 headers, the dummy variables have to defined before including
Python.h.

closes: #12660

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Zdenek Dohnal <zdohnal@redhat.com>
2023-08-13 19:39:27 +02:00
Philip H
422b9dcbfa
patch 9.0.1685: silence Python 3.11 depreciations for gcc
Problem: Python 3.11 interface throws deprecation warnings
Solution: ignore those warnings for gcc and clang

Python 3.11 deprecation warnings are already silenced for clang using
the pragma
```
 # pragma clang diagnostic ignored "-Wdeprecated-declarations"
```

However those warnings are also emitted when using gcc. To avoid them
for both compilers, change use the __GNUC__ ifdef, which is defined for
gcc as well as clang.

Additionally, instead of using the "clang diagnostic ignored" pragma,
let's make use of 'GCC diagnostic ignored' which is again supported by
clang and GCC

closes: #12610

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Philip H <47042125+pheiduck@users.noreply.github.com>
2023-08-11 22:38:48 +02:00
Bram Moolenaar
ebfec1c531 patch 9.0.1234: the code style has to be checked manually
Problem:    The code style has to be checked manually.
Solution:   Add basic code style checks in a test.  Fix or avoid uncovered
            problems.
2023-01-22 21:14:53 +00:00
Yegappan Lakshmanan
0233bdfa2b patch 9.0.1183: code is indented more than necessary
Problem:    Code is indented more than necessary.
Solution:   Use an early return where it makes sense. (Yegappan Lakshmanan,
            closes #11805)
2023-01-12 12:33:30 +00:00
K.Takata
a7fbaa43b7 patch 9.0.1102: complicated use of #ifdef
Problem:    Complicated use of #ifdef.
Solution:   Simplify #ifdef use. (Ken Takata, closes #11745)
2022-12-26 14:46:51 +00:00
K.Takata
161b6ac04f patch 9.0.0880: preprocessor indenting is off
Problem:    Preprocessor indenting is off.
Solution:   Adjust preprocessor indentation. (Ken Takata, closes #11546)
2022-11-14 15:31:07 +00:00
Philip H
5a5f17f9b3 patch 9.0.0832: deprecation warning causes build failure
Problem:    Deprecation warning causes build failure.
Solution:   Suppress deprecation warning. (closes #11503)
2022-11-05 14:05:31 +00:00
ichizok
6c3d3e6904 patch 9.0.0831: compiler warning for redefining HAVE_DUP
Problem:    Compiler warning for redefining HAVE_DUP.
Solution:   Undefine HAVE_DUP if needed. (Ozaki Kiichi, closes #11484)
2022-11-04 22:38:11 +00:00
Zdenek Dohnal
fee511c1d3 patch 8.2.5168: cannot build with Python 3.11
Problem:    Cannot build with Python 3.11.
Solution:   Adjust define for _PyObject_TypeCheck. (Zdenek Dohnal,
            closes #10627)
2022-06-27 13:59:00 +01:00
Bram Moolenaar
63ff72aab9 patch 8.2.4317: MS-Windows: Vim exits when Python 3 initialisation fails
Problem:    MS-Windows: Vim exits when Python 3 initialisation fails.
Solution:   Hook into the exit() function to recover from the failure.
            (Ken Takata, closes #9710)
2022-02-07 13:54:01 +00:00
Bram Moolenaar
9d00e4a814 patch 8.2.4010: error messages are spread out
Problem:    Error messages are spread out.
Solution:   Move more error messages to errors.h.
2022-01-05 17:49:15 +00:00
Bram Moolenaar
9a846fbaa5 patch 8.2.3977: error messages are spread out
Problem:    Error messages are spread out.
Solution:   Move more error messages to errors.h.
2022-01-01 21:59:18 +00:00
Bram Moolenaar
460ae5dfca patch 8.2.3967: error messages are spread out
Problem:    Error messages are spread out.
Solution:   Move more errors to errors.h.
2022-01-01 14:19:49 +00:00
Dominique Pelle
af4a61a85d patch 8.2.3914: various spelling mistakes in comments
Problem:    Various spelling mistakes in comments.
Solution:   Fix the mistakes. (Dominique Pellé, closes #9416)
2021-12-27 17:21:41 +00:00
Martin Tournoij
1a3e5747b7 patch 8.2.3208: dynamic library load error does not mention why it failed
Problem:    Dynamic library load error does not mention why it failed.
Solution:   Add the error message. (Martin Tournoij, closes #8621)
2021-07-24 13:57:29 +02:00
Zdenek Dohnal
90478f35a8 patch 8.2.2995: linker errors with dynamic Python 3.10
Problem:    Linker errors with dynamic Python 3.10.
Solution:   Add a couple of library entries. (Zdenek Dohnal, closes #8381,
            closes #8356)
2021-06-14 15:08:30 +02:00
Bram Moolenaar
b2f9e0e2c5 patch 8.2.2211: MS-Windows: can't load Python dll if not in the path
Problem:    MS-Windows: can't load Python dll if not in the path.
Solution:   Use the InstallPath registry entry. (Kelvin Lee, closes #7540)
2020-12-25 13:52:37 +01:00
Bram Moolenaar
2e2f52a4a0 patch 8.2.2178: Python 3: non-utf8 character cannot be handled
Problem:    Python 3: non-utf8 character cannot be handled.
Solution:   Change the string decode. (Björn Linse, closes #1053)
2020-12-21 16:03:02 +01:00
Bram Moolenaar
4ce5fe4c87 patch 8.2.1883: compiler warnings when using Python
Problem:    Compiler warnings when using Python.
Solution:   Adjust PyCFunction to also have the second argument.  Use "int"
            return type for some functions.  Insert "(void *)" to get rid of
            the remaining warnings.
2020-10-21 21:01:59 +02:00
Bram Moolenaar
efc0d94afc patch 8.2.1834: PyEval_InitThreads() is deprecated in Python 3.9
Problem:    PyEval_InitThreads() is deprecated in Python 3.9.
Solution:   Do not call PyEval_InitThreads in Python 3.9 and later. (Ken
            Takata, closes #7113)  Avoid warnings for functions.
2020-10-11 18:05:02 +02:00
Bram Moolenaar
c6ed254d9f patch 8.2.1830: MS-Windows: Python3 issue with stdin
Problem:    MS-Windows: Python3 issue with stdin.
Solution:   Check if stdin is readable. (Ken Takata, closes #7106)
2020-10-10 23:26:28 +02:00
Bram Moolenaar
253b16a4ab patch 8.2.1806: MS-Windows with Python: Vim freezes after import command
Problem:    MS-Windows with Python: Vim freezes after import command.
Solution:   Use either "NUL" or "CONIN$" when reopening stdin. (Yasuhiro
            Matsumoto, closes #7083)
2020-10-06 19:59:06 +02:00
Bram Moolenaar
794771cfd8 patch 8.2.1790: MS-Windows with Python: crash when executed from Vifm
Problem:    MS-Windows with Python: crash when executed from Vifm.
Solution:   Use NUL instead of CONIN. (Ken Takata, closes #7061, closes #7053)
2020-10-03 13:57:13 +02:00
Bram Moolenaar
56b8dc331d patch 8.2.1381: MS-Windows: crash with Python 3.5 when stdin is redirected
Problem:    MS-Windows: crash with Python 3.5 when stdin is redirected.
Solution:   Reconnect stdin. (Yasuhiro Matsumoto, Ken Takata, closes #6641)
2020-08-06 21:47:11 +02:00
Bram Moolenaar
ee1b93169d patch 8.2.1225: linker errors when building with dynamic Python 3.9
Problem:    Linker errors when building with dynamic Python 3.9.
Solution:   Add #defined items. (closes #6461)
2020-07-16 22:15:53 +02:00
Bram Moolenaar
ab58946384 patch 8.2.1146: not enough testing for Python
Problem:    Not enough testing for Python.
Solution:   Add more tests.  Fix uncovered problems. (Yegappan Lakshmanan,
            closes #6392)
2020-07-06 21:03:06 +02:00
Bram Moolenaar
2027973b5b patch 8.2.0479: unloading shared libraries on exit has no purpose
Problem:    Unloading shared libraries on exit has no purpose.
Solution:   Do not unload shared libraries on exit.
2020-03-29 20:51:07 +02:00
Bram Moolenaar
a65bb53514 patch 8.2.0354: Python 3.9 does not define _Py_DEC_REFTOTAL
Problem:    Python 3.9 does not define _Py_DEC_REFTOTAL. (Zdenek Dohnal)
Solution:   Remove it, it was only for debugging.
2020-03-04 22:06:07 +01:00
Bram Moolenaar
d672dde584 patch 8.2.0319: file missing in distribution, comments outdated
Problem:    File missing in distribution, comments outdated.
Solution:   Correct path of README file.  Update comments.
2020-02-26 13:43:51 +01:00
Bram Moolenaar
2ab2e8608f patch 8.1.2387: using old C style comments
Problem:    Using old C style comments.
Solution:   Use // comments where appropriate.
2019-12-04 21:24:53 +01:00