[issue42626] readline history, vi-editingmode and ANSI color codes bug

2021-07-30 Thread Joakim Nilsson


Joakim Nilsson  added the comment:

Yes, I have noticed that too, and I agree, not as bad as if it was garbled,
but still an annoyance.

On Fri, Jul 30, 2021 at 1:34 AM Andrei Kulakov 
wrote:

>
> Andrei Kulakov  added the comment:
>
> Joakim: by the way, what I was able to reproduce is just a visual bug.
> IOW, the text is still the same and all there in the buffer, but it shows
> up only after a combination of rightward movement and 'a', and a copy of it
> shows up on the left side. So it's not as serious as if the text was
> garbled or impossible to enter or change.
>
> --
>
> ___
> Python tracker 
> <https://bugs.python.org/issue42626>
> ___
>

--

___
Python tracker 
<https://bugs.python.org/issue42626>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42626] readline history, vi-editingmode and ANSI color codes bug

2021-07-29 Thread Joakim Nilsson


Joakim Nilsson  added the comment:

Sorry, my mistake. If you remove the last line "input()" from readline.py, it 
should be reproducible. Tested on Python 3.9.2.

Link to video demonstration of the bug: 
http://nijoakim.com/readline-example.mp4.

--
Added file: https://bugs.python.org/file50190/readline-example.py

___
Python tracker 
<https://bugs.python.org/issue42626>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42626] readline history, vi-editingmode and ANSI color codes bug

2020-12-12 Thread Joakim Nilsson


New submission from Joakim Nilsson :

Tested on Debian Bullseye with Python 3.9.

If 'set editing-mode vi' is used in .inputrc and the attached program is run, a 
bug occurs when navigating the readline history. It seems only to occur when 
ANSI color escape characters are input to the 'input()' function.

To reproduce the bug:
  Run 'readline-example.py'
  Enter '0123456789' in the prompt without quotes.
  Press enter.
  Press escape and then 'k' to go back in history in vi normal mode.
  The cursor is now placed between '2' and '3' and it is impossible to erase 
anything after the '2'. (To enter vi insert mode, press i and start editing the 
text normally.)

This bug does not occur for shorter strings. If for example '012345678' is 
input, the program behaves normally. If the escape characters are not used in 
the 'input()' function, program behaves normally.

--
components: Library (Lib)
files: readline-example.py
messages: 382917
nosy: nijoakim
priority: normal
severity: normal
status: open
title: readline history, vi-editingmode and ANSI color codes bug
type: behavior
versions: Python 3.9
Added file: https://bugs.python.org/file49673/readline-example.py

___
Python tracker 
<https://bugs.python.org/issue42626>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue28739] PEP 498: docstrings as f-strings

2017-02-11 Thread Joakim Soderlund

Joakim Soderlund added the comment:

I got slightly confused here while playing around.

Python 3.6.0 (default, Jan 31 2017, 11:39:39) 
[GCC 4.9.2] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> class Huacaya:
...   f"""Huacaya!"""
... 
>>> class Suri:
...   f"""{'Suri!'}"""
... 
>>> Huacaya.__doc__ is None
False
>>> Suri.__doc__ is None
True

At first I thought f-strings *did* work as docstrings since it worked  just 
fine for the first class. But, the docstring suddenly vanished when putting an 
actual expression into it.

--
nosy: +JockeTF

___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue28739>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue25157] Installing Python 3.5.0 32bit on Windows 8.1 64bit system gives Error 0x80240017

2015-12-27 Thread Joakim Karlsson

Joakim Karlsson added the comment:

After running a windows update I finally have a working Python 3.5.1 
installation. Updates weren't done automatically on this box, so I was a bit 
behind.

I wish I knew which update fixed this, and I'm sorry to add to any confusion 
regarding this issue.

--

___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue25157>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue25157] Installing Python 3.5.0 32bit on Windows 8.1 64bit system gives Error 0x80240017

2015-12-23 Thread Joakim Karlsson

Joakim Karlsson added the comment:

I got this working on a Windows 8.1 box with the following mess. Hopefully 
someone more capable than me can piece together a viable fix from this.

I downloaded and executed the Visual C++ Redistributable for VS 2015 here: 
https://www.microsoft.com/en-us/download/details.aspx?id=48145

I then watched that installation fail with the same error as in the python 
installer.

>From the steps described here: http://stackoverflow.com/a/31536998

1. Copy the file "C:\ProgramData\Package 
Cache\FC6260C33678BB17FB8B88536C476B4015B7C5E9\packages\Patch\x64\Windows8.1-KB2999226-x64.msu"
 to c:\temp\

(Note: the guid in the path above is not the same as in the stack overflow 
answer. It seems it may vary)

2. From an elevated (important!) command prompt:

>cd c:\temp
>mkdir extracted
>wusa.exe Windows8.1-KB2999226-x64.msu /extract:extracted

(Make sure files are extracted to the new dir)

>dism.exe /Online /Add-Package 
>/PackagePath:extracted\Windows8.1-KB2999226-x64.cab

3. Run vc_redist.x64.exe again, and choose repair

4. Now, I could finally install Python (3.5.1)

--
nosy: +Joakim.Karlsson

___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue25157>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue25157] Installing Python 3.5.0 32bit on Windows 8.1 64bit system gives Error 0x80240017

2015-12-23 Thread Joakim Karlsson

Joakim Karlsson added the comment:

My previous fix works for me when I install for current user only. When I 
attempt to install for all users, I get an error stating that 
"api-ms-win-crt-runtime-I1-1-0.dll" is missing during the "Precompililng 
standard library" phase.

--

___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue25157>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue25157] Installing Python 3.5.0 32bit on Windows 8.1 64bit system gives Error 0x80240017

2015-12-23 Thread Joakim Karlsson

Joakim Karlsson added the comment:

...and I seem not to have a working installation even when installing for a 
single user. The installation completes without complaining, but running python 
ends up in an error message telling me that "api-ms-win-crt-heap-l1-1-0.dll" is 
missing.

--

___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue25157>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22411] Embedding Python on Windows

2015-01-10 Thread Joakim Karlsson

Joakim Karlsson added the comment:

Sounds reasonable.

It would also require that all third party packages supply a *_d.pyd version 
of any extensions.

Does setuptools and pip have any support for automatically creating debug 
versions of extensions with the correct naming scheme when creating wheels or 
compiling during installation? A (really shallow) search didn't find any info 
on this.

Anyway, thanks for stepping up and taking charge of the windows installers!

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22411
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22411] Embedding Python on Windows

2015-01-09 Thread Joakim Karlsson

Joakim Karlsson added the comment:

You shouldn't mix headers with and without the _DEBUG symbol defined. At least 
on some versions of MSVC this can lead to errors as some standard headers start 
referencing functions that are not available in both debug and release versions 
of the MSV C runtime.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22411
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22411] Embedding Python on Windows

2015-01-09 Thread Joakim Karlsson

Joakim Karlsson added the comment:

A complicating factor is that the debug and release versions of the dll:s seem 
to behave differently, which makes it hard to replace one with the other.

For instance, in dynload_win.c, the suffix of files looked for are _d.pyd in 
debug mode and .pyd in release mode. This causes python not to find any .pyd 
files if I link to the debug version.

This might be a separate issue, but it is tighly connected to this as the 
_DEBUG setting of the embedding app changes how the Python interpreter works.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22411
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22411] Embedding Python on Windows

2014-09-14 Thread Joakim Karlsson

New submission from Joakim Karlsson:

When I embed Python 3.4 in an existing app, I run in to a few issues when our 
app is built in debug mode. I build against the headers, libs and dlls that I 
get when installing python, I don't build python myself.

1. When I include python.h it will, via pyconfig.h, automatically attempt to 
link to python34_d.lib. This lib, along with its accompanying dll is not 
included in the python installation.

I'd rather explicitly link to the release lib than having header files 
implicitly selecting libs based on the _DEBUG flag. I ended up killing the 
#pragma comment(lib...) statements in pyconfig.h, and I can now link with the 
lib included.

2. Now when I build, I get a linker error telling me that '__imp__Py_RefTotal' 
and '__imp_Py_NegativeRefCount' cannot be found. This seems to be caused by 
Py_DEBUG being defined automatically in pyconfig.h as a result of _DEBUG being 
defined for my application. This causes the reference counting macros to use 
functionality that is only present in the debug version of python34.dll.

I ended up including pyconfig.h first, undefed Py_DEBUG, and then including 
python.h. This seems rather clunky.

Keeping with explicit is better than implicit, wouldn't it be better to 
having to explicitly link to the desired lib from the embedding app, and 
explicitly set Py_DEBUG without having it inferred from _DEBUG? 

That way the provided headers and libs would work right out of the box while 
still leaving me the option to get the debug behaviour if I need to.

--
components: Windows
messages: 226882
nosy: Joakim.Karlsson
priority: normal
severity: normal
status: open
title: Embedding Python on Windows
type: compile error
versions: Python 3.4

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22411
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14572] 2.7.3: sqlite module does not build on centos 5

2012-04-13 Thread Joakim Sernbrant

New submission from Joakim Sernbrant serb...@gmail.com:

Python-2.7.3/Modules/_sqlite/connection.c: In function ‘_pysqlite_set_result’:
Python-2.7.3/Modules/_sqlite/connection.c:552: error: ‘sqlite3_int64’ 
undeclared (first use in this function)

The centos 5 version of sqlite3 (sqlite-devel-3.3.6-5) does not export the type 
sqlite3_int64. 2.7.0 did build without problems.

Newer versions declare both sqlite3_int64 and sqlite_int64: 
http://www.sqlite.org/c3ref/int64.html

Patch:

diff --git a/Modules/_sqlite/connection.c b/Modules/_sqlite/connection.c
index 26678c7..a646513 100644
--- a/Modules/_sqlite/connection.c
+++ b/Modules/_sqlite/connection.c
@@ -549,7 +549,7 @@ void _pysqlite_set_result(sqlite3_context* context, 
PyObject* py_val)
 } else if (py_val == Py_None) {
 sqlite3_result_null(context);
 } else if (PyInt_Check(py_val)) {
-sqlite3_result_int64(context, (sqlite3_int64)PyInt_AsLong(py_val));
+sqlite3_result_int64(context, (sqlite_int64)PyInt_AsLong(py_val));
 } else if (PyLong_Check(py_val)) {
 sqlite3_result_int64(context, PyLong_AsLongLong(py_val));
 } else if (PyFloat_Check(py_val)) {
@@ -580,7 +580,7 @@ PyObject* _pysqlite_build_py_params(sqlite3_context 
*context, int argc, sqlite3_
 sqlite3_value* cur_value;
 PyObject* cur_py_value;
 const char* val_str;
-sqlite3_int64 val_int;
+sqlite_int64 val_int;
 Py_ssize_t buflen;
 void* raw_buffer;

--
components: Build
messages: 158238
nosy: Joakim.Sernbrant
priority: normal
severity: normal
status: open
title: 2.7.3: sqlite module does not build on centos 5
type: compile error
versions: Python 2.7

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14572
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1743] IDLE fails to launch

2008-01-07 Thread Joakim

Joakim added the comment:

I have the exact same problem also running 32-bit vista. 
Idle worked the first time I started it but after that it doesn't start.
I did run the command and got this error.

C:\Users\JoakimC:\Python25\python.exe C:\Python25\Lib\idle.py
C:\Python25\python.exe: can't open file 'C:\Python25\Lib\idle.py': 
[Errno 2] No such file or directory

I also not able to start the interpreter from cmd using the python 
command. I've looked around a bit and read something about adding to 
PATH. Haven't tried that because the guide wasn't written for Vista.

--
nosy: +Piffen

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1743
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1743] IDLE fails to launch

2008-01-07 Thread Joakim

Joakim added the comment:

I can access the file. I renamed the file and tried the command again.
Then I started IDLE and got a window. A new recent-files.lst was 
created. So I guess I solved the problem temporarily.

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1743
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com