Difference between revisions of "User:Alvonruff"

From ISFDB
Jump to navigation Jump to search
Line 8: Line 8:
 
* Use [[User:Alvonruff/Python2.7_Futurize]] to perform a mass conversion from python2.7 syntax to python3 syntax. This allows for locating potential unicode issues. This produces a result suitable for python2.
 
* Use [[User:Alvonruff/Python2.7_Futurize]] to perform a mass conversion from python2.7 syntax to python3 syntax. This allows for locating potential unicode issues. This produces a result suitable for python2.
 
* Perform a python3 conversion with [[User/Alvonruff/2to3]], and followup on the numerous porting issues.
 
* Perform a python3 conversion with [[User/Alvonruff/2to3]], and followup on the numerous porting issues.
* Use 2to3 in a manner the same as futurize. This produces results suitable for python3.
 
* The next two items need to be done together, as there is no mysql-connector-python for python2:
 
** Update to the official MySQL [[User:Alvonruff/mysql.connector]]. There is no python3 support for MySQLdb, which is our current connector. Moving to a new connector is a prerequisite.
 
** Update to python3. This leverages the futurize work, by removing the "from __future__" lines.
 
* Python3 specific changes:
 
** Use of md5 needs to be replaced with hashlib
 
** Records that return DATETIME fields cannot simply be indexed - they must use built-in datetime methods:
 
*** year = field.year
 
*** month = field.month
 
*** day = field.day
 
** String operator usage:
 
*** string.replace() must be changed to str.replace()
 
*** string.strip() must be changed to str.strip()
 
 
* Update all character sets. Final procedure still TBD.
 
* Update all character sets. Final procedure still TBD.
 
** Change the default charset in MySQL
 
** Change the default charset in MySQL

Revision as of 14:04, 25 April 2023

Founder of the ISFDB.

Python3 Notes

General outline of steps to move to Python3:

  • Python3 does not tolerate mixed tabs and spaces. Convert tabs in all files to 8 spaces.
  • Use User:Alvonruff/Python2.7_Futurize to perform a mass conversion from python2.7 syntax to python3 syntax. This allows for locating potential unicode issues. This produces a result suitable for python2.
  • Perform a python3 conversion with User/Alvonruff/2to3, and followup on the numerous porting issues.
  • Update all character sets. Final procedure still TBD.
    • Change the default charset in MySQL
    • Repair strings which have URL encodings in MySQL

System Upgrade Notes

Details on how to bring up a LAMP stack (on two different OSs), and how to setup https:

User:Alvonruff/Test Page

Other Loose Notes

Obituary Sources

Reading List