This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 181102 - Encoding exception in setup.py
Summary: Encoding exception in setup.py
Status: RESOLVED FIXED
Alias: None
Product: python
Classification: Unclassified
Component: Options (show other bugs)
Version: 6.x
Hardware: Macintosh (x86) Mac OS X
: P4 normal (vote)
Assignee: vincentvdl
URL:
Keywords:
Depends on:
Blocks: 257461
  Show dependency tree
 
Reported: 2010-02-23 13:55 UTC by Neology
Modified: 2016-10-11 16:05 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Test patch 1 (python.editor) (1.63 KB, application/octet-stream)
2015-10-06 21:38 UTC, vincentvdl
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Neology 2010-02-23 13:55:42 UTC
Problem with the encoding : __date__ in setup.py (hidden file) can contain accents in french and so create an encoding exception. For this I need to change setup.py...
Comment 1 Lou Dasaro 2015-09-03 05:06:37 UTC
I believe it's valid, but should be downgraded to P2, and add keyword: 'I18N'.
Comments?
Comment 2 Lou Dasaro 2015-09-06 04:35:54 UTC
reassigned to Julien for review...
Comment 3 vincentvdl 2015-09-06 04:45:40 UTC
As I said on the forum, I am on holiday until the end of September and don't have access to a machine capable enough for NB development.

However here's my analysis: setup.py is an ordinary Python script. If a Python 2 script file contains non-ASCII characters it needs a "#encoding: XXXX" header.

So in my view, what should be done is to add the project encoding at the top in the Freemarker template. I have a patch ready that does this, but did not have a chance to test it thoroughly yet, so have not posted it yet.
Comment 4 Lou Dasaro 2015-09-07 18:12:42 UTC
My mistake. Marked as STARTED and reassigned back to Vincent, who will implement the fix when he returns from holiday. 8.1_DEFERRED until then...
Comment 5 Jenselme 2015-09-12 19:46:11 UTC
Just experienced a problem, I don't know if this is related but it looks like it:

If there is a non ascii character in setup(name='Blabla ï blabla'), nbpython fails to open the project.
Comment 6 vincentvdl 2015-10-06 21:38:08 UTC
Created attachment 156570 [details]
Test patch 1 (python.editor)

This adds "#encoding: <ENCODING>" to the remaining FreeMarker templates.

Hopefully this will fix this issue.
Comment 7 Lou Dasaro 2016-01-18 00:41:30 UTC
The patch works, but it always defaults to the O.S. default encoding e.g. on a Windows box it will insert "#encoding: windows-1252".

It was previously agreed that ALL projects will be created with "#encoding: utf-8"
The user can change it if they want...

Vincent, can you make this change and Push it?
Comment 8 Jenselme 2016-10-11 16:04:07 UTC
changeset:   18435:b36f70414d5e
user:        Julien Enselme <jenselme@netbeans.org>
date:        Sun Sep 25 16:46:29 2016 +0200
summary:     #181102 Set encoding in templates