[Python-modules-commits] [osmalchemy] 06/10: Import osmalchemy_0.1.+2.orig.tar.gz

Dominik George natureshadow-guest at moszumanska.debian.org
Fri Oct 14 15:11:24 UTC 2016


This is an automated email from the git hooks/post-receive script.

natureshadow-guest pushed a commit to branch master
in repository osmalchemy.

commit 0f0b05e7b2f73698d58e69ebe0af6e99f0874b10
Author: Dominik George <nik at naturalnet.de>
Date:   Fri Oct 14 16:32:50 2016 +0200

    Import osmalchemy_0.1.+2.orig.tar.gz
---
 CHANGELOG                    |  6 ++++++
 OSMAlchemy.egg-info/PKG-INFO |  2 +-
 PKG-INFO                     |  2 +-
 osmalchemy/__init__.py       |  2 +-
 osmalchemy/util/db.py        | 10 +++++++---
 test/test_model.py           |  2 +-
 test/test_util_db.py         |  2 +-
 7 files changed, 18 insertions(+), 8 deletions(-)

diff --git a/CHANGELOG b/CHANGELOG
index 4694ec6..c9ff905 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,6 +1,12 @@
 Changelog for OSMAlchemy
 ========================
 
+0.1.2
+-----
+
+ * Ensure working with utf-8 everywhere
+    + Fixes execution under non-utf-8 locales
+
 0.1.1.post2
 -----------
 
diff --git a/OSMAlchemy.egg-info/PKG-INFO b/OSMAlchemy.egg-info/PKG-INFO
index 8e5938f..235c1b8 100644
--- a/OSMAlchemy.egg-info/PKG-INFO
+++ b/OSMAlchemy.egg-info/PKG-INFO
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: OSMAlchemy
-Version: 0.1.1.post2
+Version: 0.1.2
 Summary: OpenStreetMap to SQLAlchemy bridge
 Home-page: https://github.com/Veripeditus/OSMAlchemy
 Author: Dominik George, Eike Tim Jesinghaus
diff --git a/PKG-INFO b/PKG-INFO
index 8e5938f..235c1b8 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: OSMAlchemy
-Version: 0.1.1.post2
+Version: 0.1.2
 Summary: OpenStreetMap to SQLAlchemy bridge
 Home-page: https://github.com/Veripeditus/OSMAlchemy
 Author: Dominik George, Eike Tim Jesinghaus
diff --git a/osmalchemy/__init__.py b/osmalchemy/__init__.py
index c9b6f4e..d8d2f50 100644
--- a/osmalchemy/__init__.py
+++ b/osmalchemy/__init__.py
@@ -1,7 +1,7 @@
 # ~*~~ coding: utf-8 ~*~
 
 # Define the version of OSMAlchemy
-__version__ = "0.1.1.post2"
+__version__ = "0.1.2"
 
 # Monkey patch SQLAlchemy to support some query constructs
 from .util.patch import monkey_patch_sqlalchemy, monkey_patch_flask_restless
diff --git a/osmalchemy/util/db.py b/osmalchemy/util/db.py
index 47ae4c8..9435544 100644
--- a/osmalchemy/util/db.py
+++ b/osmalchemy/util/db.py
@@ -199,14 +199,18 @@ def _import_osm_file(oa, file, session=None):
     """ Import a file in OSM XML format into an OSMAlchemy model.
 
       oa - reference to the OSMAlchemy model instance
-      path - path to the file to import or open file object
+      file - path to the file to import or open file object
     """
 
     # Get session
     if session is None:
         session = oa.session
 
-    # Parse document into DOM structure
-    dom = minidom.parse(file)
+    # Parse file
+    if isinstance(file, str):
+        with open(file, "r", encoding="utf-8") as f:
+            dom = minidom.parse(f)
+    else:
+        dom = minidom.parse(file)
 
     return _import_osm_dom(oa, dom, session=session)
diff --git a/test/test_model.py b/test/test_model.py
index e08f7d3..f9c5627 100644
--- a/test/test_model.py
+++ b/test/test_model.py
@@ -338,7 +338,7 @@ class OSMAlchemyModelTestsPostgres(OSMAlchemyModelTests, unittest.TestCase):
 
     def setUp(self):
         self.postgresql = Postgresql()
-        self.engine = create_engine(self.postgresql.url())
+        self.engine = create_engine(self.postgresql.url(), client_encoding="utf-8")
         self.base = declarative_base(bind=self.engine)
         self.session = scoped_session(sessionmaker(bind=self.engine))
         self.osmalchemy = OSMAlchemy((self.engine, self.base, self.session))
diff --git a/test/test_util_db.py b/test/test_util_db.py
index 876d71b..084b66e 100644
--- a/test/test_util_db.py
+++ b/test/test_util_db.py
@@ -184,7 +184,7 @@ class OSMAlchemyUtilDbTestsPostgres(OSMAlchemyUtilDbTests, unittest.TestCase):
 
     def setUp(self):
         self.postgresql = Postgresql()
-        self.engine = create_engine(self.postgresql.url())
+        self.engine = create_engine(self.postgresql.url(), client_encoding="utf-8")
         OSMAlchemyUtilDbTests.setUp(self)
 
     def tearDown(self):

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/osmalchemy.git



More information about the Python-modules-commits mailing list