Skip to content

Commit

Permalink
Load config file using read_file as readfp is being deprecated (#437)
Browse files Browse the repository at this point in the history
* Load config file using read_file as read_fp is getting deprecated

* The `read_file` method is not available on ConfigParser in py2.7, add a check

* Update package version + add test debug config in launch.json
  • Loading branch information
marianan authored Sep 24, 2020
1 parent 4c7c56b commit addfd99
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 5 deletions.
13 changes: 12 additions & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,24 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Python: debug test",
"type": "python",
"request": "launch",
"module": "pytest",
"args": [
"-v",
"${workspaceFolder}/tests/test_simulator.py::test_monitor"
],
"cwd": "${workspaceFolder}"
},
{
"name": "Python Module",
"type": "python",
"request": "launch",
"module": "iotedgedev.cli",
"args": [
"push"
"init"
],
"cwd": "${workspaceFolder}/tests/test_solution"
}
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# Changelog
All notable changes to this project since 0.82.0 will be documented in this file.

## [2.1.6] - 2020-09-23
### Changed
- Fix warning about ConfigParser readfp deprecation

## [2.1.5] - 2020-08-18
### Changed
- Fix error caused by latest bcrypt on Azure Pipelines agent
Expand Down
2 changes: 1 addition & 1 deletion iotedgedev/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@

__author__ = 'Microsoft Corporation'
__email__ = '[email protected]'
__version__ = '2.1.5'
__version__ = '2.1.6'
__AIkey__ = '95b20d64-f54f-4de3-8ad5-165a75a6c6fe'
7 changes: 6 additions & 1 deletion iotedgedev/telemetryconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,12 @@ def setup(self):
@suppress_all_exceptions()
def load(self):
with open(self.get_config_path(), 'r') as f:
self.config_parser.readfp(f)
if hasattr(self.config_parser, 'read_file'):
self.config_parser.read_file(f)
else: # pragma: no cover
assert PY2
# The `read_file` method is not available on ConfigParser in py2.7!
self.config_parser.readfp(f)

@suppress_all_exceptions()
def dump(self):
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 2.1.5
current_version = 2.1.6
commit = True
tag = True

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@

setup(
name='iotedgedev',
version='2.1.5',
version='2.1.6',
description='The Azure IoT Edge Dev Tool greatly simplifies the IoT Edge development process by automating many routine manual tasks, such as building, deploying, pushing modules and configuring the IoT Edge Runtime.',
long_description='See https://github.com/azure/iotedgedev for usage instructions.',
author='Microsoft Corporation',
Expand Down

0 comments on commit addfd99

Please sign in to comment.