public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug python/12285] New: printing gdb.Value with non-ascii bytes or unicode characters raise UnicodeErrors
@ 2010-12-03 10:08 markflorisson88 at gmail dot com
  2021-11-24 21:50 ` [Bug python/12285] " bugmenot at mailinator dot com
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: markflorisson88 at gmail dot com @ 2010-12-03 10:08 UTC (permalink / raw)
  To: gdb-prs

http://sourceware.org/bugzilla/show_bug.cgi?id=12285

           Summary: printing gdb.Value with non-ascii bytes or unicode
                    characters raise UnicodeErrors
           Product: gdb
           Version: 7.2
            Status: NEW
          Severity: normal
          Priority: P2
         Component: python
        AssignedTo: unassigned@sourceware.org
        ReportedBy: markflorisson88@gmail.com


(gdb) python print gdb.Value(u'\xff')
Traceback (most recent call last):
  File "<string>", line 1, in <module>
UnicodeEncodeError: 'ascii' codec can't encode character u'\xff' in position 1:
ordinal not in range(128)
Error while executing Python code.
(gdb) python print gdb.Value('\xff')
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/lib/python2.6/encodings/utf_8.py", line 16, in decode
    return codecs.utf_8_decode(input, errors, True)
UnicodeDecodeError: 'utf8' codec can't decode byte 0xff in position 0:
unexpected code byte
Error while executing Python code.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug python/12285] printing gdb.Value with non-ascii bytes or unicode characters raise UnicodeErrors
  2010-12-03 10:08 [Bug python/12285] New: printing gdb.Value with non-ascii bytes or unicode characters raise UnicodeErrors markflorisson88 at gmail dot com
@ 2021-11-24 21:50 ` bugmenot at mailinator dot com
  2021-11-29 12:01 ` aburgess at redhat dot com
  2022-06-05 16:07 ` tromey at sourceware dot org
  2 siblings, 0 replies; 4+ messages in thread
From: bugmenot at mailinator dot com @ 2021-11-24 21:50 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=12285

John Doe <bugmenot at mailinator dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bugmenot at mailinator dot com

--- Comment #1 from John Doe <bugmenot at mailinator dot com> ---
That definitely happened with GDB 9.2, too:

(gdb) show version
GNU gdb (GDB) 9.2
(gdb) python print (sys.version)
2.7.5 (default, Apr  2 2020, 13:16:51)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-39)]
(gdb) set python print-stack full
(gdb) python print (gdb.Value(u'\xff'))
Traceback (most recent call last):
  File "<string>", line 1, in <module>
UnicodeEncodeError: 'ascii' codec can't encode character u'\xff' in position 1:
ordinal not in range(128)
Error while executing Python code.


While it did not happen with 11.1 or 10.2 in my tests, I've seen

(gdb) python print (sys.version)
3.6.8 (default, Aug 24 2020, 17:57:11)
[GCC 8.3.1 20191121 (Red Hat 8.3.1-5)]

there - and when using GDB 8.2 on that machine the error does not occur either
Therefore I think this is either because of a change in Python 3.x related to
UTF-8 handling or it is a different piece of code in GDB that is adjusted for
Python 3.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug python/12285] printing gdb.Value with non-ascii bytes or unicode characters raise UnicodeErrors
  2010-12-03 10:08 [Bug python/12285] New: printing gdb.Value with non-ascii bytes or unicode characters raise UnicodeErrors markflorisson88 at gmail dot com
  2021-11-24 21:50 ` [Bug python/12285] " bugmenot at mailinator dot com
@ 2021-11-29 12:01 ` aburgess at redhat dot com
  2022-06-05 16:07 ` tromey at sourceware dot org
  2 siblings, 0 replies; 4+ messages in thread
From: aburgess at redhat dot com @ 2021-11-29 12:01 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=12285

Andrew Burgess <aburgess at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |aburgess at redhat dot com

--- Comment #2 from Andrew Burgess <aburgess at redhat dot com> ---
Can confirm that this issue is still present with current HEAD (61a5375b842)
when building with Python 2, but does not appear to be present when building
with Python 3.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug python/12285] printing gdb.Value with non-ascii bytes or unicode characters raise UnicodeErrors
  2010-12-03 10:08 [Bug python/12285] New: printing gdb.Value with non-ascii bytes or unicode characters raise UnicodeErrors markflorisson88 at gmail dot com
  2021-11-24 21:50 ` [Bug python/12285] " bugmenot at mailinator dot com
  2021-11-29 12:01 ` aburgess at redhat dot com
@ 2022-06-05 16:07 ` tromey at sourceware dot org
  2 siblings, 0 replies; 4+ messages in thread
From: tromey at sourceware dot org @ 2022-06-05 16:07 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=12285

Tom Tromey <tromey at sourceware dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |tromey at sourceware dot org
         Resolution|---                         |OBSOLETE

--- Comment #3 from Tom Tromey <tromey at sourceware dot org> ---
Now that Python 2 support is removed, I think we can close this bug.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-06-05 16:07 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-12-03 10:08 [Bug python/12285] New: printing gdb.Value with non-ascii bytes or unicode characters raise UnicodeErrors markflorisson88 at gmail dot com
2021-11-24 21:50 ` [Bug python/12285] " bugmenot at mailinator dot com
2021-11-29 12:01 ` aburgess at redhat dot com
2022-06-05 16:07 ` tromey at sourceware dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).