/[thuban]/branches/WIP-pyshapelib-bramz/Thuban/Model/proj.py
ViewVC logotype

Diff of /branches/WIP-pyshapelib-bramz/Thuban/Model/proj.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2698 by bernhard, Mon Sep 18 00:56:26 2006 UTC revision 2708 by bernhard, Sun Sep 24 20:01:23 2006 UTC
# Line 35  def _do_we_have_to_work_around_broken_pr Line 35  def _do_we_have_to_work_around_broken_pr
35          proj = BaseProjection(params)          proj = BaseProjection(params)
36          result2 = proj.Forward(1,1)          result2 = proj.Forward(1,1)
37    
38          locale.setlocale(locale.LC_NUMERIC, savedlocale)          try:
39                locale.setlocale(locale.LC_NUMERIC, savedlocale)
40            except:
41                # python under some circumstances (observed 2.3.5-2 Debian Sarge)
42                # does not accept savedlocale directly
43                # deviating from the documentation
44                locale.setlocale(locale.LC_NUMERIC, savedlocale[0])
45          if result1 != result2:          if result1 != result2:
46              return True              return True
47      return False      return False
# Line 43  def _do_we_have_to_work_around_broken_pr Line 49  def _do_we_have_to_work_around_broken_pr
49  class Projection(BaseProjection):  class Projection(BaseProjection):
50      """A proj4 projection object that remembers the parameters.      """A proj4 projection object that remembers the parameters.
51    
52      Note: it seems that calling      The proj library is not robust against decimal_point != '.' locales.
53        Since python 2.4 calls C extensions with the set locale, it can create
54        a problem.  It seems that calling
55          self.assuregoodlocale()          self.assuregoodlocale()
56          self.assureinitlocale()          self.assureinitlocale()
57      before BaseProjection.__init__() is enough to work around the bug.      before BaseProjection.__init__() is enough to work around this.
58    
59      We assuming that the locale stays the same after a projection      We assuming that the locale stays the same after a projection
60      has been initialised      has been initialised

Legend:
Removed from v.2698  
changed lines
  Added in v.2708

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26