Repository: neovim
Issue: `pyfile` fails on `unittest.main()` and breaks python provider
Labels: bug,provider

### Problem

An attempt to execute a python file via `pyfile`/`py3file` leads to a cryptic error and breaks python provider.
The problem happens on latest master and stable realease.

```
line 1:   return v:lua.vim.provider.python.call(a:method, a:args)                                                      

Error detected while processing function provider#python3#Call:                                                        
line    1:                                                                                                             
E5108: Error executing lua Vim:E                                                                                       
stack traceback:                                                                                                       
        [C]: at 0x006427a0  
```

--------------------
version
```
:version                                                                                                      
NVIM v0.10.3                                                                                                           
Build type: Release                                                                                                    
LuaJIT 2.1.1713484068    
```


Health check:
```
provider.python: require("provider.python.health").check()

Python 3 provider (optional) ~
- `g:python3_host_prog` is not set. Searching for python3 in the environment.
- Executable: /home/user/tmp/venv311/bin/python3
- Python version: 3.11.10
- pynvim version: 0.5.2
- OK Latest pynvim is installed.

Python virtualenv ~
- $VIRTUAL_ENV is set to: /home/user/tmp/venv311
- Python version: 3.11.10
- OK $VIRTUAL_ENV provides :!python.
```

### Steps to reproduce


**Steps to reproduce**

0. create a new python venv, install pynvim via pip, activate it, run `nvim -u NONE` and/or /nvim --clean,  check health, etc (see below)
1. In the beginning running simple commands works:
```
:py3 print('hello')
hello
```


2. An attempt to execute a file via `pyf %` or `pyf script.py` fail. With `verbose` set to 15 the error still looks very unhelpful
```
:py3file script.py  
calling provider#python3#Call('execute_file', ['/home/user/tmp/script.py', 2, 2])
line 1:   return v:lua.vim.provider.python.call(a:method, a:args)                                                      

Error detected while processing function provider#python3#Call:                                                        
line    1:                                                                                                             
E5108: Error executing lua Vim:E                                                                                       
stack traceback:                                                                                                       
        [C]: at 0x006427a0  
```

3. After all subsequent calls to python provider fail
```
:py3 print('hello')
Error detected while processing function provider#python3#Call:                                              
line    1:                                                                                                             
E5108: Error executing lua Vim:Error invoking 'python_execute' on channel 9:                                           
Invalid channel: 9                                                                                                     
stack traceback:                                                                                                       
        [C]: at 0x006427a0   
```


### Expected behavior

python script executes and results are shown in messages (same as in vim)

### Nvim version (nvim -v)

0.10.3

### Vim (not Nvim) behaves the same?

no, vim 9.1 works as expected

### Operating system/version

FreeBSD

### Terminal name/version

foot

### $TERM environment variable

xterm-256color

### Installation

built manually from tagged release