Activity log for bug #678263

Date Who What changed Old value New value Message
2010-11-21 19:52:14 David Levine bug added bug
2010-11-21 19:52:14 David Levine attachment added Patch to add warning about LC_CTYPE to cups.py. https://bugs.launchpad.net/bugs/678263/+attachment/1740565/+files/cups.py.diff
2010-11-21 19:54:05 David Levine description Please apply the attached patch to prnt/cups.py. It is very simple: if current_ctype is not None: + #### Note: if does not help to set LC_CTYPE to C above (from + #### newctype). This setting here matters. os.environ['LC_CTYPE'] = current_ctype + if len(current_ctype) > 0 and current_ctype != "C": + log.warn("LC_CTYPE is " + current_ctype + ". If a PPD file cannot be found: cancel, unset your LC_CTYPE https://bugs.launchpad.net/debian/+source/hplip/+bug/344137 and https://bugs.launchpad.net/hplip/+bug/162196environment variable, and rerun.") It adds a warning if LC_CTYPE is set to anything other than C. With LC_CTYPE set to en_US, at least, hp-setup is not able to find the PPD file for a Photosmart C7280. With this patch, I get a useful warning from both hp-check and hp-setup. Without it, this problem is difficult to track down. See, for example, https://bugs.launchpad.net/debian/+source/hplip/+bug/344137 and https://bugs.launchpad.net/hplip/+bug/162196 I expect this this problem has caused grief for many, many other people. The patch also includes a comment noting that attempting to set LC_CTYPE to C prior to the "import cupsext" doesn't solve the problem. An alternative approach to solving this problem might be to replace the warning with a hard-coded assignment of LC_CTYPE to C here. I don't know if that is a good idea or not. Here is how I tested this patch: # cd /usr/share/hplip/ #### Where the prnt/ directory containing cups.py* is located. # patch < /tmp/cups.py.diff # env -i PYTHONPATH=. python -i cups.py # env -i PYTHONPATH=. python -i -O cups.py $ LC_CTYPE=en_US hp-check #### Triggers the warning. $ LC_CTYPE=en_US hp-setup #### Triggers the warning. $ LC_CTYPE= hp-setup #### Allows successful setup! Please apply the attached patch to prnt/cups.py. It is very simple: if current_ctype is not None: + #### Note: if does not help to set LC_CTYPE to C above (from + #### newctype). This setting here matters. os.environ['LC_CTYPE'] = current_ctype + if len(current_ctype) > 0 and current_ctype != "C": + log.warn("LC_CTYPE is " + current_ctype + ". If a PPD file cannot be found: cancel, unset your LC_CTYPE environment variable, and rerun.") It adds a warning if LC_CTYPE is set to anything other than C. With LC_CTYPE set to en_US, at least, hp-setup is not able to find the PPD file for a Photosmart C7280. With this patch, I get a useful warning from both hp-check and hp-setup. Without it, this problem is difficult to track down. See, for example, https://bugs.launchpad.net/debian/+source/hplip/+bug/344137 and https://bugs.launchpad.net/hplip/+bug/162196 I expect this this problem has caused grief for many, many other people. The patch also includes a comment noting that attempting to set LC_CTYPE to C prior to the "import cupsext" doesn't solve the problem. An alternative approach to solving this problem might be to replace the warning with a hard-coded assignment of LC_CTYPE to C here. I don't know if that is a good idea or not. Here is how I tested this patch: # cd /usr/share/hplip/ #### Where the prnt/ directory containing cups.py* is located. # patch < /tmp/cups.py.diff # env -i PYTHONPATH=. python -i cups.py # env -i PYTHONPATH=. python -i -O cups.py $ LC_CTYPE=en_US hp-check #### Triggers the warning. $ LC_CTYPE=en_US hp-setup #### Triggers the warning. $ LC_CTYPE= hp-setup #### Allows successful setup!
2010-11-21 20:15:01 David Levine description Please apply the attached patch to prnt/cups.py. It is very simple: if current_ctype is not None: + #### Note: if does not help to set LC_CTYPE to C above (from + #### newctype). This setting here matters. os.environ['LC_CTYPE'] = current_ctype + if len(current_ctype) > 0 and current_ctype != "C": + log.warn("LC_CTYPE is " + current_ctype + ". If a PPD file cannot be found: cancel, unset your LC_CTYPE environment variable, and rerun.") It adds a warning if LC_CTYPE is set to anything other than C. With LC_CTYPE set to en_US, at least, hp-setup is not able to find the PPD file for a Photosmart C7280. With this patch, I get a useful warning from both hp-check and hp-setup. Without it, this problem is difficult to track down. See, for example, https://bugs.launchpad.net/debian/+source/hplip/+bug/344137 and https://bugs.launchpad.net/hplip/+bug/162196 I expect this this problem has caused grief for many, many other people. The patch also includes a comment noting that attempting to set LC_CTYPE to C prior to the "import cupsext" doesn't solve the problem. An alternative approach to solving this problem might be to replace the warning with a hard-coded assignment of LC_CTYPE to C here. I don't know if that is a good idea or not. Here is how I tested this patch: # cd /usr/share/hplip/ #### Where the prnt/ directory containing cups.py* is located. # patch < /tmp/cups.py.diff # env -i PYTHONPATH=. python -i cups.py # env -i PYTHONPATH=. python -i -O cups.py $ LC_CTYPE=en_US hp-check #### Triggers the warning. $ LC_CTYPE=en_US hp-setup #### Triggers the warning. $ LC_CTYPE= hp-setup #### Allows successful setup! Please apply the attached patch to prnt/cups.py. It is very simple: if current_ctype is not None: + #### Note: if does not help to set LC_CTYPE to C above (from + #### newctype). This setting here matters. os.environ['LC_CTYPE'] = current_ctype + if len(current_ctype) > 0 and current_ctype != "C": + log.warn("LC_CTYPE is " + current_ctype + ". If a PPD file cannot be found: cancel, unset your LC_CTYPE environment variable, and rerun.") It adds a warning if LC_CTYPE is set to anything other than C. With LC_CTYPE set to en_US, at least, hp-setup is not able to find the PPD file for a Photosmart C7280. With this patch, I get a useful warning from both hp-check and hp-setup. Without it, this problem is difficult to track down. See, for example, https://bugs.launchpad.net/hplip/+bug/225970 and https://bugs.launchpad.net/hplip/+bug/162196 I expect this this problem has caused grief for many, many other people. The patch also includes a comment noting that attempting to set LC_CTYPE to C prior to the "import cupsext" doesn't solve the problem. An alternative approach to solving this problem might be to replace the warning with a hard-coded assignment of LC_CTYPE to C here. I don't know if that is a good idea or not. Here is how I tested this patch: # cd /usr/share/hplip/ #### Where the prnt/ directory containing cups.py* is located. # patch < /tmp/cups.py.diff # env -i PYTHONPATH=. python -i cups.py # env -i PYTHONPATH=. python -i -O cups.py $ LC_CTYPE=en_US hp-check #### Triggers the warning. $ LC_CTYPE=en_US hp-setup #### Triggers the warning. $ LC_CTYPE= hp-setup #### Allows successful setup!