Python Forum
error in upgrading python 24. to 2.7
Thread Rating:
  • 1 Vote(s) - 4 Average
  • 1
  • 2
  • 3
  • 4
  • 5
error in upgrading python 24. to 2.7
#1
Hello All,
I upgraded my python code from 2.4 to 2.7 and getting one error
error: ushort format requires 0 <= number <= USHRT_MAX
So, I want to know that is the value of USHRT_MAX changes from 2.4 to 2.7??
Reply
#2
show code, and actual error messages verbatim and complete please
Reply
#3
for idx in range(len(ebms)):
if idx in byteEBMs: # the one byte enable bit maps
print (ebms[idx])
out = out + struct.pack("<B",ebms[idx])
elif idx in confidence_beep_intervalEBM:
if vals['confidence_beep_interval'+ENB]:
print ('confidence:')
print (ebms[idx])
print(ebms[idx]+(0xff<<10))
out = out + struct.pack("<H",ebms[idx]+(0xff<<10))
else:
print (ebms[idx])
out = out + struct.pack("<H",ebms[idx])
else:
print (ebms[idx])
out = out + struct.pack("<H",ebms[idx])

throwing error with value ebms[idx]=0 and output of this line print(ebms[idx]+(0xff<<10)) is 266120

File "C:/Users/Punnu2206/BWFleetMgrWorkspace_32/FM-Python/src\MCConfigConverter.py", line 88, in convert
status = self.parseNV2Config(outDir)
File "C:/Users/Punnu2206/BWFleetMgrWorkspace_32/FM-Python/src\MCConfigConverter.py", line 180, in parseNV2Config
out = out + struct.pack("<H",ebms[idx]+(0xff<<10))
error: ushort format requires 0 <= number <= USHRT_MAX
ERROR: Module: convert could not be imported (file: C:\Users\Punnu2206\BWFleetMgrWorkspace_32\FM-Python\src\convert.py).
Reply
#4
Here's a list of release dates:
Output:
Release dates for the major and minor versions:[31][32] Implementation started - December, 1989 Internal releases at Centrum Wiskunde & Informatica - 1990 Python 0.9.0 - February 20, 1991 Python 0.9.1 - February, 1991 Python 0.9.2 - Autumn, 1991 Python 0.9.4 - December 24, 1991 Python 0.9.5 - January 2, 1992 Python 0.9.6 - April 6, 1992 Python 0.9.8 - January 9, 1993 Python 0.9.9 - July 29, 1993 Python 1.0 - January 1994 Python 1.2 - April 10, 1995 Python 1.3 - October 12, 1995 Python 1.4 - October 25, 1996 Python 1.5 - December 31, 1997 Python 1.6 - September 5, 2000 Python 2.0 - October 16, 2000 Python 2.1 - April 15, 2001 Python 2.2 - December 21, 2001 Python 2.3 - July 29, 2003 Python 2.4 - November 30, 2004 Python 2.5 - September 19, 2006 Python 2.6 - October 1, 2008 Python 2.7 - July 4, 2010 Python 3.0 - December 3, 2008 Python 3.1 - June 27, 2009 Python 3.2 - February 20, 2011 Python 3.3 - September 29, 2012 Python 3.4 - March 16, 2014 Python 3.5 - September 13, 2015 Python 3.6 - December 23, 2016 Python 3.7 - June 27, 2018
Note that there were two updates between 2.4 and 2.7

I found this specific bug relating to your issue: http://coding.derkeiler.com/Archive/Pyth...05288.html
But that was discovered in version 2.4.

You should go to python's what's new pages for each version, 2.5, 2.6, 2.7 to see what changed.

2.5: https://docs.python.org/2/whatsnew/2.5.html
2.6: https://docs.python.org/2/whatsnew/2.6.html
2,7: https://docs.python.org/2/whatsnew/2.7.html
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Upgrading from 2 to 3 and having file write problems KenHorse 2 1,499 May-08-2022, 09:47 PM
Last Post: KenHorse
  Virtual environment and upgrading python 3.5 to 3.9 NeilUK 4 12,176 Jan-24-2021, 01:02 PM
Last Post: snippsat
  Error in Mysql Client when upgrading Django Abi 0 1,889 Sep-21-2020, 06:11 AM
Last Post: Abi
  Help with Upgrading to Python 3.8 KNSSCyberSec 1 2,404 Jan-31-2020, 08:37 PM
Last Post: Marbelous
  Pymssql library failing when upgrading to Python 3.7 - win32 issue stixmagiggins 5 7,473 Jun-24-2019, 06:46 AM
Last Post: snippsat
  Upgrading to Python 3.5.2 ErnestTBass 6 3,727 Jan-04-2019, 09:22 PM
Last Post: metulburr
  upgrading google-api generates an error ineuw 3 3,713 Jul-07-2018, 06:47 AM
Last Post: ineuw
  upgrading python package amka 5 5,896 Nov-18-2017, 02:44 PM
Last Post: snippsat

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020