python-fedex-devs / python-fedex

A light wrapper around FedEx's SOAP API.
http://python-fedex.readthedocs.org
BSD 3-Clause "New" or "Revised" License
155 stars 139 forks source link

Regression: rate_request.RequestedShipment.FreightShipmentDetail is None #167

Closed stenci closed 1 year ago

stenci commented 2 years ago

I have an app that has been using this package for years without problems.

Now I need to make a change, I created a new environment installing from git (see https://github.com/python-fedex-devs/python-fedex/issues/163), I ran a test which has the first part identical to freight_rate_request.py, but it fails at line 30 complaining that FreightShipmentDetail is None https://github.com/python-fedex-devs/python-fedex/blob/a3c5b7d0f03eaa883f91197d037a7af2e940da57/examples/freight_rate_request.py#L30

Comparing the execution of the test on the old computer with fedex 2.4.0 installed with from pypi a few years ago to the execution on the new computer with fedex 2.4.1 installed from git today, it looks like the difference is on line 53 of rate_service.py: https://github.com/python-fedex-devs/python-fedex/blob/a3c5b7d0f03eaa883f91197d037a7af2e940da57/fedex/services/rate_service.py#L53

After executing that line on the old computer the self.RequestedShipment has many members, and the value of most members is not None.

After executing that line on the new computer the self.RequestedShipment has many members, and the value of most members is None.

stenci commented 2 years ago

I was able to work around the problem by reverting to the oldest version available of suds (the second oldest version doesn't work):

pip install suds-community==0.7 git+https://github.com/python-fedex-devs/python-fedex.git#egg=fedex

I was afraid this wouldn't work, because requirements.txt explicitly asks for version 1.0: https://github.com/python-fedex-devs/python-fedex/blob/8d74623123153205d72bb18b774a632ee92972f4/requirements.txt#L1

BUT... it doesn't work. The same test returns valid data on the old computer and raises the following error on the new computer:

FedexError(2103, FreightLineItemId for Freight shipment line item 1 is missing or invalid.)

I have spent enough time on this today. I will continue tomorrow or Monday.

In the mean time, if anyone has any advice, please don't be shy.

radzhome commented 1 year ago

we can certainly merge the change to master if you create a PR with the right suds version