@vercel/python 4.7.1 → 4.7.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -302,9 +302,9 @@ var require_path_key = __commonJS({
302
302
  }
303
303
  });
304
304
 
305
- // ../../node_modules/.pnpm/cross-spawn@6.0.6/node_modules/cross-spawn/lib/util/resolveCommand.js
305
+ // ../../node_modules/.pnpm/cross-spawn@6.0.5/node_modules/cross-spawn/lib/util/resolveCommand.js
306
306
  var require_resolveCommand = __commonJS({
307
- "../../node_modules/.pnpm/cross-spawn@6.0.6/node_modules/cross-spawn/lib/util/resolveCommand.js"(exports, module2) {
307
+ "../../node_modules/.pnpm/cross-spawn@6.0.5/node_modules/cross-spawn/lib/util/resolveCommand.js"(exports, module2) {
308
308
  "use strict";
309
309
  var path = require("path");
310
310
  var which2 = require_which();
@@ -312,8 +312,7 @@ var require_resolveCommand = __commonJS({
312
312
  function resolveCommandAttempt(parsed, withoutPathExt) {
313
313
  const cwd = process.cwd();
314
314
  const hasCustomCwd = parsed.options.cwd != null;
315
- const shouldSwitchCwd = hasCustomCwd && process.chdir !== void 0;
316
- if (shouldSwitchCwd) {
315
+ if (hasCustomCwd) {
317
316
  try {
318
317
  process.chdir(parsed.options.cwd);
319
318
  } catch (err) {
@@ -327,9 +326,7 @@ var require_resolveCommand = __commonJS({
327
326
  });
328
327
  } catch (e) {
329
328
  } finally {
330
- if (shouldSwitchCwd) {
331
- process.chdir(cwd);
332
- }
329
+ process.chdir(cwd);
333
330
  }
334
331
  if (resolved) {
335
332
  resolved = path.resolve(hasCustomCwd ? parsed.options.cwd : "", resolved);
@@ -343,9 +340,9 @@ var require_resolveCommand = __commonJS({
343
340
  }
344
341
  });
345
342
 
346
- // ../../node_modules/.pnpm/cross-spawn@6.0.6/node_modules/cross-spawn/lib/util/escape.js
343
+ // ../../node_modules/.pnpm/cross-spawn@6.0.5/node_modules/cross-spawn/lib/util/escape.js
347
344
  var require_escape = __commonJS({
348
- "../../node_modules/.pnpm/cross-spawn@6.0.6/node_modules/cross-spawn/lib/util/escape.js"(exports, module2) {
345
+ "../../node_modules/.pnpm/cross-spawn@6.0.5/node_modules/cross-spawn/lib/util/escape.js"(exports, module2) {
349
346
  "use strict";
350
347
  var metaCharsRegExp = /([()\][%!^"`<>&|;, *?])/g;
351
348
  function escapeCommand(arg) {
@@ -354,8 +351,8 @@ var require_escape = __commonJS({
354
351
  }
355
352
  function escapeArgument(arg, doubleEscapeMetaChars) {
356
353
  arg = `${arg}`;
357
- arg = arg.replace(/(?=(\\+?)?)\1"/g, '$1$1\\"');
358
- arg = arg.replace(/(?=(\\+?)?)\1$/, "$1$1");
354
+ arg = arg.replace(/(\\*)"/g, '$1$1\\"');
355
+ arg = arg.replace(/(\\*)$/, "$1$1");
359
356
  arg = `"${arg}"`;
360
357
  arg = arg.replace(metaCharsRegExp, "^$1");
361
358
  if (doubleEscapeMetaChars) {
@@ -394,9 +391,9 @@ var require_shebang_command = __commonJS({
394
391
  }
395
392
  });
396
393
 
397
- // ../../node_modules/.pnpm/cross-spawn@6.0.6/node_modules/cross-spawn/lib/util/readShebang.js
394
+ // ../../node_modules/.pnpm/cross-spawn@6.0.5/node_modules/cross-spawn/lib/util/readShebang.js
398
395
  var require_readShebang = __commonJS({
399
- "../../node_modules/.pnpm/cross-spawn@6.0.6/node_modules/cross-spawn/lib/util/readShebang.js"(exports, module2) {
396
+ "../../node_modules/.pnpm/cross-spawn@6.0.5/node_modules/cross-spawn/lib/util/readShebang.js"(exports, module2) {
400
397
  "use strict";
401
398
  var fs2 = require("fs");
402
399
  var shebangCommand = require_shebang_command();
@@ -1491,9 +1488,9 @@ var require_semver = __commonJS({
1491
1488
  }
1492
1489
  });
1493
1490
 
1494
- // ../../node_modules/.pnpm/cross-spawn@6.0.6/node_modules/cross-spawn/lib/parse.js
1491
+ // ../../node_modules/.pnpm/cross-spawn@6.0.5/node_modules/cross-spawn/lib/parse.js
1495
1492
  var require_parse = __commonJS({
1496
- "../../node_modules/.pnpm/cross-spawn@6.0.6/node_modules/cross-spawn/lib/parse.js"(exports, module2) {
1493
+ "../../node_modules/.pnpm/cross-spawn@6.0.5/node_modules/cross-spawn/lib/parse.js"(exports, module2) {
1497
1494
  "use strict";
1498
1495
  var path = require("path");
1499
1496
  var niceTry = require_src();
@@ -1577,9 +1574,9 @@ var require_parse = __commonJS({
1577
1574
  }
1578
1575
  });
1579
1576
 
1580
- // ../../node_modules/.pnpm/cross-spawn@6.0.6/node_modules/cross-spawn/lib/enoent.js
1577
+ // ../../node_modules/.pnpm/cross-spawn@6.0.5/node_modules/cross-spawn/lib/enoent.js
1581
1578
  var require_enoent = __commonJS({
1582
- "../../node_modules/.pnpm/cross-spawn@6.0.6/node_modules/cross-spawn/lib/enoent.js"(exports, module2) {
1579
+ "../../node_modules/.pnpm/cross-spawn@6.0.5/node_modules/cross-spawn/lib/enoent.js"(exports, module2) {
1583
1580
  "use strict";
1584
1581
  var isWin = process.platform === "win32";
1585
1582
  function notFoundError(original, syscall) {
@@ -1627,9 +1624,9 @@ var require_enoent = __commonJS({
1627
1624
  }
1628
1625
  });
1629
1626
 
1630
- // ../../node_modules/.pnpm/cross-spawn@6.0.6/node_modules/cross-spawn/index.js
1627
+ // ../../node_modules/.pnpm/cross-spawn@6.0.5/node_modules/cross-spawn/index.js
1631
1628
  var require_cross_spawn = __commonJS({
1632
- "../../node_modules/.pnpm/cross-spawn@6.0.6/node_modules/cross-spawn/index.js"(exports, module2) {
1629
+ "../../node_modules/.pnpm/cross-spawn@6.0.5/node_modules/cross-spawn/index.js"(exports, module2) {
1633
1630
  "use strict";
1634
1631
  var cp = require("child_process");
1635
1632
  var parse = require_parse();
@@ -1805,9 +1802,9 @@ var require_once = __commonJS({
1805
1802
  }
1806
1803
  });
1807
1804
 
1808
- // ../../node_modules/.pnpm/end-of-stream@1.4.4/node_modules/end-of-stream/index.js
1805
+ // ../../node_modules/.pnpm/end-of-stream@1.4.1/node_modules/end-of-stream/index.js
1809
1806
  var require_end_of_stream = __commonJS({
1810
- "../../node_modules/.pnpm/end-of-stream@1.4.4/node_modules/end-of-stream/index.js"(exports, module2) {
1807
+ "../../node_modules/.pnpm/end-of-stream@1.4.1/node_modules/end-of-stream/index.js"(exports, module2) {
1811
1808
  var once = require_once();
1812
1809
  var noop = function() {
1813
1810
  };
@@ -1827,7 +1824,6 @@ var require_end_of_stream = __commonJS({
1827
1824
  var rs = stream._readableState;
1828
1825
  var readable = opts.readable || opts.readable !== false && stream.readable;
1829
1826
  var writable = opts.writable || opts.writable !== false && stream.writable;
1830
- var cancelled = false;
1831
1827
  var onlegacyfinish = function() {
1832
1828
  if (!stream.writable)
1833
1829
  onfinish();
@@ -1849,14 +1845,9 @@ var require_end_of_stream = __commonJS({
1849
1845
  callback.call(stream, err);
1850
1846
  };
1851
1847
  var onclose = function() {
1852
- process.nextTick(onclosenexttick);
1853
- };
1854
- var onclosenexttick = function() {
1855
- if (cancelled)
1856
- return;
1857
- if (readable && !(rs && (rs.ended && !rs.destroyed)))
1848
+ if (readable && !(rs && rs.ended))
1858
1849
  return callback.call(stream, new Error("premature close"));
1859
- if (writable && !(ws && (ws.ended && !ws.destroyed)))
1850
+ if (writable && !(ws && ws.ended))
1860
1851
  return callback.call(stream, new Error("premature close"));
1861
1852
  };
1862
1853
  var onrequest = function() {
@@ -1881,7 +1872,6 @@ var require_end_of_stream = __commonJS({
1881
1872
  stream.on("error", onerror);
1882
1873
  stream.on("close", onclose);
1883
1874
  return function() {
1884
- cancelled = true;
1885
1875
  stream.removeListener("complete", onfinish);
1886
1876
  stream.removeListener("abort", onclose);
1887
1877
  stream.removeListener("request", onrequest);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vercel/python",
3
- "version": "4.7.1",
3
+ "version": "4.7.3",
4
4
  "main": "./dist/index.js",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "https://vercel.com/docs/runtimes#official-runtimes/python",
@@ -19,7 +19,7 @@
19
19
  "@types/jest": "27.4.1",
20
20
  "@types/node": "14.18.33",
21
21
  "@types/which": "3.0.0",
22
- "@vercel/build-utils": "9.1.0",
22
+ "@vercel/build-utils": "10.6.7",
23
23
  "cross-env": "7.0.3",
24
24
  "execa": "^1.0.0",
25
25
  "fs-extra": "11.1.1",
package/vc_init.py CHANGED
@@ -274,28 +274,24 @@ if 'VERCEL_IPC_PATH' in os.environ:
274
274
  env[key] = wsgi_encoding_dance(value)
275
275
  for k, v in self.headers.items():
276
276
  env['HTTP_' + k.replace('-', '_').upper()] = v
277
- # Response body
278
- body = BytesIO()
279
277
 
280
278
  def start_response(status, headers, exc_info=None):
281
279
  self.send_response(int(status.split(' ')[0]))
282
280
  for name, value in headers:
283
281
  self.send_header(name, value)
284
282
  self.end_headers()
285
- return body.write
283
+ return self.wfile.write
286
284
 
287
285
  # Call the application
288
286
  response = app(env, start_response)
289
287
  try:
290
288
  for data in response:
291
289
  if data:
292
- body.write(data)
290
+ self.wfile.write(data)
291
+ self.wfile.flush()
293
292
  finally:
294
293
  if hasattr(response, 'close'):
295
294
  response.close()
296
- body = body.getvalue()
297
- self.wfile.write(body)
298
- self.wfile.flush()
299
295
  else:
300
296
  from urllib.parse import urlparse
301
297
  from io import BytesIO