Azure / azure-storage-python

Microsoft Azure Storage Library for Python
https://azure-storage.readthedocs.io
MIT License
338 stars 240 forks source link

Fix local variable not defined #479

Closed ZephyrYin closed 6 years ago

ZephyrYin commented 6 years ago

Saw these errors when using Azure-python-SDK: local variable 'timestamp_and_request_id' referenced before assignment local variable 'status_code' referenced before assignment local variable 'exception_str_in_one_line' referenced before assignment Checked code in azure-storage-common/azure/storage/common/storageclient.py. These three variables were defined under a if condition while also used under other parallel if condition. Which should be fixed.

msftclas commented 6 years ago

CLA assistant check
All CLA requirements met.

codecov-io commented 6 years ago

Codecov Report

Merging #479 into dev will increase coverage by <.01%. The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##              dev     #479      +/-   ##
==========================================
+ Coverage   87.11%   87.12%   +<.01%     
==========================================
  Files          57       57              
  Lines        4609     4612       +3     
  Branches      501      501              
==========================================
+ Hits         4015     4018       +3     
  Misses        435      435              
  Partials      159      159
Impacted Files Coverage Δ
...orage-common/azure/storage/common/storageclient.py 90.25% <100%> (+0.19%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 3103336...0e87396. Read the comment docs.

zezha-msft commented 6 years ago

Hi @ZephyrYin, thanks for submitting this PR!

To be clear, by "errors" do you mean warnings in an IDE?

ZephyrYin commented 6 years ago

Not IDE, I use pip install azure-storage-blob and run my python script and got this error.

zezha-msft commented 6 years ago

Hi @ZephyrYin, thank you for the PR. I realized that I was not able to see this error because I did not properly disable logging with logging.disable(logging.CRITICAL).