[issue37377] unicode error should raise a value error

2019-06-23 Thread hai shi
hai shi added the comment: Got it, thank for your detailed explanation, steven. -- stage: -> resolved status: open -> closed ___ Python tracker ___

[issue37377] unicode error should raise a value error

2019-06-23 Thread Steven D'Aprano
Steven D'Aprano added the comment: It is a *syntax* error. You have written bad syntax, just as the error message says. Your \xXX code is too short, only 1 hex digit instead of 2. I disagree that this should be a value error: it isn't a bad value, it is bad syntax. I don't know what the

[issue37377] unicode error should raise a value error

2019-06-23 Thread hai shi
New submission from hai shi : >>> "\x1" File "", line 1 SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 0-2: truncated \xXX escape I think rasing the valueError would be exact.(pep223 agree this behavior: https://www.pytho

[issue24102] Multiple type confusions in unicode error handlers

2015-05-18 Thread Roundup Robot
Roundup Robot added the comment: New changeset 547bc11e3357 by Serhiy Storchaka in branch '2.7': Issue #24102: Fixed exception type checking in standard error handlers. https://hg.python.org/cpython/rev/547bc11e3357 New changeset 68eaa9409818 by Serhiy Storchaka in branch '3.4': Issue #24102:

[issue24102] Multiple type confusions in unicode error handlers

2015-05-18 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- versions: +Python 2.7 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24102 ___ ___

[issue24102] Multiple type confusions in unicode error handlers

2015-05-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Greg Ewing suggested to use PyObject_TypeCheck (http://permalink.gmane.org/gmane.comp.python.devel/153216). -- resolution: - fixed stage: patch review - resolved status: open - closed ___ Python tracker

Re: SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape

2015-05-12 Thread zljubisicmob
I would say so as well. Thanks to everyone who helped. Regards and best wishes. -- https://mail.python.org/mailman/listinfo/python-list

Re: SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape

2015-05-10 Thread zljubisicmob
It works, but if you change title = title[:232] to title = title[:233], you will get FileNotFoundError: [Errno 2] No such file or directory. Which is a *completely different* error from SyntaxError: 'unicodeescape' codec can't decode bytes in position 2-3: truncated \U escape

Re: SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape

2015-05-10 Thread zljubisicmob
No, we can't see what ROOTDIR is, since you read it from the config file. And you don't show us the results of those prints. You don't even show us the full exception, or even the line it fails on. Sorry I forgot. This is the output of the script: C:\Python34\python.exe

Re: SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape

2015-05-10 Thread Dave Angel
On 05/10/2015 05:10 PM, zljubisic...@gmail.com wrote: No, we can't see what ROOTDIR is, since you read it from the config file. And you don't show us the results of those prints. You don't even show us the full exception, or even the line it fails on. Sorry I forgot. This is the output of

Re: SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape

2015-05-09 Thread Dave Angel
On 05/09/2015 06:31 AM, zljubisic...@gmail.com wrote: title = title[:232] title = title.replace( , _).replace(/, _).replace(!, _).replace(?, _)\ .replace('', _).replace(':', _).replace(',', _).replace('#34;', '')\ .replace('\n', '_').replace('#39',

Re: SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape

2015-05-09 Thread zljubisicmob
Steven, please do look at the code bellow: # C:\Users\zoran\PycharmProjects\mm_align\hrt3.cfg contents # [Dir] # ROOTDIR = C:\Users\zoran\hrt import os import shutil import configparser import requests import re Config = configparser.ConfigParser() Config.optionxform = str # preserve case in

Re: SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape

2015-05-09 Thread Chris Angelico
On Sun, May 10, 2015 at 1:13 AM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: FileNotFoundError means that the program did run, it tried to open a file, but the file doesn't exist. Normally it does, at least. Sometimes it means that a *directory* doesn't exist (for instance, you

Re: SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape

2015-05-09 Thread Steven D'Aprano
On Sat, 9 May 2015 08:31 pm, zljubisic...@gmail.com wrote: It works, but if you change title = title[:232] to title = title[:233], you will get FileNotFoundError: [Errno 2] No such file or directory. Which is a *completely different* error from SyntaxError: 'unicodeescape' codec can't

SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape

2015-05-08 Thread zljubisicmob
:/Users/bckslash_test.py File C:/Users/bckslash_test.py, line 4 ROOTDIR = 'C:\Users' ^ SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \U escape Process finished with exit code 1 As I saw, I could solve the problem by changing

Re: SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape

2015-05-08 Thread MRAB
the following error: C:\Python34\python.exe C:/Users/bckslash_test.py File C:/Users/bckslash_test.py, line 4 ROOTDIR = 'C:\Users' ^ SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \U escape Process finished with exit

Re: SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape

2015-05-08 Thread random832
On Fri, May 8, 2015, at 15:00, zljubisic...@gmail.com wrote: As I saw, I could solve the problem by changing line 4 to (small letter r before string: ROOTDIR = r'C:\Users\zoran' but that is not an option for me because I am using configparser in order to read the ROOTDIR from underlying cfg

Re: SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape

2015-05-08 Thread zljubisicmob
Thanks for clarifying. Looks like the error message was wrong. On windows ntfs I had a file name more than 259 characters which is widows limit. After cutting file name to 259 characters everything works as it should. If I cut file name to 260 characters I get the error from subject which is

Re: SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape

2015-05-08 Thread Steven D'Aprano
containing \U is an escape sequence which expects exactly 8 hexadecimal digits to follow: py path = '\U00a7' py print(path) § If you don't follow the \U with eight hex digits, you get an error: py path = '\Users' File stdin, line 1 SyntaxError: (unicode error

Re: SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape

2015-05-08 Thread Chris Angelico
On Sat, May 9, 2015 at 5:00 AM, zljubisic...@gmail.com wrote: But it returns the following error: C:\Python34\python.exe C:/Users/bckslash_test.py File C:/Users/bckslash_test.py, line 4 ROOTDIR = 'C:\Users' ^ SyntaxError: (unicode error) 'unicodeescape' codec can't

[issue24102] Multiple type confusions in unicode error handlers

2015-05-04 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Also fixed handling errors of PyObject_IsSubclass() (issue24115) in the _codecs module. -- Added file: http://bugs.python.org/file39287/codecs_error_handlers_issubclass_3.patch ___ Python tracker

[issue24102] Multiple type confusions in unicode error handlers

2015-05-03 Thread Arfrever Frehtes Taifersar Arahesis
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com: -- nosy: +Arfrever ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24102 ___

[issue24102] Multiple type confusions in unicode error handlers

2015-05-02 Thread Walter Dörwald
Walter Dörwald added the comment: The patch does indeed fix the segmentation fault. However the exception message looks confusing: TypeError: don't know how to handle UnicodeEncodeError in error callback -- ___ Python tracker

[issue24102] Multiple type confusions in unicode error handlers

2015-05-02 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Py_TYPE() is necessary when the argument is not of type PyObject* (e.g. PyUnicodeObject*). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24102 ___

[issue24102] Multiple type confusions in unicode error handlers

2015-05-02 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Here is a patch that makes error message consistent with type checking. -- Added file: http://bugs.python.org/file39266/codecs_error_handlers_issubclass_2.patch ___ Python tracker rep...@bugs.python.org

[issue24102] Multiple type confusions in unicode error handlers

2015-05-02 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- keywords: +patch Added file: http://bugs.python.org/file39265/codecs_error_handlers_issubclass.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24102

[issue24102] Multiple type confusions in unicode error handlers

2015-05-02 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Here is simpler reproducer: import codecs class X(str): __class__ = UnicodeEncodeError codecs.ignore_errors(X()) The problem is that PyObject_IsInstance() is fooled by custom __class__, but then builtin error handlers handle error object as having

[issue24102] Multiple type confusions in unicode error handlers

2015-05-02 Thread Walter Dörwald
Walter Dörwald added the comment: Looks much better. However shouldn't: exc-ob_type-tp_name be: Py_TYPE(exc)-tp_name (although there are still many spots in the source that still use ob_type-tp_name) -- ___ Python tracker

[issue24102] Multiple type confusions in unicode error handlers

2015-05-01 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- components: +Interpreter Core, Unicode nosy: +doerwalter, ezio.melotti, haypo, lemburg, serhiy.storchaka ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24102

[issue24102] Multiple type confusions in unicode error handlers

2015-05-01 Thread paul
. -- files: poc_unicode_errors.py messages: 242319 nosy: pkt priority: normal severity: normal status: open title: Multiple type confusions in unicode error handlers type: crash versions: Python 3.4 Added file: http://bugs.python.org/file39253/poc_unicode_errors.py

[issue24102] Multiple type confusions in unicode error handlers

2015-05-01 Thread Christian Heimes
Changes by Christian Heimes li...@cheimes.de: -- components: +Extension Modules nosy: +christian.heimes stage: - needs patch versions: +Python 3.5 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24102

[issue17429] platform.platform() can throw Unicode error

2013-12-08 Thread Roundup Robot
Roundup Robot added the comment: New changeset 4580976c07cb by Victor Stinner in branch '3.3': Issue #17429: platform.linux_distribution() now decodes files from the UTF-8 http://hg.python.org/cpython/rev/4580976c07cb New changeset 407f18c8ce8a by Victor Stinner in branch 'default': (Merge 3.3)

[issue17429] platform.platform() can throw Unicode error

2013-12-08 Thread Roundup Robot
Roundup Robot added the comment: New changeset 831b2c80a9c9 by Victor Stinner in branch 'default': Issue #17429: some PEP 8 compliance fixes for the platform modules, add whitespaces http://hg.python.org/cpython/rev/831b2c80a9c9 -- ___ Python

[issue17429] platform.platform() can throw Unicode error

2013-12-08 Thread STINNER Victor
STINNER Victor added the comment: Thanks Toshio Kuratomi for your patch. I simplified the unit test. I'm not sure that resetlocale restores the locale in its previous state. I don't want to rely on two specific locales ('pt_BR.UTF8' and 'pt_BR.ISO8859-1') for a such simple test. We have

[issue17429] platform.platform() can throw Unicode error

2013-12-08 Thread Roundup Robot
Roundup Robot added the comment: New changeset a951ab03bda0 by Victor Stinner in branch '3.3': Issue #17429: Oops, remove unused import http://hg.python.org/cpython/rev/a951ab03bda0 New changeset 209bf9576dc8 by Victor Stinner in branch 'default': (Merge 3.3) Issue #17429: Oops, remove unused

[issue17429] platform.platform() can throw Unicode error

2013-12-08 Thread STINNER Victor
Changes by STINNER Victor victor.stin...@gmail.com: -- resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17429 ___

[issue17429] platform.platform() can throw Unicode error

2013-10-18 Thread STINNER Victor
STINNER Victor added the comment: Ping myself, I just installed Fedora 19 and I cannot run the Python test suite with the ASCII locale encoding, because of this bug. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17429

API for custom Unicode error handlers

2013-10-04 Thread Steven D'Aprano
I have some custom Unicode error handlers, and I'm looking for advice on the right API for dealing with them. I have a module containing custom Unicode error handlers. For example: # Python 3 import unicodedata def namereplace_errors(exc): c = exc.object[exc.start] try: name

Re: API for custom Unicode error handlers

2013-10-04 Thread Chris Angelico
On Fri, Oct 4, 2013 at 11:56 PM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: Should the module holding the error handlers automatically register them? In other words, if I do: import error_handlers just importing it will have the side-effect of registering the error

Re: API for custom Unicode error handlers

2013-10-04 Thread Ethan Furman
On 10/04/2013 06:56 AM, Steven D'Aprano wrote: Should the module holding the error handlers automatically register them? I think it should. Registration only needs to happen once, the module is useless without being registered, no threads nor processes are being started, and the only reason

Re: API for custom Unicode error handlers

2013-10-04 Thread Serhiy Storchaka
04.10.13 20:22, Chris Angelico написав(ла): I'd be quite happy with importing having a side-effect here. If you import a module that implements a numeric type, it should immediately register itself with the Numeric ABC, right? This is IMO equivalent to that. There is a difference. You can't

Re: API for custom Unicode error handlers

2013-10-04 Thread Serhiy Storchaka
04.10.13 16:56, Steven D'Aprano написав(ла): I have some custom Unicode error handlers, and I'm looking for advice on the right API for dealing with them. I have a module containing custom Unicode error handlers. For example: # Python 3 import unicodedata def namereplace_errors(exc): c

Re: API for custom Unicode error handlers

2013-10-04 Thread Terry Reedy
On 10/4/2013 3:35 PM, Serhiy Storchaka wrote: 04.10.13 16:56, Steven D'Aprano написав(ла): I have some custom Unicode error handlers, and I'm looking for advice on the right API for dealing with them. I'm planning to built this error handler in 3.4 (see http://comments.gmane.org

[issue17429] platform.platform() can throw Unicode error

2013-03-25 Thread Toshio Kuratomi
Toshio Kuratomi added the comment: Patch fixing the issues raised in r.david.murray's review: * Merged _find_linux_release_file() back into linux_distribution() and broke out _UNIXCONFDIR module level variable to enable mocking of the unittest data * Fix already present style issue in

[issue17429] platform.platform() can throw Unicode error

2013-03-21 Thread R. David Murray
R. David Murray added the comment: Review comments added. -- nosy: +r.david.murray stage: - patch review type: - behavior versions: +Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17429

[issue17429] platform.platform() can throw Unicode error

2013-03-20 Thread Toshio Kuratomi
Toshio Kuratomi added the comment: Okay, new version of the patch with a unittest. Re: os-release; I don't believe the current code can handle that file. i\It changes format from a simple string (in most Linux distros) to key value pairs. We'll probably need an update to the code to deal

[issue17429] platform.platform() can throw Unicode error

2013-03-20 Thread Toshio Kuratomi
Toshio Kuratomi added the comment: Added NEWS file. Rebased against hg default. Ready for review. -- Added file: http://bugs.python.org/file29509/00175-platform-unicode.patch ___ Python tracker rep...@bugs.python.org

[issue17429] platform.platform() can throw Unicode error

2013-03-19 Thread Zbyszek Jędrzejewski-Szmek
Zbyszek Jędrzejewski-Szmek added the comment: At least for /etc/os-release, which is slated to replace /etc/fedora-release and other distribution specific files, the encoding in mandated to be UTF-8: http://www.freedesktop.org/software/systemd/man/os-release.html All strings should be in

[issue17429] platform.platform() can throw Unicode error

2013-03-16 Thread STINNER Victor
STINNER Victor added the comment: 00175-platform-unicode.patch looks good to me, but it lacks an unit test. -- nosy: +haypo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17429 ___

[issue17429] platform.platform() can throw Unicode error

2013-03-16 Thread Toshio Kuratomi
Toshio Kuratomi added the comment: I'm at pycon. I'll find someone during the sprints to teach me how the unittests are organized. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17429

[issue17429] platform.platform() can throw Unicode error

2013-03-15 Thread Toshio Kuratomi
these that we're promoting in python3 is to use surrogateescape. I'll provide a patch that does that. -- messages: 184234 nosy: a.badger priority: normal severity: normal status: open title: platform.platform() can throw Unicode error versions: Python 3.2, Python 3.3

[issue17429] platform.platform() can throw Unicode error

2013-03-15 Thread Toshio Kuratomi
Changes by Toshio Kuratomi a.bad...@gmail.com: -- keywords: +patch Added file: http://bugs.python.org/file29416/00175-platform-unicode.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17429

[issue17429] platform.platform() can throw Unicode error

2013-03-15 Thread Martin v . Löwis
Martin v. Löwis added the comment: What's the most likely encoding? UTF-8? I suggest we assume UTF-8, and use the surrogate-escape error handler to deal with the cases when it isn't. -- nosy: +loewis ___ Python tracker rep...@bugs.python.org

[issue17429] platform.platform() can throw Unicode error

2013-03-15 Thread Toshio Kuratomi
Toshio Kuratomi added the comment: I agree. In my experience, utf-8 is the most common encoding. Updated patch that defaults to utf-8 instead of the user's locale is attached. -- Added file: http://bugs.python.org/file29420/00175-platform-unicode.patch

Re: Right solution to unicode error?

2012-11-09 Thread wxjmfauth
Le jeudi 8 novembre 2012 21:42:58 UTC+1, Ian a écrit : On Thu, Nov 8, 2012 at 12:54 PM, wxjmfa...@gmail.com wrote: Font has nothing to do here. You are simply wrongly encoding your unicode. '\u2013' '–' '\u2013'.encode('utf-8') b'\xe2\x80\x93'

Re: Right solution to unicode error?

2012-11-08 Thread wxjmfauth
Le mercredi 7 novembre 2012 23:17:42 UTC+1, Anders a écrit : I've run into a Unicode error, and despite doing some googling, I can't figure out the right way to fix it. I have a Python 2.6 script that reads my Outlook 2010 task list. I'm able to read the tasks from Outlook and store them

Re: Right solution to unicode error?

2012-11-08 Thread Hans Mulder
On 8/11/12 00:53:49, Steven D'Aprano wrote: This error confuses me. Is that an exact copy and paste of the error, or have you edited it or reconstructed it? Because it seems to me that if task.subject is a unicode string, as it appears to be, calling print on it should succeed: py s =

RE: Right solution to unicode error?

2012-11-08 Thread Anders Schneiderman
Thanks, Oscar and Ramit! This is exactly what I was looking for. Anders -Original Message- From: Oscar Benjamin [mailto:oscar.j.benja...@gmail.com] Sent: Wednesday, November 07, 2012 6:27 PM To: Anders Schneiderman Cc: python-list@python.org Subject: Re: Right solution to unicode

Re: Right solution to unicode error?

2012-11-08 Thread Oscar Benjamin
On 8 November 2012 00:44, Oscar Benjamin oscar.j.benja...@gmail.com wrote: On 7 November 2012 23:51, Andrew Berg bahamutzero8...@gmail.com wrote: On 2012.11.07 17:27, Oscar Benjamin wrote: Are you using cmd.exe (standard Windows terminal)? If so, it does not support unicode Actually, it does.

Re: Right solution to unicode error?

2012-11-08 Thread wxjmfauth
Le jeudi 8 novembre 2012 15:07:23 UTC+1, Oscar Benjamin a écrit : On 8 November 2012 00:44, Oscar Benjamin oscar.j.benja...@gmail.com wrote: On 7 November 2012 23:51, Andrew Berg bahamutzero8...@gmail.com wrote: On 2012.11.07 17:27, Oscar Benjamin wrote: Are you using cmd.exe

Re: Right solution to unicode error?

2012-11-08 Thread Oscar Benjamin
On 8 November 2012 15:05, wxjmfa...@gmail.com wrote: Le jeudi 8 novembre 2012 15:07:23 UTC+1, Oscar Benjamin a écrit : On 8 November 2012 00:44, Oscar Benjamin oscar.j.benja...@gmail.com wrote: On 7 November 2012 23:51, Andrew Berg bahamutzero8...@gmail.com wrote: On 2012.11.07 17:27, Oscar

Re: Right solution to unicode error?

2012-11-08 Thread Ian Kelly
On Thu, Nov 8, 2012 at 11:32 AM, Oscar Benjamin oscar.j.benja...@gmail.com wrote: If I want the other characters to work I need to change the code page: O:\chcp 65001 Active code page: 65001 O:\Q:\tools\Python33\python -c import sys; sys.stdout.buffer.write('\u03b1\n'.encode('utf-8')) α

Re: Right solution to unicode error?

2012-11-08 Thread wxjmfauth
Le jeudi 8 novembre 2012 19:32:14 UTC+1, Oscar Benjamin a écrit : On 8 November 2012 15:05, wxjmfa...@gmail.com wrote: Le jeudi 8 novembre 2012 15:07:23 UTC+1, Oscar Benjamin a écrit : On 8 November 2012 00:44, Oscar Benjamin oscar.j.benja...@gmail.com wrote: On 7 November 2012

Re: Right solution to unicode error?

2012-11-08 Thread wxjmfauth
Le jeudi 8 novembre 2012 19:49:24 UTC+1, Ian a écrit : On Thu, Nov 8, 2012 at 11:32 AM, Oscar Benjamin oscar.j.benja...@gmail.com wrote: If I want the other characters to work I need to change the code page: O:\chcp 65001 Active code page: 65001

Re: Right solution to unicode error?

2012-11-08 Thread Ian Kelly
On Thu, Nov 8, 2012 at 12:54 PM, wxjmfa...@gmail.com wrote: Font has nothing to do here. You are simply wrongly encoding your unicode. '\u2013' '–' '\u2013'.encode('utf-8') b'\xe2\x80\x93' '\u2013'.encode('utf-8').decode('cp1252') '–' No, it seriously is the font. This is what I get

RE: Right solution to unicode error?

2012-11-08 Thread Prasad, Ramit
wxjmfa...@gmail.com wrote: Le jeudi 8 novembre 2012 19:49:24 UTC+1, Ian a écrit : On Thu, Nov 8, 2012 at 11:32 AM, Oscar Benjamin oscar.j.benja...@gmail.com wrote: If I want the other characters to work I need to change the code page: O:\chcp 65001 Active code page: 65001

Re: Right solution to unicode error?

2012-11-08 Thread Ian Kelly
On Thu, Nov 8, 2012 at 1:54 PM, Prasad, Ramit ramit.pra...@jpmorgan.com wrote: Why would font not matter? Unicode is the abstract definition of all characters right? From that we map the abstract character to a code page/set, which gives real values for an abstract character. From that code

Re: Right solution to unicode error?

2012-11-08 Thread Oscar Benjamin
On 8 November 2012 19:54, wxjmfa...@gmail.com wrote: Le jeudi 8 novembre 2012 19:49:24 UTC+1, Ian a écrit : On Thu, Nov 8, 2012 at 11:32 AM, Oscar Benjamin oscar.j.benja...@gmail.com wrote: If I want the other characters to work I need to change the code page: O:\chcp 65001 Active

Re: Right solution to unicode error?

2012-11-08 Thread Andrew Berg
On 2012.11.08 08:06, Oscar Benjamin wrote: It would be a lot better though if it just worked straight away without me needing to set the code page (like the terminal in every other OS I use). The crude equivalent of .bashrc/.zshrc/whatever shell startup script for cmd is setting a string value

Right solution to unicode error?

2012-11-07 Thread Anders
I've run into a Unicode error, and despite doing some googling, I can't figure out the right way to fix it. I have a Python 2.6 script that reads my Outlook 2010 task list. I'm able to read the tasks from Outlook and store them as a list of objects without a hitch. But when I try to print

RE: Right solution to unicode error?

2012-11-07 Thread Prasad, Ramit
Anders wrote: I've run into a Unicode error, and despite doing some googling, I can't figure out the right way to fix it. I have a Python 2.6 script that reads my Outlook 2010 task list. I'm able to read the tasks from Outlook and store them as a list of objects without a hitch. But when I

Re: Right solution to unicode error?

2012-11-07 Thread Oscar Benjamin
On 7 November 2012 22:17, Anders aschneider...@asha.org wrote: Traceback (most recent call last): File outlook_tasks.py, line 66, in module my_tasks.dump_today_tasks() File C:\Users\Anders\code\Task List\tasks.py, line 29, in dump_today_tasks print task.subject

Re: Right solution to unicode error?

2012-11-07 Thread Andrew Berg
On 2012.11.07 17:27, Oscar Benjamin wrote: Are you using cmd.exe (standard Windows terminal)? If so, it does not support unicode Actually, it does. Code page 65001 is UTF-8. I know that doesn't help the OP since Python versions below 3.3 don't support cp65001, but I think it's important to point

Re: Right solution to unicode error?

2012-11-07 Thread Steven D'Aprano
On Wed, 07 Nov 2012 14:17:42 -0800, Anders wrote: I've run into a Unicode error, and despite doing some googling, I can't figure out the right way to fix it. I have a Python 2.6 script that reads my Outlook 2010 task list. I'm able to read the tasks from Outlook and store them as a list

Re: Right solution to unicode error?

2012-11-07 Thread Oscar Benjamin
On 7 November 2012 23:51, Andrew Berg bahamutzero8...@gmail.com wrote: On 2012.11.07 17:27, Oscar Benjamin wrote: Are you using cmd.exe (standard Windows terminal)? If so, it does not support unicode Actually, it does. Code page 65001 is UTF-8. I know that doesn't help the OP since Python

[issue1028] Tkinter binding involving Control-spacebar raises unicode error

2012-06-04 Thread Mike Perry
Mike Perry m...@cogsmos.com added the comment: Looking good in 3.2.3! Tested on Debian Wheezy using packages python3-tk 3.2.3-1 and idle3 3.2.3~rc1-2. /*  * Mike Perry  * m...@cogscom  */ On Sun, May 27, 2012 at 4:10 PM, Terry J. Reedy rep...@bugs.python.org wrote: Terry J. Reedy

[issue1028] Tkinter binding involving Control-spacebar raises unicode error

2012-05-27 Thread Terry J. Reedy
Terry J. Reedy tjre...@udel.edu added the comment: On Win 7, acntl-space brings up the box on all the latest releases: 2.7.3, 3.2.3, and 3.3.0a3. (These all come with recent tk 8.5.x.) Mike, please retest with 3.2.3 and specify os and tk version and exactly what you entered if there is still

Why are some unicode error handlers encode only?

2012-03-11 Thread Steven D'Aprano
At least two standard error handlers are documented as working for encoding only: xmlcharrefreplace backslashreplace See http://docs.python.org/library/codecs.html#codec-base-classes and http://docs.python.org/py3k/library/codecs.html Why is this? I don't see why they shouldn't work for

Re: Why are some unicode error handlers encode only?

2012-03-11 Thread Walter Dörwald
On 11.03.12 15:37, Steven D'Aprano wrote: At least two standard error handlers are documented as working for encoding only: xmlcharrefreplace backslashreplace See http://docs.python.org/library/codecs.html#codec-base-classes and http://docs.python.org/py3k/library/codecs.html Why is this? I

Re: Why are some unicode error handlers encode only?

2012-03-11 Thread Terry Reedy
On 3/11/2012 10:37 AM, Steven D'Aprano wrote: At least two standard error handlers are documented as working for encoding only: xmlcharrefreplace backslashreplace See http://docs.python.org/library/codecs.html#codec-base-classes and http://docs.python.org/py3k/library/codecs.html Why is

[issue1028] Tkinter binding involving Control-spacebar raises unicode error

2012-02-12 Thread Mike Perry
Mike Perry m...@cogsmos.com added the comment: Hello, I am still able to reproduce this issue with Python 3.2.2. It seems as if this bug was closed with a the note: r70039 3.1 forward ported 3.2 default. Will be in 3.2.1. This leads me to believe that either 3.2.2 has a regression or the

[issue1028] Tkinter binding involving Control-spacebar raises unicode error

2012-02-12 Thread Mike Perry
Mike Perry m...@cogsmos.com added the comment: Figured I should capture the exception. See below. 3.2.2+ (default, Jan 8 2012, 07:22:26) [GCC 4.6.2] Traceback (most recent call last): File /usr/bin/idle3, line 5, in module main() File /usr/lib/python3.2/idlelib/PyShell.py, line 1429,

[issue13232] Logging: Unicode Error

2011-10-24 Thread Roundup Robot
Roundup Robot devn...@psf.upfronthosting.co.za added the comment: New changeset 4bb1dc4e2cec by Vinay Sajip in branch '2.7': Closes #13232: Handle multiple encodings in exception logging. http://hg.python.org/cpython/rev/4bb1dc4e2cec -- nosy: +python-dev resolution: - fixed stage: test

[issue13232] Logging: Unicode Error

2011-10-21 Thread Thomas Guettler
Changes by Thomas Guettler guet...@thomas-guettler.de: Added file: http://bugs.python.org/file23486/unicodedecodeerror-in-logging.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13232 ___

[issue13232] Logging: Unicode Error

2011-10-21 Thread Thomas Guettler
Thomas Guettler guet...@thomas-guettler.de added the comment: I attached a testcase (unicodedecodeerror-in-logging.py). If the filesystemencoding is UTF-8 and the source code is encoded in latin1, then the logging fails. It happens because there is a German umlaut in the comment behind 1/0.

[issue13232] Logging: Unicode Error

2011-10-20 Thread Thomas Guettler
: open title: Logging: Unicode Error versions: Python 2.7 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13232 ___ ___ Python-bugs-list mailing list Unsubscribe

[issue13232] Logging: Unicode Error

2011-10-20 Thread Vinay Sajip
Vinay Sajip vinay_sa...@yahoo.co.uk added the comment: Can you tell me what the actual data was which failed to be decoded? Is there more than one encoding in effect (e.g. one for the filesystem, and another for the other data in the exception being logged)? -- nosy: +vinay.sajip

[issue13232] Logging: Unicode Error

2011-10-20 Thread Ezio Melotti
Changes by Ezio Melotti ezio.melo...@gmail.com: -- nosy: +ezio.melotti stage: - test needed type: - behavior ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13232 ___

[issue13232] Logging: Unicode Error

2011-10-20 Thread STINNER Victor
Changes by STINNER Victor victor.stin...@haypocalc.com: -- nosy: +haypo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13232 ___ ___

[issue1028] Tkinter binding involving Control-spacebar raises unicode error

2011-05-11 Thread Roundup Robot
Roundup Robot devnull@devnull added the comment: New changeset 82cfbe2ddfbb by Kurt B. Kaiser in branch '3.1': Issue #1028: Tk returns invalid Unicode null in %A: UnicodeDecodeError. http://hg.python.org/cpython/rev/82cfbe2ddfbb -- nosy: +python-dev

[issue1028] Tkinter binding involving Control-spacebar raises unicode error

2011-05-11 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: I'm working on #2857 which adds the Modified UTF-8 (utf-8-java?) codec to Python. We can maybe use it instead of raising an error in 3.3? -- nosy: +haypo ___ Python tracker

[issue1028] Tkinter binding involving Control-spacebar raises unicode error

2011-05-11 Thread Kurt B. Kaiser
Kurt B. Kaiser k...@shore.net added the comment: r70039 3.1 forward ported 3.2 default. Will be in 3.2.1. -- resolution: accepted - fixed stage: patch review - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org

[issue1028] Tkinter binding involving Control-spacebar raises unicode error

2011-05-11 Thread Kurt B. Kaiser
Kurt B. Kaiser k...@shore.net added the comment: Having a modified utf-8 codec will be useful. That said, it is an error for Tcl/Tk to expose modified utf-8 externally, and that was fixed at some point in Tk8.5. Since Tk is no longer sending 0xC080 for the %A char, switching codecs in

[issue1028] Tkinter binding involving Control-spacebar raises unicode error

2011-05-10 Thread Kurt B. Kaiser
Kurt B. Kaiser k...@shore.net added the comment: Tcl/Tk uses modified utf-8 internally. This includes using 0xC080, a multibyte Unicode null character, for embedded nulls that work with C's null terminated strings. Java does the same. Note that typing Ctrl-space and Ctrl-2 are conventional

[issue1028] Tkinter binding involving Control-spacebar raises unicode error

2011-04-10 Thread R. David Murray
R. David Murray rdmur...@bitdance.com added the comment: Nudge: report on the Ubuntu bug tracker that this is still an issue with 3.2: https://bugs.launchpad.net/bugs/517552 -- nosy: +r.david.murray versions: +Python 3.2, Python 3.3 ___ Python

[issue1028] Tkinter binding involving Control-spacebar raises unicode error

2011-02-12 Thread Georg Brandl
Changes by Georg Brandl ge...@python.org: -- assignee: kbk - ned.deily nosy: +ned.deily ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1028 ___ ___

[issue1028] Tkinter binding involving Control-spacebar raises unicode error

2011-02-11 Thread Michael Strein
Michael Strein mgstr...@gmail.com added the comment: Do we know the status of this issue? Have not seen update in four months. Currently is a major headache on my linux box. -- nosy: +mgstrein ___ Python tracker rep...@bugs.python.org

Re: Unicode error in sax parser

2011-02-09 Thread Rickard Lindberg
On Tue, Feb 8, 2011 at 5:41 PM, Chris Rebert c...@rebertia.com wrote: Here is a bash script to reproduce my error: Including the error message and traceback is still helpful, for future reference. Thanks for pointing it out.    #!/bin/sh    cat å.timeline EOF snip    EOF    python

Re: Unicode error in sax parser

2011-02-09 Thread Stefan Behnel
Rickard Lindberg, 09.02.2011 09:32: On Tue, Feb 8, 2011 at 5:41 PM, Chris Rebertc...@rebertia.com wrote: Here is a bash script to reproduce my error: Including the error message and traceback is still helpful, for future reference. Thanks for pointing it out. #!/bin/sh cat

Re: Unicode error in sax parser

2011-02-09 Thread Stefan Behnel
Stefan Behnel, 09.02.2011 09:58: Rickard Lindberg, 09.02.2011 09:32: On Tue, Feb 8, 2011 at 5:41 PM, Chris Rebertc...@rebertia.com wrote: Here is a bash script to reproduce my error: Including the error message and traceback is still helpful, for future reference. Thanks for pointing it

  1   2   3   >