[issue36153] Freeze support documentation is misleading.

2019-03-01 Thread Sridhar Iyer


Sridhar Iyer  added the comment:

Please find the attached python file where the issue is seen.
The cli to create an executable was:
$pyinstaller run_server_min.spec

Here are the contents of the file (this doesn't support multiple file uploads):

# -*- mode: python ; coding: utf-8 -*-

block_cipher = None


a = Analysis(['run_server_min.py'],
 pathex=[''],
 binaries=[],
 datas=[],
 hiddenimports=['sklearn.neighbors.typedefs', 
'sklearn.neighbors.quad_tree', 'sklearn.tree._utils', 'xgboost', 
'xgboost.libpath'],
 hookspath=['pyhooks'],
 runtime_hooks=[],
 excludes=[],
 win_no_prefer_redirects=False,
 win_private_assemblies=False,
 cipher=block_cipher,
 noarchive=False)
pyz = PYZ(a.pure, a.zipped_data,
 cipher=block_cipher)
exe = EXE(pyz,
  a.scripts,
  a.binaries,
  a.zipfiles,
  a.datas,
  [],
  name='run_server_min',
  debug=False,
  bootloader_ignore_signals=False,
  strip=False,
  upx=False,
  runtime_tmpdir=None,
  console=True )
=

$ pyinstaller run_server_min.spec
69 INFO: PyInstaller: 3.5.dev0+cb8d10af6
69 INFO: Python: 3.6.7
70 INFO: Platform: Linux-3.16.0-77-generic-x86_64-with-debian-jessie-sid
...

When your run ./dist/run_server_min that is generated, it'll spawn the process 
multiple times. The issue goes away when you add freeze_support on the top.

--
Added file: https://bugs.python.org/file48182/run_server_min.py

___
Python tracker 
<https://bugs.python.org/issue36153>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36153] Freeze support documentation is misleading.

2019-02-28 Thread Sridhar Iyer


New submission from Sridhar Iyer :

The documentation on freeze_support listed on 
https://docs.python.org/3/library/multiprocessing.html need to be fixed

This mentions:
"Calling freeze_support() has no effect when invoked on any operating system 
other than Windows. In addition, if the module is being run normally by the 
Python interpreter on Windows (the program has not been frozen), then 
freeze_support() has no effect."

This is not true. Sklearn/tensorflow libraries tend to cause an infinite loop 
when frozen with pyinstaller (tested on python 3.6 on ubuntu 14.04). 
freeze_support is the only way to get around the situation and should be 
included before including any other module that includes a multiprocessing 
library (not just in main).

--
assignee: docs@python
components: Documentation
messages: 336881
nosy: Sridhar Iyer, docs@python
priority: normal
severity: normal
status: open
title: Freeze support documentation is misleading.
versions: Python 2.7, Python 3.4, Python 3.5, Python 3.6, Python 3.7

___
Python tracker 
<https://bugs.python.org/issue36153>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com