File size: 59,151 Bytes
c1a2788
6cc19fe
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
c1a2788
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>Python 3.12 Removed modules — check your python code free</title>
<meta name="description" content="Find imports and calls removed from the Python standard library in versions 3.12, 3.13, and 3.14.">
<style>
:root{color-scheme:light}body{margin:0;font:15px/1.55 system-ui,-apple-system,"Segoe UI",sans-serif;background:#faf9f5;color:#1a1512}
.wrap{max-width:960px;margin:0 auto;padding:28px 18px 60px}h1{font-size:26px;margin:0 0 6px}.lede{color:#4a403a;margin:0 0 16px}
textarea{width:100%;min-height:260px;font:13px/1.45 ui-monospace,Menlo,Consolas,monospace;padding:12px;border:1px solid #d9d0c4;border-radius:8px;box-sizing:border-box}
.bar{display:flex;gap:10px;align-items:center;margin:12px 0}button{font:600 15px system-ui;padding:10px 18px;border:0;border-radius:8px;background:#1a1512;color:#fff;cursor:pointer}
select,input[type=date]{font:14px system-ui;padding:8px;border:1px solid #d9d0c4;border-radius:6px}
table{border-collapse:collapse;width:100%;font-size:14px;margin-top:10px}th,td{text-align:left;padding:8px 10px;border-bottom:1px solid #eee;vertical-align:top}th{font-size:12px;letter-spacing:.06em;text-transform:uppercase;color:#7a6e65}
.sev.error{color:#a8551f;font-weight:700}.sev.warn,.sev.warning{color:#96691f}.ok{color:#2a6446;font-weight:600}.sum{font-weight:600}
.note{font-size:13px;color:#7a6e65;margin-top:18px}#paid{margin-top:22px;padding:14px 16px;border:1px solid #e2d8cb;border-radius:10px;background:#fffdfa}
</style>
<script data-grow-initializer="">!(function(){window.growMe||((window.growMe=function(e){window.growMe._.push(e);}),(window.growMe._=[]));var e=document.createElement("script");(e.type="text/javascript"),(e.src="https://faves.grow.me/main.js"),(e.defer=!0),e.setAttribute("data-grow-faves-site-id","U2l0ZTphZjljMzgyMC0yMmU5LTRhYjgtYTIxNS03OTRhMGY1N2ExYzM=");var t=document.getElementsByTagName("script")[0];t.parentNode.insertBefore(e,t);})();</script>
<!--yj-canon-s101--><link rel="canonical" href="https://getreadystack.com/tools/python-upgrade-removed-api-lint"><style data-yj-mfit="1">#out{max-width:100%}#out td,#out th{overflow-wrap:break-word}#out th{white-space:nowrap}#out pre{white-space:pre-wrap;overflow-wrap:anywhere}#out code{white-space:pre-wrap;overflow-wrap:break-word}@media (max-width:640px){#out td,#out th{overflow-wrap:anywhere}#out th{white-space:normal}table{display:block;max-width:100%;overflow-x:auto}pre{max-width:100%;overflow-x:auto}code,a{overflow-wrap:anywhere}img,svg,video,canvas,iframe{max-width:100%}textarea,input,select{max-width:100%;box-sizing:border-box}.yj-lgbar{position:static!important;justify-content:flex-end;margin:0 0 10px}h1,h2,h3,h4,p,li,dd,dt,blockquote,figcaption,summary,label,.res,.lead{overflow-wrap:anywhere}label{max-width:100%;box-sizing:border-box}#out table:not(:has(tr>:nth-child(4))){display:table;table-layout:fixed;width:100%}#out table:has(tr>:nth-child(4)),#out table:has(tr>:nth-child(4)) tbody,#out table:has(tr>:nth-child(4)) tr,#out table:has(tr>:nth-child(4)) td{display:block;width:auto;overflow:visible}#out table:has(tr>:nth-child(4)) thead{display:none}#out table:has(tr>:nth-child(4)) tr{padding:10px 0;border-bottom:1px solid rgba(128,128,128,.28)}#out table:has(tr>:nth-child(4)) td{border:0;padding:1px 0}#out table:has(tr>:nth-child(4)) td:nth-child(-n+3){display:inline-block;margin-right:10px;font-size:12px;opacity:.78}}</style>
</head>
<body>
<div class="wrap">
<h1>Python 3.12 Removed modules — check your python code free</h1>
<p class="lede">Flags imports and calls removed from the Python standard library in 3.12, 3.13 and 3.14 (cgi, imp, distutils, telnetlib, unittest aliases, ast.Str) before you leave Python 3.10. Runs entirely in your browser — nothing is uploaded.</p>
<textarea id="src" spellcheck="false"># Nightly export job, written in 2021 for Python 3.10.
import cgi
import imp
import os, pipes
import telnetlib
import imghdr
import sqlite3
from distutils.core import setup
from configparser import SafeConfigParser
from datetime import datetime
import ssl
import ast
import unittest


def load_plugin(path):
    return imp.load_source("plugin", path)


def read_config(fp):
    cfg = SafeConfigParser()
    cfg.readfp(fp)
    return cfg


def run(cmd):
    return os.system(pipes.quote(cmd))


def stamp():
    print("sqlite", sqlite3.version)
    return datetime.utcnow().isoformat()


def secure(sock):
    return ssl.wrap_socket(sock)


def is_str(node):
    return isinstance(node, ast.Str)


class T(unittest.TestCase):
    def test_form(self):
        form = cgi.FieldStorage()
        self.assertEquals(form.getvalue("a"), "1")</textarea>
<div class="bar"><button id="go">Check</button><label>Upgrade target <select id="target"><option value="3.12">Python 3.12</option><option value="3.13">Python 3.13</option><option value="3.14" selected>Python 3.14</option></select></label><input type="hidden" id="today"></div>
<div id="out" aria-live="polite"></div>
<div id="paid"><strong>Free here:</strong> check one .py file against all 43 removed-stdlib rules for Python 3.12, 3.13 and 3.14 and see the line, the version that removed it, and the replacement. <strong>Full version ($29 once · one licence key per person or team seat):</strong> scan the whole workspace in one pass and export a Markdown upgrade report per target version for the migration ticket. <a href="https://getreadystack.com/api/buy/cl/polar_cl_2Izy69ZyqcJdKkYcQRlrKODleXMjHPRFCgWjE3eTaR6">Get the full version — $29</a></div>
<p class="note">Same engine as the VS Code extension, byte for byte.</p>
</div>
<script>var PYUP_RULES = [
 {
  "id": "distutils",
  "removed_in": "3.12",
  "sev": "error",
  "patterns": [
   "^\\s*(?:from\\s+distutils(?:\\.[\\w.]+)?\\s+import\\b|import\\s+(?:[\\w.]+(?:\\s+as\\s+\\w+)?\\s*,\\s*)*distutils(?:\\.[\\w.]+)?(?=\\s|,|$))"
  ],
  "msg": "distutils was removed from the standard library.",
  "fix": "use setuptools (setuptools._distutils) or packaging / sysconfig / shutil.",
  "source": "PEP 632"
 },
 {
  "id": "imp",
  "removed_in": "3.12",
  "sev": "error",
  "patterns": [
   "^\\s*(?:from\\s+imp(?:\\.[\\w.]+)?\\s+import\\b|import\\s+(?:[\\w.]+(?:\\s+as\\s+\\w+)?\\s*,\\s*)*imp(?:\\.[\\w.]+)?(?=\\s|,|$))"
  ],
  "msg": "The imp module was removed.",
  "fix": "use importlib (importlib.util.spec_from_file_location, importlib.reload).",
  "source": "What's New 3.12"
 },
 {
  "id": "asyncore",
  "removed_in": "3.12",
  "sev": "error",
  "patterns": [
   "^\\s*(?:from\\s+asyncore(?:\\.[\\w.]+)?\\s+import\\b|import\\s+(?:[\\w.]+(?:\\s+as\\s+\\w+)?\\s*,\\s*)*asyncore(?:\\.[\\w.]+)?(?=\\s|,|$))"
  ],
  "msg": "asyncore was removed.",
  "fix": "use asyncio.",
  "source": "PEP 594"
 },
 {
  "id": "asynchat",
  "removed_in": "3.12",
  "sev": "error",
  "patterns": [
   "^\\s*(?:from\\s+asynchat(?:\\.[\\w.]+)?\\s+import\\b|import\\s+(?:[\\w.]+(?:\\s+as\\s+\\w+)?\\s*,\\s*)*asynchat(?:\\.[\\w.]+)?(?=\\s|,|$))"
  ],
  "msg": "asynchat was removed.",
  "fix": "use asyncio streams.",
  "source": "PEP 594"
 },
 {
  "id": "smtpd",
  "removed_in": "3.12",
  "sev": "error",
  "patterns": [
   "^\\s*(?:from\\s+smtpd(?:\\.[\\w.]+)?\\s+import\\b|import\\s+(?:[\\w.]+(?:\\s+as\\s+\\w+)?\\s*,\\s*)*smtpd(?:\\.[\\w.]+)?(?=\\s|,|$))"
  ],
  "msg": "smtpd was removed.",
  "fix": "use the aiosmtpd package from PyPI.",
  "source": "PEP 594"
 },
 {
  "id": "unittest-alias",
  "removed_in": "3.12",
  "sev": "error",
  "patterns": [
   "\\.(?:assertEquals|assertNotEquals|assertAlmostEquals|assertNotAlmostEquals|assertRegexpMatches|assertNotRegexpMatches|assertRaisesRegexp|failUnlessEqual|failIfEqual|failUnlessRaises|failUnlessAlmostEqual|failIfAlmostEqual|failUnless|failIf|assert_|assertDictContainsSubset)\\s*\\("
  ],
  "msg": "A deprecated unittest.TestCase alias was removed.",
  "fix": "use assertEqual, assertNotEqual, assertAlmostEqual, assertRegex, assertRaisesRegex, assertTrue, assertFalse.",
  "source": "What's New 3.12"
 },
 {
  "id": "safeconfigparser",
  "removed_in": "3.12",
  "sev": "error",
  "patterns": [
   "\\bSafeConfigParser\\b"
  ],
  "msg": "configparser.SafeConfigParser was removed.",
  "fix": "use configparser.ConfigParser.",
  "source": "What's New 3.12"
 },
 {
  "id": "readfp",
  "removed_in": "3.12",
  "sev": "error",
  "patterns": [
   "\\.readfp\\s*\\("
  ],
  "msg": "ConfigParser.readfp() was removed.",
  "fix": "use read_file().",
  "source": "What's New 3.12"
 },
 {
  "id": "ssl-wrap-socket",
  "removed_in": "3.12",
  "sev": "error",
  "patterns": [
   "\\bssl\\.wrap_socket\\s*\\(",
   "^\\s*from\\s+ssl\\s+import\\b.*\\bwrap_socket\\b"
  ],
  "msg": "ssl.wrap_socket() was removed.",
  "fix": "create an ssl.SSLContext and call context.wrap_socket().",
  "source": "What's New 3.12"
 },
 {
  "id": "ssl-match-hostname",
  "removed_in": "3.12",
  "sev": "error",
  "patterns": [
   "\\bssl\\.match_hostname\\b",
   "^\\s*from\\s+ssl\\s+import\\b.*\\bmatch_hostname\\b"
  ],
  "msg": "ssl.match_hostname() was removed.",
  "fix": "let SSLContext.check_hostname verify the host.",
  "source": "What's New 3.12"
 },
 {
  "id": "locale-format",
  "removed_in": "3.12",
  "sev": "error",
  "patterns": [
   "\\blocale\\.format\\s*\\("
  ],
  "msg": "locale.format() was removed.",
  "fix": "use locale.format_string().",
  "source": "What's New 3.12"
 },
 {
  "id": "pkgutil-imp",
  "removed_in": "3.12",
  "sev": "error",
  "patterns": [
   "\\bImpImporter\\b",
   "\\bImpLoader\\b"
  ],
  "msg": "pkgutil.ImpImporter / ImpLoader were removed.",
  "fix": "use importlib.machinery finders and loaders.",
  "source": "What's New 3.12"
 },
 {
  "id": "utcnow",
  "removed_in": "3.12",
  "sev": "warn",
  "patterns": [
   "\\bdatetime\\.utcnow\\s*\\(",
   "\\bdatetime\\.utcfromtimestamp\\s*\\(",
   "^\\s*.*\\butcnow\\s*\\(\\s*\\)"
  ],
  "msg": "datetime.utcnow() / utcfromtimestamp() return naive datetimes and are deprecated, not yet removed.",
  "fix": "use datetime.now(timezone.utc) / datetime.fromtimestamp(ts, timezone.utc).",
  "source": "What's New 3.12"
 },
 {
  "id": "aifc",
  "removed_in": "3.13",
  "sev": "error",
  "patterns": [
   "^\\s*(?:from\\s+aifc(?:\\.[\\w.]+)?\\s+import\\b|import\\s+(?:[\\w.]+(?:\\s+as\\s+\\w+)?\\s*,\\s*)*aifc(?:\\.[\\w.]+)?(?=\\s|,|$))"
  ],
  "msg": "The aifc module was removed (dead battery).",
  "fix": "use a PyPI audio library such as soundfile.",
  "source": "PEP 594"
 },
 {
  "id": "audioop",
  "removed_in": "3.13",
  "sev": "error",
  "patterns": [
   "^\\s*(?:from\\s+audioop(?:\\.[\\w.]+)?\\s+import\\b|import\\s+(?:[\\w.]+(?:\\s+as\\s+\\w+)?\\s*,\\s*)*audioop(?:\\.[\\w.]+)?(?=\\s|,|$))"
  ],
  "msg": "The audioop module was removed (dead battery).",
  "fix": "use numpy or the audioop-lts package.",
  "source": "PEP 594"
 },
 {
  "id": "cgi",
  "removed_in": "3.13",
  "sev": "error",
  "patterns": [
   "^\\s*(?:from\\s+cgi(?:\\.[\\w.]+)?\\s+import\\b|import\\s+(?:[\\w.]+(?:\\s+as\\s+\\w+)?\\s*,\\s*)*cgi(?:\\.[\\w.]+)?(?=\\s|,|$))"
  ],
  "msg": "The cgi module was removed (dead battery).",
  "fix": "parse forms with urllib.parse.parse_qsl or email.message; use multipart for uploads.",
  "source": "PEP 594"
 },
 {
  "id": "cgitb",
  "removed_in": "3.13",
  "sev": "error",
  "patterns": [
   "^\\s*(?:from\\s+cgitb(?:\\.[\\w.]+)?\\s+import\\b|import\\s+(?:[\\w.]+(?:\\s+as\\s+\\w+)?\\s*,\\s*)*cgitb(?:\\.[\\w.]+)?(?=\\s|,|$))"
  ],
  "msg": "The cgitb module was removed (dead battery).",
  "fix": "use the traceback module or your framework's error pages.",
  "source": "PEP 594"
 },
 {
  "id": "chunk",
  "removed_in": "3.13",
  "sev": "error",
  "patterns": [
   "^\\s*(?:from\\s+chunk(?:\\.[\\w.]+)?\\s+import\\b|import\\s+(?:[\\w.]+(?:\\s+as\\s+\\w+)?\\s*,\\s*)*chunk(?:\\.[\\w.]+)?(?=\\s|,|$))"
  ],
  "msg": "The chunk module was removed (dead battery).",
  "fix": "read IFF chunks with struct.",
  "source": "PEP 594"
 },
 {
  "id": "crypt",
  "removed_in": "3.13",
  "sev": "error",
  "patterns": [
   "^\\s*(?:from\\s+crypt(?:\\.[\\w.]+)?\\s+import\\b|import\\s+(?:[\\w.]+(?:\\s+as\\s+\\w+)?\\s*,\\s*)*crypt(?:\\.[\\w.]+)?(?=\\s|,|$))"
  ],
  "msg": "The crypt module was removed (dead battery).",
  "fix": "use hashlib, or bcrypt / argon2-cffi from PyPI.",
  "source": "PEP 594"
 },
 {
  "id": "imghdr",
  "removed_in": "3.13",
  "sev": "error",
  "patterns": [
   "^\\s*(?:from\\s+imghdr(?:\\.[\\w.]+)?\\s+import\\b|import\\s+(?:[\\w.]+(?:\\s+as\\s+\\w+)?\\s*,\\s*)*imghdr(?:\\.[\\w.]+)?(?=\\s|,|$))"
  ],
  "msg": "The imghdr module was removed (dead battery).",
  "fix": "use the filetype or Pillow package.",
  "source": "PEP 594"
 },
 {
  "id": "mailcap",
  "removed_in": "3.13",
  "sev": "error",
  "patterns": [
   "^\\s*(?:from\\s+mailcap(?:\\.[\\w.]+)?\\s+import\\b|import\\s+(?:[\\w.]+(?:\\s+as\\s+\\w+)?\\s*,\\s*)*mailcap(?:\\.[\\w.]+)?(?=\\s|,|$))"
  ],
  "msg": "The mailcap module was removed (dead battery).",
  "fix": "use mimetypes.",
  "source": "PEP 594"
 },
 {
  "id": "msilib",
  "removed_in": "3.13",
  "sev": "error",
  "patterns": [
   "^\\s*(?:from\\s+msilib(?:\\.[\\w.]+)?\\s+import\\b|import\\s+(?:[\\w.]+(?:\\s+as\\s+\\w+)?\\s*,\\s*)*msilib(?:\\.[\\w.]+)?(?=\\s|,|$))"
  ],
  "msg": "The msilib module was removed (dead battery).",
  "fix": "use a PyPI MSI tool.",
  "source": "PEP 594"
 },
 {
  "id": "nis",
  "removed_in": "3.13",
  "sev": "error",
  "patterns": [
   "^\\s*(?:from\\s+nis(?:\\.[\\w.]+)?\\s+import\\b|import\\s+(?:[\\w.]+(?:\\s+as\\s+\\w+)?\\s*,\\s*)*nis(?:\\.[\\w.]+)?(?=\\s|,|$))"
  ],
  "msg": "The nis module was removed (dead battery).",
  "fix": "use a PyPI replacement.",
  "source": "PEP 594"
 },
 {
  "id": "nntplib",
  "removed_in": "3.13",
  "sev": "error",
  "patterns": [
   "^\\s*(?:from\\s+nntplib(?:\\.[\\w.]+)?\\s+import\\b|import\\s+(?:[\\w.]+(?:\\s+as\\s+\\w+)?\\s*,\\s*)*nntplib(?:\\.[\\w.]+)?(?=\\s|,|$))"
  ],
  "msg": "The nntplib module was removed (dead battery).",
  "fix": "use the pynntp package from PyPI.",
  "source": "PEP 594"
 },
 {
  "id": "ossaudiodev",
  "removed_in": "3.13",
  "sev": "error",
  "patterns": [
   "^\\s*(?:from\\s+ossaudiodev(?:\\.[\\w.]+)?\\s+import\\b|import\\s+(?:[\\w.]+(?:\\s+as\\s+\\w+)?\\s*,\\s*)*ossaudiodev(?:\\.[\\w.]+)?(?=\\s|,|$))"
  ],
  "msg": "The ossaudiodev module was removed (dead battery).",
  "fix": "use a PyPI audio library.",
  "source": "PEP 594"
 },
 {
  "id": "pipes",
  "removed_in": "3.13",
  "sev": "error",
  "patterns": [
   "^\\s*(?:from\\s+pipes(?:\\.[\\w.]+)?\\s+import\\b|import\\s+(?:[\\w.]+(?:\\s+as\\s+\\w+)?\\s*,\\s*)*pipes(?:\\.[\\w.]+)?(?=\\s|,|$))"
  ],
  "msg": "The pipes module was removed (dead battery).",
  "fix": "use subprocess and shlex.quote().",
  "source": "PEP 594"
 },
 {
  "id": "sndhdr",
  "removed_in": "3.13",
  "sev": "error",
  "patterns": [
   "^\\s*(?:from\\s+sndhdr(?:\\.[\\w.]+)?\\s+import\\b|import\\s+(?:[\\w.]+(?:\\s+as\\s+\\w+)?\\s*,\\s*)*sndhdr(?:\\.[\\w.]+)?(?=\\s|,|$))"
  ],
  "msg": "The sndhdr module was removed (dead battery).",
  "fix": "use the filetype package.",
  "source": "PEP 594"
 },
 {
  "id": "spwd",
  "removed_in": "3.13",
  "sev": "error",
  "patterns": [
   "^\\s*(?:from\\s+spwd(?:\\.[\\w.]+)?\\s+import\\b|import\\s+(?:[\\w.]+(?:\\s+as\\s+\\w+)?\\s*,\\s*)*spwd(?:\\.[\\w.]+)?(?=\\s|,|$))"
  ],
  "msg": "The spwd module was removed (dead battery).",
  "fix": "use the python-pam package.",
  "source": "PEP 594"
 },
 {
  "id": "sunau",
  "removed_in": "3.13",
  "sev": "error",
  "patterns": [
   "^\\s*(?:from\\s+sunau(?:\\.[\\w.]+)?\\s+import\\b|import\\s+(?:[\\w.]+(?:\\s+as\\s+\\w+)?\\s*,\\s*)*sunau(?:\\.[\\w.]+)?(?=\\s|,|$))"
  ],
  "msg": "The sunau module was removed (dead battery).",
  "fix": "use a PyPI audio library.",
  "source": "PEP 594"
 },
 {
  "id": "telnetlib",
  "removed_in": "3.13",
  "sev": "error",
  "patterns": [
   "^\\s*(?:from\\s+telnetlib(?:\\.[\\w.]+)?\\s+import\\b|import\\s+(?:[\\w.]+(?:\\s+as\\s+\\w+)?\\s*,\\s*)*telnetlib(?:\\.[\\w.]+)?(?=\\s|,|$))"
  ],
  "msg": "The telnetlib module was removed (dead battery).",
  "fix": "use telnetlib3 or Exscript from PyPI, or SSH (paramiko).",
  "source": "PEP 594"
 },
 {
  "id": "uu",
  "removed_in": "3.13",
  "sev": "error",
  "patterns": [
   "^\\s*(?:from\\s+uu(?:\\.[\\w.]+)?\\s+import\\b|import\\s+(?:[\\w.]+(?:\\s+as\\s+\\w+)?\\s*,\\s*)*uu(?:\\.[\\w.]+)?(?=\\s|,|$))"
  ],
  "msg": "The uu module was removed (dead battery).",
  "fix": "use base64.",
  "source": "PEP 594"
 },
 {
  "id": "xdrlib",
  "removed_in": "3.13",
  "sev": "error",
  "patterns": [
   "^\\s*(?:from\\s+xdrlib(?:\\.[\\w.]+)?\\s+import\\b|import\\s+(?:[\\w.]+(?:\\s+as\\s+\\w+)?\\s*,\\s*)*xdrlib(?:\\.[\\w.]+)?(?=\\s|,|$))"
  ],
  "msg": "The xdrlib module was removed (dead battery).",
  "fix": "use struct.",
  "source": "PEP 594"
 },
 {
  "id": "lib2to3",
  "removed_in": "3.13",
  "sev": "error",
  "patterns": [
   "^\\s*(?:from\\s+lib2to3(?:\\.[\\w.]+)?\\s+import\\b|import\\s+(?:[\\w.]+(?:\\s+as\\s+\\w+)?\\s*,\\s*)*lib2to3(?:\\.[\\w.]+)?(?=\\s|,|$))"
  ],
  "msg": "lib2to3 and the 2to3 tool were removed.",
  "fix": "use a maintained parser such as libcst or parso.",
  "source": "What's New 3.13"
 },
 {
  "id": "tkinter-tix",
  "removed_in": "3.13",
  "sev": "error",
  "patterns": [
   "^\\s*(?:from\\s+tkinter\\.tix(?:\\.[\\w.]+)?\\s+import\\b|import\\s+(?:[\\w.]+(?:\\s+as\\s+\\w+)?\\s*,\\s*)*tkinter\\.tix(?:\\.[\\w.]+)?(?=\\s|,|$))",
   "^\\s*from\\s+tkinter\\s+import\\b.*\\btix\\b"
  ],
  "msg": "tkinter.tix was removed.",
  "fix": "use tkinter.ttk.",
  "source": "What's New 3.13"
 },
 {
  "id": "locale-resetlocale",
  "removed_in": "3.13",
  "sev": "error",
  "patterns": [
   "\\blocale\\.resetlocale\\s*\\("
  ],
  "msg": "locale.resetlocale() was removed.",
  "fix": "use locale.setlocale(locale.LC_ALL, '').",
  "source": "What's New 3.13"
 },
 {
  "id": "typing-io-re",
  "removed_in": "3.13",
  "sev": "error",
  "patterns": [
   "\\btyping\\.(?:io|re)\\b"
  ],
  "msg": "The typing.io and typing.re namespaces were removed.",
  "fix": "import IO, TextIO, BinaryIO, Pattern, Match directly from typing.",
  "source": "What's New 3.13"
 },
 {
  "id": "unittest-makesuite",
  "removed_in": "3.13",
  "sev": "error",
  "patterns": [
   "\\bunittest\\.(?:makeSuite|findTestCases|getTestCaseNames)\\b"
  ],
  "msg": "unittest.makeSuite / findTestCases / getTestCaseNames were removed.",
  "fix": "use unittest.TestLoader methods (loadTestsFromTestCase, loadTestsFromModule, getTestCaseNames).",
  "source": "What's New 3.13"
 },
 {
  "id": "ast-constants",
  "removed_in": "3.14",
  "sev": "error",
  "patterns": [
   "\\bast\\.(?:Num|Str|Bytes|NameConstant|Ellipsis)\\b"
  ],
  "msg": "ast.Num / Str / Bytes / NameConstant / Ellipsis were removed.",
  "fix": "use ast.Constant and check type(node.value).",
  "source": "What's New 3.14"
 },
 {
  "id": "pkgutil-loader",
  "removed_in": "3.14",
  "sev": "error",
  "patterns": [
   "\\bpkgutil\\.(?:find_loader|get_loader)\\b"
  ],
  "msg": "pkgutil.find_loader() / get_loader() were removed.",
  "fix": "use importlib.util.find_spec().",
  "source": "What's New 3.14"
 },
 {
  "id": "asyncio-child-watcher",
  "removed_in": "3.14",
  "sev": "error",
  "patterns": [
   "\\b(?:get_child_watcher|set_child_watcher|AbstractChildWatcher|SafeChildWatcher|FastChildWatcher|ThreadedChildWatcher|PidfdChildWatcher|MultiLoopChildWatcher)\\b"
  ],
  "msg": "asyncio child watcher classes and functions were removed.",
  "fix": "delete the watcher setup; asyncio subprocesses work without it.",
  "source": "What's New 3.14"
 },
 {
  "id": "urlopener",
  "removed_in": "3.14",
  "sev": "error",
  "patterns": [
   "\\b(?:FancyURLopener|URLopener)\\b"
  ],
  "msg": "urllib.request.URLopener / FancyURLopener were removed.",
  "fix": "use urllib.request.urlopen() or build_opener().",
  "source": "What's New 3.14"
 },
 {
  "id": "importlib-abc-resources",
  "removed_in": "3.14",
  "sev": "error",
  "patterns": [
   "\\bimportlib\\.abc\\.(?:ResourceReader|Traversable|TraversableResources)\\b",
   "^\\s*from\\s+importlib\\.abc\\s+import\\b.*\\b(?:ResourceReader|Traversable|TraversableResources)\\b"
  ],
  "msg": "importlib.abc ResourceReader / Traversable / TraversableResources were removed.",
  "fix": "import them from importlib.resources.abc.",
  "source": "What's New 3.14"
 },
 {
  "id": "sqlite3-version",
  "removed_in": "3.14",
  "sev": "error",
  "patterns": [
   "\\bsqlite3\\.version(?:_info)?\\b"
  ],
  "msg": "sqlite3.version / version_info (the module version) were removed.",
  "fix": "use sqlite3.sqlite_version for the SQLite library version.",
  "source": "What's New 3.14"
 }
];</script>
<script>// Python upgrade lint: stdlib modules and APIs removed in Python 3.12, 3.13 and 3.14.
(function () {
  var RULES = (typeof module !== 'undefined') ? require('./rules.json') : window.PYUP_RULES;
  var COMPILED = RULES.map(function (r) {
    return { r: r, res: r.patterns.map(function (p) { return new RegExp(p); }) };
  });
  var TARGETS = ['3.12', '3.13', '3.14'];

  function ver(v) { var p = String(v).split('.'); return (+p[0]) * 100 + (+p[1] || 0); }

  // Blank out string literals and trailing comments so "cgi" inside a docstring does not fire.
  function codeOnly(line) {
    return line.replace(/("""|''').*?\1/g, '""').replace(/"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'/g, '""').replace(/#.*$/, '');
  }

  function check(text, opts) {
    opts = opts || {};
    var target = TARGETS.indexOf(String(opts.target)) >= 0 ? String(opts.target) : '3.14';
    var tv = ver(target);
    var lines = String(text || '').split(/\r?\n/);
    var findings = [];
    var inDoc = null;
    for (var i = 0; i < lines.length; i++) {
      var raw = lines[i];
      if (inDoc) { if (raw.indexOf(inDoc) >= 0) inDoc = null; continue; }
      var m = raw.match(/^\s*[rbuRBU]{0,2}("""|''')/);
      if (m && raw.split(m[1]).length === 2) { inDoc = m[1]; continue; }
      var code = codeOnly(raw);
      if (!code.trim()) continue;
      for (var k = 0; k < COMPILED.length; k++) {
        var c = COMPILED[k], r = c.r;
        if (ver(r.removed_in) > tv) continue;
        for (var j = 0; j < c.res.length; j++) {
          if (c.res[j].test(code)) {
            var verb = r.sev === 'warn' ? 'Deprecated since' : 'Removed in';
            findings.push({ check: r.id, sev: r.sev, line: i + 1, removed_in: r.removed_in,
              msg: r.msg + ' ' + verb + ' Python ' + r.removed_in + ' (' + r.source + '). Fix: ' + r.fix });
            break;
          }
        }
      }
    }
    var errors = findings.filter(function (f) { return f.sev === 'error'; }).length;
    return { findings: findings, target: target, errors: errors, warnings: findings.length - errors };
  }

  var api = { engine: { check: check }, RULES: RULES, RULE_COUNT: RULES.length, TARGETS: TARGETS };
  if (typeof module !== 'undefined') module.exports = api;
  if (typeof window !== 'undefined') window.PYUPENGINE = api;
})();
</script>
<script>// ⛔뼈대 — kit/scaffold.py 가 찍는다 (s143). findings [{check,sev,msg,line?}] → 글/HTML. 같은 파일이 Node 와 브라우저에서 산다.
'use strict';
function escapeHtml(s) { return String(s == null ? '' : s).replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/"/g, '&quot;'); }
function summaryLine(res) {
  const f = (res && res.findings) || []; const e = f.filter(function (x) { return String(x.sev || 'error').toLowerCase().startsWith('err'); }).length;
  return f.length ? (f.length + ' finding' + (f.length === 1 ? '' : 's') + ' (' + e + ' error' + (e === 1 ? '' : 's') + ')') : 'Clean — no findings.';
}
function toText(res, label) {
  const f = (res && res.findings) || [];
  const lines = ['== ' + (label || '') + ' — ' + summaryLine(res)];
  f.forEach(function (x) { lines.push('  ' + String(x.sev || 'error').toUpperCase().slice(0, 4) + '  ' + (x.line ? 'L' + x.line + '  ' : '') + (x.check || x.id || '') + '  ' + (x.msg || x.message || '')); });
  return lines.join('\n');
}
function toHtml(res) {
  const f = (res && res.findings) || [];
  if (!f.length) return '<p class="ok">' + escapeHtml(summaryLine(res)) + '</p>';
  const rows = f.map(function (x) { return '<tr><td class="sev ' + escapeHtml(String(x.sev || 'error')) + '">' + escapeHtml(String(x.sev || 'error')) + '</td><td>' + (x.line ? 'L' + escapeHtml(x.line) : '') + '</td><td><code>' + escapeHtml(x.check || x.id || '') + '</code></td><td>' + escapeHtml(x.msg || x.message || '') + '</td></tr>'; }).join('');
  return '<p class="sum">' + escapeHtml(summaryLine(res)) + '</p><table><thead><tr><th>Level</th><th>Line</th><th>Check</th><th>What</th></tr></thead><tbody>' + rows + '</tbody></table>';
}
var PYUPREPORT = { escapeHtml: escapeHtml, summaryLine: summaryLine, toText: toText, toHtml: toHtml };
if (typeof module !== 'undefined' && module.exports) module.exports = PYUPREPORT;
else window.PYUPREPORT = PYUPREPORT;
</script>
<script>
(function(){
  var src=document.getElementById('src'), out=document.getElementById('out'), go=document.getElementById('go'), today=document.getElementById('today');
  today.value=new Date().toISOString().slice(0,10);
  function run(){ try { var res=window.PYUPENGINE.engine.check(src.value,{today:today.value,target:document.getElementById('target').value}); out.innerHTML=window.PYUPREPORT.toHtml(res); } catch(e){ out.innerHTML='<p class="sev error">Could not run: '+String(e.message||e)+'</p>'; } }
  go.onclick=run; document.getElementById('target').onchange=run; if (src.value.trim()) run();
})();
</script>


<section data-yj-install="free" style="margin:2rem auto 1rem;max-width:46rem;padding:1.25rem 1.25rem;border:1px solid #cfe3d6;border-radius:12px;background:#f6fbf8;font:16px/1.6 system-ui,-apple-system,Segoe UI,sans-serif"><h2 style="margin:0 0 .4rem;font-size:1.2rem">Install free</h2><p style="margin:0 0 .8rem;color:#41505f">Free for the file open in your editor - no key, no limit. The workspace sweep and the report ask for a key.</p><a href="https://marketplace.visualstudio.com/items?itemName=ReadyStack.python-upgrade-removed-api-lint" rel="noopener" data-yj-install-door="mp" onclick="try{navigator.sendBeacon('/api/ev',new Blob([JSON.stringify({t:'install',slug:'python-upgrade-removed-api-lint',src:'mp',path:location.pathname})],{type:'application/json'}))}catch(e){}" style="display:inline-block;margin:0 .5rem .5rem 0;padding:.6rem 1rem;border-radius:8px;background:#0f7b3f;color:#fff;text-decoration:none;font-weight:600">VS Code Marketplace</a><pre style="margin:.5rem 0 0;padding:.6rem .8rem;background:#f3f5f8;border-radius:8px;font-size:.9rem;overflow:auto">ext install ReadyStack.python-upgrade-removed-api-lint</pre><p style="margin:.6rem 0 0;font-size:.92rem;color:#41505f"><a href="https://getreadystack.com/api/buy/team" rel="nofollow" style="color:#0f7b3f;text-decoration:underline">Team? One key for every ReadyStack linter, 5 seats, $149 once</a></p></section>
<section data-yj-alert="rule" style="margin:1rem auto 1.5rem;max-width:46rem;padding:1.1rem 1.25rem;border:1px solid #d9dee6;border-radius:12px;background:#fbfcfd;font:15px/1.55 system-ui,-apple-system,Segoe UI,sans-serif"><b style="font-size:1.05rem">Get one email when this rule changes</b><div style="opacity:.78;margin:.35rem 0 .8rem">We watch the regulation and vendor sources behind Python Upgrade Lint: Removed Stdlib 3.12-3.14 every day. When a rule changes, you get a single email with what changed and the updated check. No newsletter.</div><div style="display:flex;gap:8px;flex-wrap:wrap"><input id="yjae" type="email" placeholder="you@example.com" style="flex:1;min-width:210px;padding:11px 13px;border:1px solid rgba(140,150,165,.34);border-radius:8px;background:#fff;color:inherit"><button id="yjab" style="padding:11px 18px;border-radius:8px;border:0;cursor:pointer;background:#0f7b3f;color:#fff;font:600 15px system-ui,sans-serif">Notify me</button></div><div id="yjao" hidden style="margin-top:.6rem;color:#0f7b3f">You're on the list. One email when it changes.</div><script>(function(){var b=document.getElementById("yjab"),e=document.getElementById("yjae");if(!b||!e)return;b.addEventListener("click",function(){var v=e.value.trim();if(!/.+@.+\..+/.test(v))return;try{localStorage.setItem("yj_em","1");}catch(_){}fetch(location.origin+"/api/subscribe",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:v,slug:"python-upgrade-removed-api-lint",lang:"en",source:"rule_alert"+((b.closest&&b.closest("section")&&b.closest("section").getAttribute("data-yj-moved"))?"_at_result":"")})}).then(function(r){var o=document.getElementById("yjao");o.hidden=false;if(!r.ok){o.textContent="Could not save - please try again.";}}).catch(function(){var o=document.getElementById("yjao");o.hidden=false;o.textContent="Could not save - please try again.";});});})();</script><script>(function(){var e=document.getElementById("yjae"),s=e&&e.closest?e.closest("section"):null,o=document.getElementById("out");if(!s||!o)return;var d=false;function mv(ev){if(d)return;if(ev&&ev.target&&s.contains(ev.target))return;d=true;var b=o;while(b.parentNode&&b.parentNode!==document.body&&b.parentNode.tagName!=="MAIN"&&b.parentNode.tagName!=="ARTICLE")b=b.parentNode;if(!b.parentNode||b===s||b.contains(s))return;try{b.parentNode.insertBefore(s,b.nextSibling);s.setAttribute("data-yj-moved","1");}catch(_){}}document.addEventListener("input",mv,true);document.addEventListener("change",mv,true);document.addEventListener("click",function(ev){var b=ev.target&&ev.target.closest?ev.target.closest("button,input[type=submit]"):null;if(b&&!b.closest("[data-yj],[data-yj-cta],[data-yj-install],[data-yj-alert],.yj-find,.yj-related,#yj-ask,.yjp"))mv(ev);},true);})();</script></section>

<section data-yj-cta="paid" style="margin:3rem auto;max-width:46rem;padding:1.5rem 1.25rem;border:1px solid #d8dee9;border-radius:12px;background:#fbfcfe;font:16px/1.6 system-ui,-apple-system,Segoe UI,sans-serif"><h2 style="margin:0 0 .5rem;font-size:1.25rem">Get the full version <span class="yj-price">$29</span></h2><p class="yj-cta-paid" style="margin:.25rem 0 .6rem;color:#1f2a37">Sweep the whole workspace in one pass and export a Markdown upgrade report for each target version to attach to the migration ticket.</p><p class="yj-cta-pay" style="margin:.25rem 0 1rem;color:#5b6b7c;font-size:.94rem">One payment, one licence key for this tool. The key is shown right after payment.</p><p class="yj-cta-anchor" style="margin:0 0 1rem;color:#5b6b7c;font-size:.94rem">By hand, this is developer hours at the US median software developer wage of $63.98 an hour (BLS, May 2024).</p><a href="https://getreadystack.com/api/buy/cl/polar_cl_2Izy69ZyqcJdKkYcQRlrKODleXMjHPRFCgWjE3eTaR6" rel="nofollow" style="display:inline-block;padding:.7rem 1.3rem;border-radius:8px;background:#1b64f2;color:#fff;text-decoration:none;font-weight:600">Buy the full version — $29</a></section>
<!--yj-share-s101--><div style="margin:28px 0 8px;text-align:center"><button id="yjcp" type="button" style="font:inherit;padding:10px 18px;border:1px solid #8884;border-radius:10px;background:transparent;cursor:pointer">Copy link</button><button id="yjimg" type="button" style="font:inherit;padding:10px 18px;margin-left:8px;border:1px solid #8884;border-radius:10px;background:transparent;cursor:pointer">Save result as image</button></div><script>(function(){var b=document.getElementById("yjimg");if(!b)return;b.addEventListener("click",function(){var o=document.getElementById("out");var txt=(o&&(o.innerText||o.textContent)||"").trim();if(!txt){b.textContent="(no result yet)";setTimeout(function(){b.textContent="Save result as image";},1500);return;}var lines=txt.split(String.fromCharCode(10)).filter(function(x){return x.trim();}).slice(0,10);var W=1200,P=56,c=document.createElement("canvas");c.width=W;var lh=38,H=P*2+70+lines.length*lh+60;c.height=H;var x=c.getContext("2d");x.fillStyle="#1a1512";x.fillRect(0,0,W,H);x.fillStyle="#f3e9d2";x.font="600 34px system-ui,Segoe UI,Arial";var t=(document.title||"").split("|")[0].trim();x.fillText(t.slice(0,54),P,P+34);x.font="22px ui-monospace,Menlo,Consolas,monospace";x.fillStyle="#e8dcc4";for(var i=0;i<lines.length;i++){x.fillText(lines[i].slice(0,88),P,P+70+i*lh+22);}x.font="600 22px system-ui,Segoe UI,Arial";x.fillStyle="#c9a227";var d=location.hostname.replace("www.","");x.fillText(d,W-P-x.measureText(d).width,H-P+6);c.toBlob(function(bl){var u=URL.createObjectURL(bl),a=document.createElement("a");a.href=u;a.download=(t||"result").replace(/[^a-z0-9]+/gi,"-").toLowerCase()+"-"+d+".png";document.body.appendChild(a);a.click();setTimeout(function(){URL.revokeObjectURL(u);a.remove();},2000);},"image/png");});})();</script><script>(function(){var b=document.getElementById("yjcp");if(!b)return;var t=b.textContent;b.addEventListener("click",function(){var u=location.href.split("#")[0];function d(){b.textContent="Link copied";setTimeout(function(){b.textContent=t;},1800);}if(navigator.clipboard&&navigator.clipboard.writeText){navigator.clipboard.writeText(u).then(d,function(){prompt("",u);});}else{prompt("",u);}});})();</script>
<script data-yj="yj-view-beacon">(function(){try{var p=location.pathname;var k='yjv:'+p;if(sessionStorage.getItem(k))return;sessionStorage.setItem(k,'1');fetch('/api/ev',{method:'POST',keepalive:true,headers:{'Content-Type':'application/json'},body:JSON.stringify({path:p,lang:"en",ref:(document.referrer||''),src:(function(){try{return (new URLSearchParams(location.search).get('ref')||'').replace(/[^a-z_]/g,'').slice(0,12)}catch(e){return ''}})()})}).catch(function(){});}catch(e){}})();</script>

<script data-yj="yj-use-beacon">(function(){try{var o=document.getElementById('out');if(!o)return;var p=location.pathname,k='yju:'+p,sent=false;function fire(){if(sent||sessionStorage.getItem(k))return;if(!(o.textContent||'').replace(/\s+/g,'').length)return;sent=true;sessionStorage.setItem(k,'1');fetch('/api/ev',{method:'POST',keepalive:true,headers:{'Content-Type':'application/json'},body:JSON.stringify({path:p,lang:"en",t:'use',src:(function(){try{return (new URLSearchParams(location.search).get('ref')||'').replace(/[^a-z_]/g,'').slice(0,12)}catch(e){return ''}})()})}).catch(function(){});}var mo=new MutationObserver(function(){fire();if(sent)mo.disconnect();});mo.observe(o,{childList:true,characterData:true,subtree:true});}catch(e){}})();</script><div class="yj-home-find"><div class="yj-lgbar"><a href="/" class="yj-lg on">EN</a><a href="/de/" class="yj-lg">DE</a><a href="/ja/" class="yj-lg">JA</a><a href="/es/" class="yj-lg">ES</a><a href="/pt/" class="yj-lg">PT</a></div><section class="yj-find"><h2>Find a tool</h2><input id="yjq" type="search" autocomplete="off" placeholder="Type a product name, format or task"><div id="yjr"></div></section><style>.yj-lgbar{position:absolute;top:14px;right:18px;display:flex;gap:6px;z-index:60}.yj-lg{font:600 12px/1 system-ui,sans-serif;padding:6px 9px;border-radius:4px;text-decoration:none;color:#8b96a3;border:1px solid rgba(140,150,165,.28)}.yj-lg:hover{color:#e8eaed;border-color:rgba(160,175,195,.6)}.yj-lg.on{color:#0e1116;background:#cfd6de;border-color:#cfd6de}.yj-find{max-width:760px;margin:34px auto 8px;padding:0 20px}.yj-find h2{font:600 20px/1.3 system-ui,sans-serif;margin:0 0 10px}#yjq{width:100%;box-sizing:border-box;padding:13px 15px;font:400 15.5px system-ui,sans-serif;border:1px solid rgba(140,150,165,.34);border-radius:8px;background:rgba(255,255,255,.04);color:inherit}#yjq:focus{outline:none;border-color:#7FD1C4}#yjr{margin-top:10px;display:flex;flex-direction:column;gap:6px}#yjr a{display:flex;justify-content:space-between;gap:12px;padding:11px 14px;border:1px solid rgba(140,150,165,.22);border-radius:6px;text-decoration:none;font:400 14.5px/1.4 system-ui,sans-serif;color:inherit}#yjr a:hover{border-color:#7FD1C4}#yjr .pr{font:600 13px system-ui,sans-serif;color:#5fbf9a;white-space:nowrap}</style><script>(function(){var q=document.getElementById("yjq"),r=document.getElementById("yjr"),D=null;function load(){if(D)return Promise.resolve(D);return fetch("/search-index.json").then(function(x){return x.json();}).then(function(j){D=j;return j;}).catch(function(){D=[];return D;});}function esc(t){return String(t).replace(/[&<>"]/g,function(c){return {"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"}[c];});}function run(){var v=q.value.trim().toLowerCase();if(v.length<2){r.innerHTML="";return;}load().then(function(j){var w=v.split(/\s+/),o=[];for(var i=0;i<j.length&&o.length<12;i++){var t=j[i].t.toLowerCase();var ok=true;for(var k=0;k<w.length;k++){if(t.indexOf(w[k])<0){ok=false;break;}}if(ok)o.push(j[i]);}r.innerHTML=o.length?o.map(function(x){return "<a href=\""+esc(x.u)+"\">"+"<span>"+esc(x.t)+"</span>"+(x.p?"<span class=\"pr\">$"+x.p+"</span>":"")+"</a>";}).join(""):"";});}q.addEventListener("input",run);q.addEventListener("focus",load);})();</script></div><section data-yj="yj-facts-v1" style="max-width:920px;margin:48px auto 0;padding:0 20px;font-family:system-ui,sans-serif"><style>.yj-article p{font:400 15.5px/1.7 system-ui,sans-serif;color:#26313b;margin:0 0 12px;max-width:72ch}.yj-article h2,.yj-article h3,.yj-article h4{font:600 17px/1.35 system-ui,sans-serif;color:#1b1f24;margin:22px 0 8px}.yj-article table{border-collapse:collapse;margin:10px 0 16px;font:14px/1.45 system-ui,sans-serif}.yj-article th,.yj-article td{border:1px solid #e2e6ea;padding:6px 10px;text-align:left}.yj-article th{background:#f4f6f8}.yj-article pre{background:#0f1720;color:#e6edf3;padding:12px 14px;border-radius:8px;overflow:auto;font:13px/1.5 ui-monospace,Menlo,monospace}.yj-article code{font:13px ui-monospace,Menlo,monospace;background:#f1f3f5;padding:1px 4px;border-radius:3px}.yj-article pre code{background:none;padding:0}.yj-article ul,.yj-article ol{font:15px/1.6 system-ui,sans-serif;color:#26313b}</style><p style="font:400 13px/1.5 system-ui,sans-serif;color:#6b7680;margin:0 0 14px"><time datetime="2026-09-23">Updated 2026-09-23</time> · ReadyStack</p><script type="application/ld+json">{"@context":"https://schema.org","@type":"WebPage","dateModified":"2026-09-23","author":{"@type":"Organization","name":"ReadyStack"}}</script><h2 style="font:600 21px/1.3 system-ui,sans-serif;margin:0 0 6px;color:#1b1f24">Worked example</h2><p style="font:400 14.5px/1.5 system-ui,sans-serif;margin:0 0 16px;color:#5b6570">Real numbers from this tool, line by line.</p><div class="yj-article"><p>Six lines in our 46-line sample job break on Python 3.14, and the full check found 14 findings in that one file. This is for Python developers and platform teams in the US, the UK and Europe who have to move services off Python 3.10 before it reaches end of life in October 2026.</p>
<h3>The date that forces the upgrade</h3>
<p>Python 3.10 gets security fixes until October 2026. After that, a CVE in the interpreter or the standard library stays unpatched on 3.10, and security scanners and base images start to flag it. Most teams jump to 3.12, 3.13 or 3.14. Each of those versions removed part of the standard library, and code written for 3.10 often still uses those parts.</p>
<p>The failure is not subtle. <code>import cgi</code> works on 3.12 and raises <code>ModuleNotFoundError</code> on 3.13. <code>import imp</code> already fails on 3.12. <code>self.assertEquals(...)</code> in a test file becomes an <code>AttributeError</code> on 3.12. <code>isinstance(node, ast.Str)</code> stops working on 3.14.</p>
<h3>What we measured</h3>
<p>We wrote a small nightly job the way many 3.10 codebases look: it loads plugins with <code>imp</code>, parses a form with <code>cgi</code>, quotes shell commands with <code>pipes</code>, talks to a device with <code>telnetlib</code>, reads config with <code>SafeConfigParser</code> and <code>readfp()</code>, wraps a socket with <code>ssl.wrap_socket()</code> and walks an AST with <code>ast.Str</code>.</p>
<p>Then we ran the checker with each target version:</p>
<ul><li>target 3.12: 8 findings (7 removed, 1 deprecated)</li><li>target 3.13: 12 findings (11 removed, 1 deprecated)</li><li>target 3.14: 14 findings (13 removed, 1 deprecated)</li></ul>
<p>The deprecated one is <code>datetime.utcnow()</code>. It still runs, but it returns a naive datetime and is on its way out. The cleaned-up version of the same file, rewritten with <code>importlib</code>, <code>shlex.quote</code>, <code>ConfigParser.read_file</code>, <code>SSLContext.wrap_socket</code> and <code>ast.Constant</code>, gives 0 findings.</p>
<h3>Why the interpreter alone is slow</h3>
<p>You can install 3.13 and run the code. It stops at the first <code>ModuleNotFoundError</code>, you fix that one, and you run it again. Removed methods only fail when that code path runs, so a rarely used branch can ship broken. A chatbot answer is no better: it lists removed modules from memory, it does not read your file, and it often gets the version wrong (<code>imp</code> went in 3.12, <code>cgi</code> in 3.13, <code>ast.Str</code> in 3.14).</p>
<p>AI coding assistants learned from years of older Python. Code they write today can still contain these imports, so reviewing AI-written Python for them is part of the same job.</p>
<h3>How the check works</h3>
<p>The rule table has 43 rules: 13 for 3.12 (including <code>distutils</code> from PEP 632, <code>imp</code>, <code>asyncore</code>, <code>smtpd</code> and the old unittest aliases), 24 for 3.13 (the 19 PEP 594 dead-battery modules plus <code>lib2to3</code>, <code>tkinter.tix</code>, <code>typing.io</code> and others), and 6 for 3.14 (<code>ast.Num</code>/<code>ast.Str</code>, <code>pkgutil.find_loader</code>, asyncio child watchers, <code>URLopener</code>, <code>importlib.abc</code> resource classes, <code>sqlite3.version</code>). Strings, docstrings and comments are skipped. Each finding names the line, the version, the source and the replacement.</p>
<h3>Try it on your file</h3>
<p>The web page and the VS Code extension use the same engine. Paste one .py file, pick 3.12, 3.13 or 3.14, and read the list. That part is free and complete for one file. When you need the whole repository swept in one pass and a written report for the migration ticket, that part takes a licence key.</p>
<p>For scale: by hand, this is a developer grepping for dozens of names and checking three What&#x27;s New pages. The US median software developer wage is $63.98 an hour (BLS, May 2024).</p></div><h2 style="font:600 21px/1.3 system-ui,sans-serif;margin:34px 0 6px;color:#1b1f24">Questions people ask</h2><details style="border-bottom:1px solid #e6e9ed;padding:10px 0"><summary style="cursor:pointer;font:600 15px/1.4 system-ui,sans-serif;color:#1b1f24">What does Python Upgrade Lint do?</summary><p style="margin:8px 0 2px;font:400 14.5px/1.6 system-ui,sans-serif;color:#33404b">It reads a Python .py file and marks every line that uses a standard-library module or API removed in Python 3.12, 3.13 or 3.14, such as cgi, imp, distutils, telnetlib, the old unittest aliases or ast.Str. It checks 43 rules. For each finding it shows the line number, the version that removed it, the PEP or What&#x27;s New source, and the replacement to use.</p></details><details style="border-bottom:1px solid #e6e9ed;padding:10px 0"><summary style="cursor:pointer;font:600 15px/1.4 system-ui,sans-serif;color:#1b1f24">Who is Python Upgrade Lint for?</summary><p style="margin:8px 0 2px;font:400 14.5px/1.6 system-ui,sans-serif;color:#33404b">Python developers and platform teams moving services off Python 3.10 before its October 2026 end of life, and anyone upgrading a Django, Flask, script or data-pipeline codebase to Python 3.12, 3.13 or 3.14. It also suits reviewers of AI-written Python, because assistants trained on older code can still produce imports such as cgi, imp or distutils.</p></details><details style="border-bottom:1px solid #e6e9ed;padding:10px 0"><summary style="cursor:pointer;font:600 15px/1.4 system-ui,sans-serif;color:#1b1f24">Why not ask a chatbot or rely on a free tool?</summary><p style="margin:8px 0 2px;font:400 14.5px/1.6 system-ui,sans-serif;color:#33404b">A chatbot lists removed modules from memory. It does not read your file line by line, and it often mixes up the version: imp was removed in 3.12, cgi in 3.13 and ast.Str in 3.14. Running the new interpreter only shows the first ModuleNotFoundError, one at a time. This checker applies one fixed table of 43 rules and reports every hit at once.</p></details><details style="border-bottom:1px solid #e6e9ed;padding:10px 0"><summary style="cursor:pointer;font:600 15px/1.4 system-ui,sans-serif;color:#1b1f24">What is free and what needs a licence key?</summary><p style="margin:8px 0 2px;font:400 14.5px/1.6 system-ui,sans-serif;color:#33404b">Free, with no key: check one open .py file against all 43 rules, in VS Code or pasted into the web page, and pick 3.12, 3.13 or 3.14 as the target. The paid licence ($29 once, one key per person or team seat) adds a whole-workspace sweep in one pass and a Markdown upgrade report for each target version to attach to the migration ticket.</p></details><details style="border-bottom:1px solid #e6e9ed;padding:10px 0"><summary style="cursor:pointer;font:600 15px/1.4 system-ui,sans-serif;color:#1b1f24">What does it cost to find these lines by hand?</summary><p style="margin:8px 0 2px;font:400 14.5px/1.6 system-ui,sans-serif;color:#33404b">By hand, a developer greps for each removed module and API, cross-checks the Python What&#x27;s New pages for 3.12, 3.13 and 3.14, and then fixes the hits. The US median software developer wage is $63.98 an hour (BLS, May 2024), so every hour of searching costs about that much. On our 46-line sample file the checker reported 14 findings at once.</p></details><script type="application/ld+json" data-yj="yj-faq-ld">{"@context": "https://schema.org", "@type": "FAQPage", "mainEntity": [{"@type": "Question", "name": "What does Python Upgrade Lint do?", "acceptedAnswer": {"@type": "Answer", "text": "It reads a Python .py file and marks every line that uses a standard-library module or API removed in Python 3.12, 3.13 or 3.14, such as cgi, imp, distutils, telnetlib, the old unittest aliases or ast.Str. It checks 43 rules. For each finding it shows the line number, the version that removed it, the PEP or What's New source, and the replacement to use."}}, {"@type": "Question", "name": "Who is Python Upgrade Lint for?", "acceptedAnswer": {"@type": "Answer", "text": "Python developers and platform teams moving services off Python 3.10 before its October 2026 end of life, and anyone upgrading a Django, Flask, script or data-pipeline codebase to Python 3.12, 3.13 or 3.14. It also suits reviewers of AI-written Python, because assistants trained on older code can still produce imports such as cgi, imp or distutils."}}, {"@type": "Question", "name": "Why not ask a chatbot or rely on a free tool?", "acceptedAnswer": {"@type": "Answer", "text": "A chatbot lists removed modules from memory. It does not read your file line by line, and it often mixes up the version: imp was removed in 3.12, cgi in 3.13 and ast.Str in 3.14. Running the new interpreter only shows the first ModuleNotFoundError, one at a time. This checker applies one fixed table of 43 rules and reports every hit at once."}}, {"@type": "Question", "name": "What is free and what needs a licence key?", "acceptedAnswer": {"@type": "Answer", "text": "Free, with no key: check one open .py file against all 43 rules, in VS Code or pasted into the web page, and pick 3.12, 3.13 or 3.14 as the target. The paid licence ($29 once, one key per person or team seat) adds a whole-workspace sweep in one pass and a Markdown upgrade report for each target version to attach to the migration ticket."}}, {"@type": "Question", "name": "What does it cost to find these lines by hand?", "acceptedAnswer": {"@type": "Answer", "text": "By hand, a developer greps for each removed module and API, cross-checks the Python What's New pages for 3.12, 3.13 and 3.14, and then fixes the hits. The US median software developer wage is $63.98 an hour (BLS, May 2024), so every hour of searching costs about that much. On our 46-line sample file the checker reported 14 findings at once."}}]}</script><div id="yj-ask" style="margin:36px 0 0;padding:18px 18px 16px;border:1px solid #e2e6ea;border-radius:10px;background:#fbfbfc"><h2 style="font:600 19px/1.3 system-ui,sans-serif;margin:0 0 4px;color:#1b1f24">Ask about this tool</h2><p style="font:400 13.5px/1.5 system-ui,sans-serif;margin:0 0 12px;color:#5b6570">One question, answered by the person who built it. Your email only if you want the answer sent.</p><form onsubmit="return yjAsk(event)" style="display:grid;gap:8px"><textarea name="question" required minlength="10" maxlength="2000" rows="3" placeholder="Your question" style="font:14px/1.5 system-ui,sans-serif;padding:10px;border:1px solid #cfd6dd;border-radius:6px"></textarea><div style="display:flex;gap:8px;flex-wrap:wrap"><input type="email" name="email" placeholder="Email (optional)" style="flex:1;min-width:200px;font:14px system-ui,sans-serif;padding:9px 10px;border:1px solid #cfd6dd;border-radius:6px"><button type="submit" style="font:600 14px system-ui,sans-serif;padding:9px 18px;border:0;border-radius:6px;background:#1b1f24;color:#fff;cursor:pointer">Send</button></div><p id="yj-ask-msg" style="font:13px system-ui,sans-serif;margin:2px 0 0;color:#0a6238;min-height:1em"></p></form><script>function yjAsk(e){e.preventDefault();var f=e.target,m=document.getElementById("yj-ask-msg");m.style.color="#0a6238";fetch(location.origin+"/api/ask",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sku:208065,slug:"python-upgrade-removed-api-lint",lang:"en",question:f.question.value,email:f.email.value,page:location.pathname})}).then(function(r){if(!r.ok)throw 0;m.textContent="Thanks \u2014 noted. Answers land on this page and, if you left an email, in your inbox.";f.question.value="";}).catch(function(){m.style.color="#a8551f";m.textContent="Could not send. Please try again in a minute.";});return false;}</script></div></section><!--yj-embed-s178--><details id="embed" data-yj="yj-embed" style="max-width:46rem;margin:1.6rem auto;padding:.85rem 1.1rem;border:1px solid #8884;border-radius:10px"><summary style="cursor:pointer;font-weight:600">Embed this tool on your site (free)</summary><p style="margin:.6rem 0;opacity:.85">Paste this code into your page. It runs in your visitor’s browser and stays up to date. Nothing your visitors type is stored.</p><textarea readonly rows="6" style="width:100%;font:12px/1.4 ui-monospace,Menlo,Consolas,monospace;border:1px solid #8886;border-radius:7px;padding:.5rem">&lt;iframe src=&quot;https://getreadystack.com/embed/python-upgrade-removed-api-lint/&quot; title=&quot;Python 3.12 Removed modules — check your python code free&quot; loading=&quot;lazy&quot; data-rs-embed=&quot;en-python-upgrade-removed-api-lint&quot; style=&quot;width:100%;max-width:760px;height:640px;border:1px solid #e3e3e3;border-radius:10px&quot;&gt;&lt;/iframe&gt;
&lt;p style=&quot;font-size:13px;margin:6px 0 0&quot;&gt;&lt;a href=&quot;https://getreadystack.com/tools/python-upgrade-removed-api-lint&quot;&gt;Python 3.12 Removed modules — check your python code free&lt;/a&gt; by &lt;a href=&quot;https://getreadystack.com/&quot;&gt;ReadyStack&lt;/a&gt;&lt;/p&gt;
&lt;script&gt;window.addEventListener(&quot;message&quot;,function(e){if(e.origin!==&quot;https://getreadystack.com&quot;||!e.data||e.data.type!==&quot;readystack-embed&quot;)return;var f=document.querySelectorAll(&quot;iframe[data-rs-embed]&quot;);for(var i=0;i&lt;f.length;i++){if(f[i].contentWindow===e.source)f[i].style.height=Math.min(e.data.h+6,8000)+&quot;px&quot;;}});&lt;/script&gt;</textarea><p style="margin:.5rem 0 0"><button type="button" data-yj="yj-embed-copy" style="font:inherit;padding:8px 14px;border:1px solid #8884;border-radius:9px;background:transparent;cursor:pointer">Copy code</button> &nbsp;<a href="/embed/">All embeddable tools</a></p><p style="margin:.7rem 0 0;font-size:.92em;opacity:.9">For businesses: your name and logo instead of ours, and each visitor’s result + e-mail in your inbox (only when they tick consent) — Pro from $19/month. <a href="/embed/pro/?ref=embed_box">See Pro &rarr;</a></p></details><script data-yj="yj-embed">(function(){var b=document.querySelector("[data-yj=yj-embed-copy]");if(!b)return;var t=b.textContent;b.addEventListener("click",function(){var a=b.closest("details").querySelector("textarea");var v=a.value;function d(){b.textContent="Copied";setTimeout(function(){b.textContent=t;},1800);}if(navigator.clipboard&&navigator.clipboard.writeText){navigator.clipboard.writeText(v).then(d,function(){a.select();});}else{a.select();}});})();</script><section class="yj-related" style="max-width:920px;margin:56px auto 40px;padding:0 20px"><h2 style="font:600 21px/1.3 system-ui,sans-serif;margin:0 0 6px;color:#1b1f24">Same job, next tool</h2><p style="font:400 14.5px/1.5 system-ui,sans-serif;margin:0 0 20px;color:#5b6570">Free in the browser. The full version is a one-time licence.</p><div style="display:grid;grid-template-columns:repeat(auto-fill,minmax(250px,1fr));gap:14px"><a class="yj-rel-c" href="https://getreadystack.com/tools/angular-removed-api-lint?ref=related"><span class="yj-rel-t">Angular Removed-API Lint</span><span class="yj-rel-p">$29</span></a><a class="yj-rel-c" href="https://getreadystack.com/tools/base-image-eol-lint?ref=related"><span class="yj-rel-t">Base Image EOL Lint - Dockerfile and CI end-of-life check</span><span class="yj-rel-p">$29</span></a><a class="yj-rel-c" href="https://getreadystack.com/tools/k8s-removed-api-lint?ref=related"><span class="yj-rel-t">Kubernetes Removed API Lint</span><span class="yj-rel-p">$29</span></a><a class="yj-rel-c" href="https://getreadystack.com/tools/cloud-manifest-audit-kit?ref=related"><span class="yj-rel-t">Manifest Snippets + Removed-API Audit (8 Sets)</span><span class="yj-rel-p">$29</span></a><a class="yj-rel-c" href="https://getreadystack.com/tools/personal-data-map-dsar-audit?ref=related"><span class="yj-rel-t">Personal Data Map: find every column a GDPR subject access request has to reac</span><span class="yj-rel-p">$29</span></a><a class="yj-rel-c" href="https://getreadystack.com/tools/robots-txt-ai-crawler-audit?ref=related"><span class="yj-rel-t">AI Crawler Rules - robots.txt Audit for AI Search</span><span class="yj-rel-p">$29</span></a></div><style>.yj-rel-c{display:flex;flex-direction:column;gap:8px;padding:15px 16px;border:1px solid #e2e6ea;border-radius:6px;text-decoration:none;background:#fff}.yj-rel-c:hover{border-color:#b9c2cb;background:#fafbfc}.yj-rel-t{font:500 14.5px/1.42 system-ui,sans-serif;color:#1b1f24}.yj-rel-p{font:600 13px system-ui,sans-serif;color:#0a6238}</style></section>
<script data-yj="yj-prefill-s181 v1">(function(){try{var q=new URLSearchParams(location.search);if(!q.toString())return;var P={"R": {"employee": ["employee|w-?2\\b|arbeitnehmer|angestellt|会社員|従業員|給与所得|trabajador|asalariad|empregad|clt\\b|salari", "Employee"], "self": ["self-?employ|freelanc|sole (trader|prop)|selbst(ä|ae)ndig|freiberuf|個人事業|フリーランス|aut(ó|o)nom|\\bmei\\b", "Freelancer / self-employed"], "landlord": ["landlord|rental|vermiet|大家|不動産|arrendador|alquiler|locador|aluguel", "Landlord"], "investor": ["invest|trader|anleger|投資|inversor|investidor", "Investor / trader"], "employer": ["employer|arbeitgeber|雇用主|事業主|empleador|empregador", "Employer"], "seller": ["seller|online shop|h(ä|ae)ndler|販売|vendedor|e-?commerce", "Online seller"]}, "C": {"US": "^(us|usa)$|united states|estados unidos|vereinigte staaten|アメリカ|米国", "UK": "^(uk|gb)$|united kingdom|great britain|reino unido|vereinigtes k|イギリス|英国", "DE": "^de$|germany|deutschland|alemania|alemanha|ドイツ", "JP": "^jp$|japan|jap(ó|ã|o)n?|日本", "ES": "^es$|spain|españa|espana|espanha|spanien|スペイン", "BR": "^br$|brazil|brasil|ブラジル"}, "B": "your 2027 dates", "L": "en"};function ours(el){return !!(el&&el.closest&&el.closest("[data-yj],[data-yj-cta],[data-yj-cal],.yj-email-gate,.yj-find,.yj-related,#yj-ask,#yjgo,#yjr,header,footer,nav"));}function fields(){var r=document.querySelector("main")||document.body;return [].filter.call(r.querySelectorAll("input,select,textarea"),function(el){var t=(el.type||"").toLowerCase();return !ours(el)&&!el.disabled&&["email","hidden","search","password","file","submit","button","reset","image"].indexOf(t)<0;});}function key(el){return el.getAttribute("data-k")||el.id||el.name||"";}function fire(el){["input","change"].forEach(function(n){try{el.dispatchEvent(new Event(n,{bubbles:true}))}catch(e){}});}function setv(el,v){v=String(v).slice(0,80);var t=(el.type||"").toLowerCase(),tg=el.tagName;if(tg=="SELECT"){var o=[].filter.call(el.options,function(o){return o.value==v||o.text.trim()==v})[0];if(!o)return false;el.value=o.value;}else if(t=="checkbox"||t=="radio"){if(!/^(1|0|true|false|on|off|yes|no)$/i.test(v))return false;el.checked=/^(1|true|on|yes)$/i.test(v);}else if(t=="number"||t=="range"){var n=parseFloat(v.replace(/\s/g,"").replace(",","."));if(!isFinite(n))return false;el.value=String(n);}else if(t=="date"){if(!/^\d{4}-\d{2}-\d{2}$/.test(v))return false;el.value=v;}else{if(/[<>]/.test(v))return false;el.value=v;}fire(el);return true;}function pick(el,rx){if(el.tagName!="SELECT")return false;var re=new RegExp(rx,"i");var o=[].filter.call(el.options,function(o){return re.test(o.value)||re.test(o.text)})[0];if(!o||el.value==o.value)return false;el.value=o.value;fire(el);return true;}function run(){var F=fields(),done={},n=0;q.forEach(function(v,k){if(n>=20||/^(ref|role|cc|utm_.*|fbclid|gclid)$/.test(k)||!/^[A-Za-z0-9_-]{1,40}$/.test(k))return;F.forEach(function(el){if(key(el)===k&&!done[k]&&setv(el,v)){done[k]=1;n++;}});});var cc=(q.get("cc")||"").toUpperCase().replace(/[^A-Z]/g,"");if(P.C[cc])F.forEach(function(el){var k=key(el);if(!done[k]&&/country|land|pa(i|í)s|pays|国/i.test(k+" "+(el.id||""))&&pick(el,P.C[cc])){done[k]=1;n++;}});var ro=(q.get("role")||"").replace(/[^a-z]/g,""),R=P.R[ro];if(R)F.forEach(function(el){var k=key(el);if(!done[k]&&el.tagName=="SELECT"&&[].some.call(el.options,function(o){return [].some.call(Object.keys(P.R),function(x){return new RegExp(P.R[x][0],"i").test(o.text)})})&&pick(el,R[0])){done[k]=1;n++;}});if(q.get("ref")=="calendar"){var h=document.querySelector("main h1")||document.querySelector("h1");var d=document.createElement("div");d.setAttribute("data-yj","yj-prefill-back");d.style.cssText="margin:.4rem 0 .8rem;font:15px/1.5 system-ui,sans-serif;opacity:.9";var a=document.createElement("a");a.href="/"+P.L+"/calendar/?ref=tool"+(R?"&role="+ro:"")+(P.C[cc]?"&cc="+cc:"");a.textContent=(R?R[1]+" \u00b7 ":"")+P.B+" \u2192";d.appendChild(a);if(h&&h.parentNode)h.parentNode.insertBefore(d,h.nextSibling);}document.documentElement.setAttribute("data-yj-prefilled",String(n));}if(document.readyState=="loading")document.addEventListener("DOMContentLoaded",run);else run();}catch(e){}})();</script>
</body>
</html>