Comments (8)
My first thought was to encode those party strings at UTF:
name = em.string_get(x, 38, 33).strip().encode('utf-8')
name = " ".join(name.split()).encode('utf-8')
But that generated this:
Traceback (most recent call last):
File "main.py", line 7, in <module>
import get_cases
File "/mnt/c/Users/Hayden/OneDrive/Documents/GitHub/DAP/get_cases.py", line 110, in <module>
main()
File "/mnt/c/Users/Hayden/OneDrive/Documents/GitHub/DAP/get_cases.py", line 107, in main
get_municipal_court()
File "/mnt/c/Users/Hayden/OneDrive/Documents/GitHub/DAP/get_cases.py", line 97, in get_municipal_court
each_court(court_name)
File "/mnt/c/Users/Hayden/OneDrive/Documents/GitHub/DAP/get_cases.py", line 66, in each_court
last_successful_case_number) # scan, giving back last known successfully accessed case number
File "/mnt/c/Users/Hayden/OneDrive/Documents/GitHub/DAP/get_cases.py", line 36, in scan
year, judge_name, date_filed, time_filed, plaintiff_name, plaintiff_counsel, defendant_name, defendant_counsel, civil_action, action_description = mainframe_parse_case() # pull the data from mainframe
File "/mnt/c/Users/Hayden/OneDrive/Documents/GitHub/DAP/mainframe.py", line 111, in mainframe_parse_case
name = " ".join(name.split()).encode('utf-8')
TypeError: sequence item 0: expected str instance, bytes found
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "main.py", line 12, in <module>
dap_log_general(LogLevel.CRITICAL, "exception encountered [%i]: %s" % (e.errno, e.strerror))
NameError: name 'LogLevel' is not defined
from dap.
MC6939 is the case in question.
from dap.
Occurred on MC4941 too:
GENERAL: getting municipal court cases
DATABASE: getting latest case number
GENERAL: scan for cases
MAINFRAME: connecting to mainframe
COMPLIANCE: mainframe connection established
MAINFRAME: selecting mainframe application
MAINFRAME: logging into mainframe
MAINFRAME: sending username
MAINFRAME: sending password
MAINFRAME: checking if user already logged in
MAINFRAME: login successful
MAINFRAME: selecting CATS function
MAINFRAME: opening docket search page
MAINFRAME: searching mainframe for case: MC6941
MAINFRAME: checking to see if case exists
MAINFRAME: case found
MAINFRAME: parsing first page of case file
MAINFRAME: navigating additional pages of case file
MAINFRAME: getting party names
Traceback (most recent call last):
File "main.py", line 7, in <module>
import get_cases
File "/mnt/c/Users/Hayden/OneDrive/Documents/GitHub/DAP/get_cases.py", line 110, in <module>
main()
File "/mnt/c/Users/Hayden/OneDrive/Documents/GitHub/DAP/get_cases.py", line 107, in main
get_municipal_court()
File "/mnt/c/Users/Hayden/OneDrive/Documents/GitHub/DAP/get_cases.py", line 97, in get_municipal_court
each_court(court_name)
File "/mnt/c/Users/Hayden/OneDrive/Documents/GitHub/DAP/get_cases.py", line 66, in each_court
last_successful_case_number) # scan, giving back last known successfully accessed case number
File "/mnt/c/Users/Hayden/OneDrive/Documents/GitHub/DAP/get_cases.py", line 36, in scan
year, judge_name, date_filed, time_filed, plaintiff_name, plaintiff_counsel, defendant_name, defendant_counsel, civil_action, action_description = mainframe_parse_case() # pull the data from mainframe
File "/mnt/c/Users/Hayden/OneDrive/Documents/GitHub/DAP/mainframe.py", line 110, in mainframe_parse_case
name = em.string_get(x, 38, 33).strip()
File "/home/hayden/.local/lib/python3.7/site-packages/py3270/__init__.py", line 455, in string_get
return cmd.data[0].decode("ascii")
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 32: ordinal not in range(128)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "main.py", line 12, in <module>
dap_log_general(LogLevel.CRITICAL, "exception encountered [%i]: %s" % (e.errno, e.strerror))
NameError: name 'LogLevel' is not defined
from dap.
Screenshots of those pages in MC:
from dap.
MAINFRAME: searching mainframe for case: MC6941
MAINFRAME: checking to see if case exists
MAINFRAME: case found
MAINFRAME: parsing first page of case file
MAINFRAME: navigating additional pages of case file
MAINFRAME: getting party names
Traceback (most recent call last):
File "main.py", line 7, in <module>
import get_cases
File "/mnt/c/Users/Hayden/OneDrive/Documents/GitHub/DAP/get_cases.py", line 110, in <module>
main()
File "/mnt/c/Users/Hayden/OneDrive/Documents/GitHub/DAP/get_cases.py", line 107, in main
get_municipal_court()
File "/mnt/c/Users/Hayden/OneDrive/Documents/GitHub/DAP/get_cases.py", line 97, in get_municipal_court
each_court(court_name)
File "/mnt/c/Users/Hayden/OneDrive/Documents/GitHub/DAP/get_cases.py", line 66, in each_court
last_successful_case_number) # scan, giving back last known successfully accessed case number
File "/mnt/c/Users/Hayden/OneDrive/Documents/GitHub/DAP/get_cases.py", line 36, in scan
year, judge_name, date_filed, time_filed, plaintiff_name, plaintiff_counsel, defendant_name, defendant_counsel, civil_action, action_description = mainframe_parse_case() # pull the data from mainframe
File "/mnt/c/Users/Hayden/OneDrive/Documents/GitHub/DAP/mainframe.py", line 110, in mainframe_parse_case
name = em.string_get(x, 38, 33).strip()
File "/home/hayden/.local/lib/python3.7/site-packages/py3270/__init__.py", line 455, in string_get
return cmd.data[0].decode("ascii")
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 32: ordinal not in range(128)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "main.py", line 12, in <module>
dap_log_general(LogLevel.CRITICAL, "exception encountered [%i]: %s" % (e.errno, e.strerror))
NameError: name 'LogLevel' is not defined
from dap.
Something about these cases:
MC6939
MC6941
MC6946
MC6949
MC6950
Look at that non-standard character in MC6950 and MC6946 like MC6939:
from dap.
what if we change the order of get_string().strip().encode('utf-8') to get_string().encode('utf-8').strip() ?
from dap.
I tried a few things, nothing seemed to work, not sure if I tried this. I wondered at the time if the py3270 library had an issue with non-ascii strings.
from dap.
Related Issues (20)
- Error binding parameter :defendant_email HOT 2
- When a Pipl match is not found, need to move case from POSSIBLE_CASES to REJECTED_CASES
- When a letter is sent, need to move from MATCHED_CASES to PROCESSED_CASES
- AttributeError: 'Address' object has no attribute 'apt' HOT 1
- TypeError: %i format: a number is required, not datetime.datetime
- Implement two-step PiPl e-mail collection HOT 2
- Investigate Facebook options HOT 4
- Finish logging implementation HOT 6
- More graceful failures
- Implement sending e-mail (after #34 is implemented)
- Move matched cases without addresses to REJECTED_CASE
- api_interfaces: implement picking most likely candidate from pipl possible matches HOT 2
- database.py: name db_move_to_incomplete_pipl is not defined HOT 1
- api_interfaces: sometimes pipl requests get stuck > 15minutes with no response HOT 4
- Add note when there are no jobs to process HOT 6
- Remove leading 0 from address printed in Date Filed HOT 1
- Investigate pipl error and remediation HOT 1
- Reminder: past issues (etc) may have personal information from tracebacks, screenshots etc HOT 1
- Handle certain classes of names HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dap.