File tree Expand file tree Collapse file tree 3 files changed +12
-2
lines changed Expand file tree Collapse file tree 3 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
66
77## [ Unreleased]
88
9+ ### Fixed
10+ - URL encode $filter contents - Barton Ip
11+
912## [ 1.5.0]
1013
1114### Added
Original file line number Diff line number Diff line change 1414from http .client import HTTPResponse
1515from io import BytesIO
1616
17+ try :
18+ # For Python 3.0 and later
19+ from urllib .parse import quote
20+ except ImportError :
21+ # Fallback to urllib2
22+ from urllib2 import quote
23+
1724from pyodata .exceptions import HttpError , PyODataException , ExpressionError
1825from . import model
1926
@@ -592,7 +599,7 @@ def expand(self, expand):
592599 def filter (self , filter_val ):
593600 """Sets the filter expression."""
594601 # returns QueryRequest
595- self ._filter = filter_val
602+ self ._filter = quote ( filter_val )
596603 return self
597604
598605 # def nav(self, key_value, nav_property):
Original file line number Diff line number Diff line change @@ -1450,7 +1450,7 @@ def test_navigation_count_with_filter(service):
14501450
14511451 responses .add (
14521452 responses .GET ,
1453- "{0}/Employees(23)/Addresses/$count?$filter =City eq 'London' " .format (service .url ),
1453+ "{0}/Employees(23)/Addresses/$count?%24filter =City%2520eq%2520%2527London%2527 " .format (service .url ),
14541454 json = 3 ,
14551455 status = 200 )
14561456
You can’t perform that action at this time.
0 commit comments