python fails to import sitecustomize.py due to encoding problem (Windows)

Bug #270551 reported by Jerzy Luszawski
2
Affects Status Importance Assigned to Milestone
GNUmed
Won't Fix
Low
Unassigned

Bug Description

Under Windows python recognizes encoding as 'ascii'. I modified sitecustomize.py to set it explicitely to 'cp1250'. It seemed not to work, so I tried to pin-point the problem and under python shell tried:

>>> import sitecustomize

and got following response:

Traceback (most recent call last):
  File "<pyshell#2>", line 1, in <module>
    import sitecustomize
  File "C:\Program Files\Python\lib\site-packages\sitecustomize.py", line 1
SyntaxError: encoding problem: utf-8 (sitecustomize.py, line 1)

First line was:
# -*- coding: utf8 -*
I completely removed first line and everything works, so it may be a simple workaround.
But I don't know if we should change the first line of sitecustomize.py or is it Python bug to report?

Changed in gnumed:
importance: Undecided → Low
Revision history for this message
ncq (karsten-hilbert) wrote :

That's a Windows bug. Use of sitecustomize.py is discouraged, too.

Changed in gnumed:
status: New → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.